Newsgroups: comp.parallel.pvm
From: Roberto Hortal <rhortal@kasper.abo.fi>
Subject: Re: Misc questions
Organization: Abo Akademi University
Date: Mon, 22 Jan 1996 17:08:44 +0200
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-ID: <Pine.SOL.3.91.960122170128.29256A-100000@kasper.abo.fi>

On 19 Jan 1996, Boris A. Velikovich wrote:

> pvm_send(dest, msgtype) 
> 
> and
> 
> pvm_recv(src, msgtype)
> 
> 
> Question is, does the value of msgtype matter, or we only care that it were
> the same for SEND and RECV commands?
> In my program, I tried different msgtypes (consistent for SEND and RECV),
> and for some values I got into indefinite waiting for RECV! For the values
> that do work, however, I get a run-time error "PVM_UPKINT: End of buffer",
> and I do not know WHY is it happening. Since all PKINTs match all UPKINTs,
> I think the reason is the wrong value of msgtype.
> How to choose the value for msgtype??

the value for msgtype is on you. you can even put a -1 in that field to 
accept any incoming message. The only reason for use the field is if a 
process can receive different kinds of messages in any order, but they 
have to be collected in a determinate order. This means, if you can 
receive a message with the operation to do, and other with the data, and 
you want to pick them in that order, even if the sender does send them in 
another order.
This is also useful in sinchronization (Send an empty sinchro message and 
other process wait for it).

The only thing that can happen with the value of msgtype is that you try 
to use a too large value (msgtype is an INTEGER).

PVM does not use any information of the field msgtype, so you can use any 
integer value for it, normally by defining some maningful constants and 
using them in your code.

> 2) While debugging a PVM program, how to get the spawned programs to print
> their results? I have lots of debugging PRINTs in my spawned program, yet
> for some reason the output disappears!

The standard error/output of the child processes is redirected to the 
file pvml.ID, being id your user id in the host. It's located in the /tmp 
dir of the host where you are executing each slave, so it's a little 
embarrasing to follow.

There's also a pvm function to redirect the standard output/error to the 
master, pvm_catchout(). If the mastrer calls this function BEFORE 
spawning the sons, it'll print all the output of the processes spawned.

Hope this is useful

    _I_
  _I)___I_      
  )_)__)__)     		MADE     IN     SPAIN
 \)_)__)__) \   
 _\I I )I\)_--  
 |________/     
+-+-+-+-+-+-+-+   De la mar el mero, y de la tierra el CONEJO.
			

	Roberto.                rhortal@abo.fi
				rhortal@ceratonia.eui.upv.es
				http://www.abo.fi/~rhortal

