[MPICH] about MPI_Comm_spawn

David Ashton ashton at mcs.anl.gov
Fri Sep 23 18:17:30 CDT 2005


Under Windows, any MPI application that calls MPI_Comm_spawn must be started
by mpiexec.  If you run "myapp.exe" instead of "mpiexec -n 1 myapp.exe" you
will not be able to call the spawn functions.
-David Ashton

-----Original Message-----
From: owner-mpich-discuss at mcs.anl.gov
[mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of llwaeva at 21cn.com
Sent: Friday, September 23, 2005 8:29 AM
To: mpich
Subject: [MPICH] about MPI_Comm_spawn

hi there,
 I found a sample code to test MPI_Comm_spawn in MPI2 forum 

int main(int argc, char *argv[]) 
{ 
 int world_size, universe_size, *universe_sizep, flag; 
 MPI_Comm everyone;             /* intercommunicator */ 
 char worker_program[100]; 
 
 MPI_Init(&argc, &argv); 
 MPI_Comm_size(MPI_COMM_WORLD, &world_size); 
 
 if (world_size != 1)   printf("Top heavy with management"); 
 
 MPI_Attr_get(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE,  
              &universe_sizep, &flag);  
 if (!flag) 
 { 
    printf("This MPI does not support UNIVERSE_SIZE. How many processes
total?"); 
    scanf("%d", &universe_size); 
 } else universe_size = *universe_sizep; 

 if (universe_size == 1) printf("No room to start workers"); 
 
 MPI_Comm_spawn("matlab.exe", MPI_ARGV_NULL, universe_size-1,
MPI_INFO_NULL, 0, MPI_COMM_SELF, &everyone, MPI_ERRCODES_IGNORE); 
 
 MPI_Finalize(); 
 return 0;
}

 The program above will abnormally shutdown when run !!!? The error code
is 

job aborted:
process: node: exit code: error message:
0: localhost: 13: Fatal error in MPI_Comm_spawn: Other MPI error, error
stack:
MPI_Comm_spawn(128): MPI_Comm_spawn(cmd="matlab.exe", argv=0x00000000,
maxprocs=1, MPI_INFO_NULL, root=0, MPI_COMM_SELF, intercomm=0x0022FEEC,
errors=0x00000000
) failed
MPID_Comm_spawn_multiple(52):
MPIDI_CH3_Comm_spawn_multiple(190): PMI_Spawn_multiple returned -1


And then, I try another testing program in mpi/test/spawn/spawn1, it
also error when I try to run the executable spawn1.exe

Error message: Error encountered before initializing MPICH

Should I run spawn1.exe just issue it in cmd or I need to run ti with
mpiexec ?

thanks.





More information about the mpich-discuss mailing list