Manual Pages for UNIX Darwin command on man MPI_Init_thread
MyWebUniversity

Manual Pages for UNIX Darwin command on man MPI_Init_thread

MPIInitthread(3OpenMPI) MPIInitthread(3OpenMPI)

NAME

MMPPIIIInniitttthhrreeaadd - Initializes the MPI execution environment

SSYYNNTTAAXX CC SSyynnttaaxx

#include

int MPIInitthread(int *argc, char ***argv, int required, int *provided) FFoorrttrraann SSyynnttaaxx INCLUDE 'mpif.h'

MPIINIT(REQUIRED, PROVIDED, IERROR)

INTEGER REQUIRED, PROVIDED, IERROR

CC++++ SSyynnttaaxx

#include

int MPI::Initthread(int& argc, char**& argv, int required) int MPI::Initthread(int required) IINNPPUUTT PPAARRAAMMEETTEERRSS argc C/C++ only: Pointer to the number of arguments. argv C/C++ only: Argument vector. required Desired level of thread support (integer). OOUUTTPPUUTT PPAARRAAMMEETTEERRSS provided Available level of thread support (integer).

IERROR Fortran only: Error status (integer).

DESCRIPTION

This routine, or MPIInit, must be called before any other MPI routine (apart from MPIInitialized) is called. MPI can be initialized at most once; subsequent calls to MPIInit or MPIInitthread are erroneous. MPIInitthread, as compared to MPIInit, has a provision to request a certain level of thread support in required: MPITHREADSINGLE Only one thread will execute. MPITHREADFUNNELED If the process is multithreaded, only the thread that called MPIInitthread will make MPI calls. MPITHREADSERIALIZED If the process is multithreaded, only one thread will make MPI library calls at one time. MPITHREADMULTIPLE If the process is multithreaded, multiple

threads may call MPI at once with no restric-

tions. The level of thread support available to the program is set in provided, except in C++, where it is the return value of the function. In Open MPI, the value is dependent on how the library was configured and built. Note that there is no guarantee that provided will be greater than or equal to required. All MPI programs must contain a call to MPIInit or MPIInitthread. Open MPI accepts the C/C++ argc and argv arguments to main, but neither modifies, interprets, nor distributes them: { /* declare variables */ MPIInitthread(&argc, &argv, req, &prov); /* parse arguments */ /* main program */ MPIFinalize(); } NNOOTTEESS The Fortran version does not have provisions for argc and argv and

takes only IERROR.

It is the caller's responsibility to check the value of provided, as it may be less than what was requested in required. The MPI Standard does not say what a program can do before an

MPIInitthread or after an MPIFinalize. In the Open MPI implementa-

tion, it should do as little as possible. In particular, avoid anything that changes the external state of the program, such as opening files, reading standard input, or writing to standard output. EERRRROORRSS Almost all MPI routines return an error value; C routines as the value

of the function and Fortran routines in the last argument. C++ func-

tions do not return errors. If the default error handler is set to

MPI::ERRORSTHROWEXCEPTIONS, then on error the C++ exception mechanism

will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with

MPICommseterrhandler; the predefined error handler MPIERRORSRETURN

may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error.

SEE ALSO

MPIInit MPIInitialized MPIFinalize Open MPI 1.2 September 2006 MPIInitthread(3OpenMPI)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™