---
name: "MPI_T_init_thread"
section: "3"
platform: "linux"
package: "openmpi"
version: "5.0.11-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/MPI_T_init_thread"
---

# MPI\_T\_init\_thread(3)

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

## SYNTAX

### C Syntax

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

## INPUT PARAMETERS

- •

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

## OUTPUT PARAMETERS

- •

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

## 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* 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

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

## 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*

- •

  *MPI\_Init*

- •

  *MPI\_Init\_thread*

## COPYRIGHT

2003-2026, The Open MPI Community
