Newsgroups: comp.parallel.pvm
From: aspoon@ee.ualberta.ca (Alvin Poon)
Subject: Re: How to spawn in hostless program
Organization: University of Alberta, Edmonton, Canada
Date: 29 Feb 1996 15:38:54 GMT
Message-ID: <4h4hae$180c@pulp.ucs.ualberta.ca>

Ed Blosch <elblosc@ca.sandia.gov> writes:

>In Fortran, how does one spawn (N-1) tasks on the N-1 processors
>listed in the host file, when the spawning task (and PVM) were 
>started on another processor?  I do this:
>machine1%  pvm hostfile
>pvm> quit
>machine1%  prog > prog.out &

>My hostfile has in it:
>machine2
>machine3
>machine4

>and prog tries to spawn 3 processes which end up getting spawned on
>machine1, machine2, machine3, instead of 2,3,4 as I desire.  Would 
>adding machine1 to the host file but assigning it speed = 0 help to
>discourage PVM from spawning there?  Seems to me there should be some
>option to indicate you are using a hostless programming strategy  and
>therefore PVM shouldn't spawn the other workers locally.
>Thanks for any help,
>Ed

(This works in C; I suppose it works in Fortran as well)
When you call pvm_spawn (pvmfspawn?), specify the flag to be
"PvmTaskHost | PvmHostCompl" (specify both flags in Fortran, however
way you can do it) and specify the where argument as "." (a single
period).  The PvmTaskHost specify the "." as the host to be used, the
local host.  The PvmHostCompl complements the host set -- PVM will
spawn on any host but the local host.
This way, you still need a master program running on machine1.  Just a
small one to spawn the slaves and wait 'til they finish.  The slaves
supposedly will die when the master calls pvmfexit.

Also, specifying speed=0 in the hostfile does not help, since PVM does
not use the speed argument internally.  It is only there if your
program makes use of it.

Alvin
--
|| | |  |  |   |   |    |    |     |    |    |   |   |  |  | | ||
|| Alvin S. Poon   |    |    |     |     aspoon@EE.UAlberta.CA ||
|| | |  |  |   |   |    |    |     | poona@GPU.SRV.UAlberta.CA ||
<a href="http://Nyquist.EE.UAlberta.CA/~aspoon/">My Home Page</a>

