Newsgroups: comp.parallel.pvm
From: Pascal Bauler <pascal.bauler@ci.educ.lu>
Reply-To: pascal.bauler@ci.educ.lu
Subject: Re: passing message between two unrelated processes
Organization: ULg
Date: Sat, 25 Oct 1997 22:59:15 -0400
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <3452B203.5BCF@ci.educ.lu>

Julian Zhao wrote:
> 
> Hi,
> 
> I am MPI user and new in PVM. Now I start two processes by pvm, say A
> and B, separately. In order to pass a message from process A to process
> B, A need to know B's process id (tid). My question is how A gets this
> information to call pvm_send( int tid, int message)?
> 
> Thank you!
> 
> Julian
> 
> --
> Julian Zhao, PhD
> Microcosm Technologies, Inc.
> 101 Rogers St., Suite 213
> Cambridge, MA 02142
> Fax: (617)621-7838
> Email julian@memcad.com

When you want to make interact two indendent tasks there are 2
conditions which must be verified
1. the two tasks must run on the same virtual machine (if the two tasks
are launched by the same user, this condition is verified)
2. you must know the two tids...
in order to do so, each application may create a group (pvm_joingroup).
PVM attributes an instance number to each task inside the group. This
instance number is unique inside 1 group and attributed sequentially
starting with 0.
Now you may get the tids with the instruction pvm_gettid().

Example

task A					

pvm_joingroup("taskA")
tidB=pvm_gettid("taskB",0)


task B

pvm_joingroup("taskB")
tidA=pvm_gettid("taskA",0)
/* now the two tasks may communicate */

Best regards

Pascal

-- 
---------------------------------------------------
Pascal Bauler
Algorithmique et Ingenierie du Logiciel
Universite de Liege

Tel: (0032/4) 366 2609
---------------------------------------------------

