Newsgroups: comp.parallel.pvm
From: spohr@rog.rwth-aachen.de     (Axel Spohr)
Subject: Re: Master and Slave put together...
Organization: Rogowski-Institut
Date: 11 Sep 1995 10:55:18 GMT
Message-ID: <4314im$9i9@news.rwth-aachen.de>

The difference is quite simple if you know it :-)...
XPVM also uses a spawn to start user-programs, so a call to pvm_parent will
result in the tid of the XPVM-process instead of PvmNoParent. To work around
this, I make all my processes join a group. First process to join a group
is the master, everything else is a slave. To distingiush between the two
you can either evaluate the group size, which should be one for the master,
or you can ask for the process ID inside the group, which are handed out
sequentially starting with a 0, so the master will be 0.
Should look something like this :

	if ((inum=pvm_joingroup('pool'))==0)
	{
		/* Master part */
	}
	else
	{
		/* slave part */
	}

Hope this helps...

			Axel


-----------------------------------------------------------------------------
Axel Spohr					     spohr@rog.rwth-aachen.de
Ludwigsallee 1b
D-52062 Aachen						
+49-241-154701
-----------------------------------------------------------------------------



