Open MPI logo

MPI_T_init_thread(3) man page (version 5.0.0rc2)

  |   Home   |   Support   |   FAQ   |  

« Return to documentation listing

Table of Contents

Name

MPI_T_init_thread - Initializes the MPI Tool information interface

Syntax

C Syntax



C]#include <mpi.h>int MPI_T_init_thread(int required, int *provided)R]Input Parameters

[bu]
required: Desired level of thread support (integer).

Output Parameters

[bu]
provided: Available level of thread support (integer).

Description

C]MPI_T_init_thread()R] initializes the MPI tool information interface. Calls to MPI tool functions are allowed at any point in execution (including before C]MPI_Init()R] and after C]MPI_Finalize()R]) as long as C]MPI_T_init_thread()R] has been called at least once and the number of calls to C]MPI_T_init_thread()R] is greater than the number of calls to C]MPI_T_finalize()R]. If at any point in execution the number of calls to C]MPI_T_finalize()R] equals the number of calls to C]MPI_T_init_thread()R] the MPI tool interface will no longer be available until another call to C]MPI_T_init_thread()R].

C]MPI_T_init_thread()R], like C]MPI_Init_thread()R], has a provision to request a certain level of thread support in C]requiredR]:

[bu]
C]MPI_THREAD_SINGLER]: Only one thread will execute.
[bu]
C]MPI_THREAD_FUNNELEDR]: If the process is multithreaded, only the thread that called C]MPI_Init_thread()R] will make MPI calls.
[bu]
C]MPI_THREAD_SERIALIZEDR]: If the process is multithreaded, only one thread will make MPI library calls at one time.
[bu]
C]MPI_THREAD_MULTIPLER]: If the process is multithreaded, multiple threads may call MPI at once with no restrictions.

The level of thread support available to the program is set in C]providedR]. In Open MPI, the value is dependent on how the library was configured and built. Note that there is no guarantee that C]providedR] will be greater than or equal to C]requiredR].

Notes

It is the caller[cq]s responsibility to check the value of C]providedR], as it may be less than what was requested in C]requiredR].

Errors

C]MPI_T_init_thread()R] will fail if:

[bu]
C]MPI_T_ERR_MEMORYR]: Out of memory
[bu]
C]MPI_T_ERR_CANNOT_INITR]: Interface not in the state to be initialized

See Also

C]MPI_TR](5), C]MPI_Init_threadR](3), C]MPI_T_finalizeR](3)


Table of Contents

« Return to documentation listing