GBBL
GBBL

Reputation: 586

MPI_Comm_spawn fails on MSMPI

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 ?

Upvotes: 2

Views: 1855

Answers (1)

Jeremiah Willcock
Jeremiah Willcock

Reputation: 30969

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.

Upvotes: 2

Related Questions