2

I'm trying to use MPI_Comm_spawn to start a second process. Just for demonstration pourposes. The program is quite simple:

int main(int argc, char* argv[])
{   int my_id, numprocs;
MPI_Comm All;
MPI_Init(&argc, &argv) ;                   
MPI_Comm_rank(MPI_COMM_WORLD, &my_id) ;     
     MPI_Comm_size(MPI_COMM_WORLD, &numprocs) ;
cout << "I'm process "<< my_id << " and we are " << numprocs <<endl;
MPI_Comm_spawn("child.exe",MPI_ARGV_NULL,2,MPI_INFO_NULL,my_id,MPI_COMM_WORLD,   &All,MPI_ERRCODES_IGNORE);
MPI_Comm_size(All, &numprocs) ;
cout << "I'm process "<< my_id << " and we are " << numprocs <<endl;
{ 
int i;
cin >> i;
}

MPI_Finalize();                            
return 0;
     }

The child.exe is in the same directory of the compiled program, and is also terribly simple:

 int main(int argc, char* argv[])
    {
int my_id, numprocs,length;
     MPI_Comm Parent;
MPI_Win pwin,gwin;
MPI_Init(&argc, &argv) ;                    
MPI_Comm_rank(MPI_COMM_WORLD, &my_id) ;     
     MPI_Comm_size(MPI_COMM_WORLD, &numprocs) ;       
MPI_Comm_get_parent(&Parent);
cout << "I'm child process "<< my_id << " and we are " << numprocs <<endl;
MPI_Comm_size(Parent, &numprocs) ;
cout << "My parent communicator size is: "<< numprocs <<endl;
MPI_Finalize();                            
     return 0;
}

The parent process fails with a criptic error: C:\Users.....\Documents\Visual Studio 2010\Projects\mpi\x64\Release>mpi.exe I'm process 0 and we are 1

job aborted: [ranks] message

[0] fatal error Fatal error in MPI_Comm_spawn: Other MPI error, error stack: MPI_Comm_spawn(106)..........: MPI_Comm_spawn(cmd="child.exe", argv=0x0000000000 000000, maxprocs=2, MPI_INFO_NULL, root=0, MPI_COMM_WORLD, intercomm=0x000000000 026FC20, errors=0x0000000000000000) failed MPID_Comm_spawn_multiple(314): Function not implemented

What I'm doing wrong.... seem so simple.... MSMPI does not implement MPI_Comm_spawn ?

GBBL
  • 576
  • 1
  • 6
  • 18

1 Answers1

2

According to this document, it is not supported, at least not in Windows HPC Server 2008.

From the document:

MS MPI includes a complete set of MPI2 functionality as implemented in MPICH2 with the exception of dynamic process spawn and publishing, which may be included in a later release.

Shawn Chin
  • 84,080
  • 19
  • 162
  • 191
Jeremiah Willcock
  • 30,161
  • 7
  • 76
  • 78
  • @GBBL: Try now. I tried to edit the old link out from a Google result, and I guess I didn't get the edits right. – Jeremiah Willcock Mar 07 '11 at 16:11
  • Yes. thanks in fact I have tried also HP-MPI which does have a spawn but windows block it taking it as malware..... ;-). – GBBL Mar 09 '11 at 23:47