MPI_INIT, MPI_Init Purpose Initializes MPI. C synopsis #include int MPI_Init(int *argc,char ***argv); C++ synopsis #include mpi.h void MPI::Init(int& argc, char**& argv); #include mpi.h void MPI::Init(); FORTRAN synopsis include 'mpif.h' or use mpi MPI_INIT(INTEGER IERROR) Parameters IERROR is the FORTRAN return code. It is always the last argument. Description This subroutine initializes MPI. All MPI programs must call MPI_INIT before any other MPI routine (with the exception of MPI_INITIALIZED). More than one call to MPI_INIT by any task is erroneous. Notes For either MPI_INIT or MPI_INIT_THREAD, PE MPI normally returns support that is equivalent to MPI_THREAD_MULTIPLE. For more information, see MPI_INIT_THREAD. argc and argv are the arguments passed to main. PE MPI does not examine or modify these arguments when they are passed to MPI_INIT. In accordance with MPI-2, it is valid to pass NULL in place of argc and argv. In a threads environment, MPI_INIT needs to be called once per task and not once per thread. You don't need to call it on the main thread but both MPI_INIT and MPI_FINALIZE must be called on the same thread. MPI_INIT opens a local socket and binds it to a port, sends that information to POE, receives a list of destination addresses and ports, opens a socket to send to each one, verifies that communication can be established, and distributes MPI internal state to each task. In the signal-handling library, this work is done in the initialization stub added by POE, so that the library is open when your main program is called. MPI_INIT sets a flag saying that you called it. In the threads library, the work of MPI_INIT is done when the function is called. The local socket is not open when your main program starts. This may affect the numbering of file descriptors, the use of the environment strings, and the treatment of stdin (the MP_HOLD_STDIN variable). If an existing non-threads program is relinked using the threads library, the code prior to calling MPI_INIT should be examined with these thoughts in mind. Also for the threads library, if you had registered a function as an AIX signal handler for the SIGIO signal at the time that MPI_INIT was called, that function will be added to the interrupt service thread and be processed as a thread function rather than as a signal handler. You'll need to set the environment variable MP_CSS_INTERRUPT=YES to get arriving packets to invoke the interrupt service thread. Related information MPI_FINALIZE MPI_INITIALIZED