[MPICH] Using MPI_COMM_SPAWN correctly
Hrant P. Hratchian
hhratchi at indiana.edu
Wed Oct 25 16:43:55 CDT 2006
It seems as though the spawned processes get spread across the nodes -
mostly. I actually need control over where the spawned processed go. Using
the following (f90) code gets the spawned processes running on pople-n3 as
expected...
Call MPI_INFO_CREATE(PESSMPI_Info,IError)
Call MPI_INFO_SET(PESSMPI_Info,'host','pople-n3',IError)
Call MPI_INFO_SET(PESSMPI_Info,'envlist','path',IError)
Call MPI_INFO_SET(PESSMPI_Info,'wdir','/home/hrant',IError)
Call MPI_COMM_SPAWN('Pseudoatom_PESSMPI',MPI_ARGV_NULL, &
PESSMPI_NProcs,PESSMPI_Info,0,MPI_COMM_WORLD,PESSMPI_Comm_01, &
MPI_ERRCODES_IGNORE,IError)
Call MPI_INFO_FREE(PESSMPI_Info,IError)
However, this runs all PESSMPI_NProcs processes on node 3. To be able to
spread the jobs out I tried...
Call MPI_INFO_CREATE(PESSMPI_Info,IError)
Call MPI_INFO_SET(PESSMPI_Info,'file','mf',IError)
Call MPI_INFO_SET(PESSMPI_Info,'envlist','path',IError)
Call MPI_INFO_SET(PESSMPI_Info,'wdir','/home/hrant',IError)
Call MPI_COMM_SPAWN('Pseudoatom_PESSMPI',MPI_ARGV_NULL, &
PESSMPI_NProcs,PESSMPI_Info,0,MPI_COMM_WORLD,PESSMPI_Comm_01, &
MPI_ERRCODES_IGNORE,IError)
Call MPI_INFO_FREE(PESSMPI_Info,IError)
but this doesn't work at all. The job runs fine but the spawned processes
end up on various machines defined in my mpd.hosts file. The file mf looks
like:
pople-n3
pople-n3
I expected this to work the same as the "host" example before
(PESSMPI_NProcs=2 in these cases). Am I doing something wrong with the
format of my file?
Thanks in advance...Hrant
On 10/25/06, Rajeev Thakur <thakur at mcs.anl.gov> wrote:
>
> Are you using a single MPI_Comm_spawn with maxprocs=4 to spawn the four
> process? In that case, I believe they will get spread across the nodes. If
> you use four separate MPI_Comm_spawns with maxprocs=1, they will get spawned
> on the same node.
>
> Rajeev
>
> ------------------------------
> *From:* owner-mpich-discuss at mcs.anl.gov [mailto:
> owner-mpich-discuss at mcs.anl.gov] *On Behalf Of *Hrant P. Hratchian
> *Sent:* Tuesday, October 24, 2006 11:27 PM
> *To:* mpich-discuss at mcs.anl.gov
> *Subject:* [MPICH] Using MPI_COMM_SPAWN correctly
>
> I'm a basic MPI user and I've built a set of code that uses
> MPI_COMM_SPAWN. The way that the code runs the master process runs on only
> 1 process while the slave processes use n processes.
>
> I have a mpd.hosts file that includes three machines: node_1, node_2, and
> node_3. mpdtrace confirms that the loop has been established and runs over
> all three machines. To run the code I execute the following on node_1:
>
> mpiexec -n 1 Prog_Master test.in >& test.mpilog &
>
> Prog_Master spawns 4 processes using MPI_COMM_SPAWN. Rather than
> spreading the 4 spawned processes across the three machines listed in
> mpd.hosts (where the loop is running), all 4 spawned processes run on
> node_1.
>
> Am I doing something wrong here?
>
> Thanks in advance.
> HPH
>
> --
> Hrant P. Hratchian, Ph.D.
> E. R. Davidson Fellow
> Department of Chemistry
> Indiana University
> Bloomington, Indiana 47405-7102
> 812.856.0829
> hhratchi at indiana.edu
>
>
--
Hrant P. Hratchian, Ph.D.
E. R. Davidson Fellow
Department of Chemistry
Indiana University
Bloomington, Indiana 47405-7102
812.856.0829
hhratchi at indiana.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20061025/d9d160e7/attachment.htm>
More information about the mpich-discuss
mailing list