MPI\_T\_INIT\_THREAD(3) Open MPI MPI\_T\_INIT\_THREAD(3)

MPI\_T\_init\_thread — Initializes the MPI Tool information interface

# [SYNTAX](#SYNTAX)

## [C Syntax](#C_Syntax)

```
#include <mpi.h>
int MPI_T_init_thread(int required, int *provided)
```

# [INPUT PARAMETERS](#INPUT_PARAMETERS)

•

**required**: Desired level of thread support (integer).

# [OUTPUT PARAMETERS](#OUTPUT_PARAMETERS)

•

**provided**: Available level of thread support (integer).

# [DESCRIPTION](#DESCRIPTION)

MPI\_T\_init\_thread() initializes the MPI tool information interface. Calls to MPI tool functions are allowed at any point in execution (including before MPI\_Init() and after MPI\_Finalize()) as long as MPI\_T\_init\_thread() has been called at least once and the number of calls to MPI\_T\_init\_thread() is greater than the number of calls to MPI\_T\_finalize(). If at any point in execution the number of calls to MPI\_T\_finalize() equals the number of calls to MPI\_T\_init\_thread() the MPI tool interface will no longer be available until another call to MPI\_T\_init\_thread().

MPI\_T\_init\_thread(), like MPI\_Init\_thread(), has a provision to request a certain level of thread support in **required**:

- **MPI\_THREAD\_SINGLE**: Only one thread will execute.
- **MPI\_THREAD\_FUNNELED**: If the process is multithreaded, only the thread that called MPI\_Init\_thread &lt;#mpi-init-thread&gt; will make MPI calls.
- **MPI\_THREAD\_SERIALIZED**: If the process is multithreaded, only one thread will make MPI library calls at one time.
- **MPI\_THREAD\_MULTIPLE**: 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 **provided**. 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**.

# [NOTES](#NOTES)

It is the caller’s responsibility to check the value of **provided**, as it may be less than what was requested in **required**.

# [ERRORS](#ERRORS)

MPI\_T\_init\_thread will fail if:

- **MPI\_T\_ERR\_MEMORY**: Out of memory
- **MPI\_T\_ERR\_CANNOT\_INIT**: Interface not in the state to be initialized

**See also:**

- MPI\_T &lt;#mpi-t&gt;
- MPI\_Init &lt;#mpi-init&gt;
- MPI\_Init\_thread &lt;#mpi-init-thread&gt;

# [Copyright](#Copyright)

2003-2026, The Open MPI Community

September 16, 2026

---

Document: MPI_T_init_thread(3) from openmpi-cuda-12.6 5.0.11-r1 (Chainguard OS)
Source: https://github.com/open-mpi/ompi
