MPI\_SESSION\_F2C(3) Open MPI MPI\_SESSION\_F2C(3)

MPI\_Session\_c2f, MPI\_Session\_f2c - Translates a C session handle into a Fortran INTEGER-style session handle, or vice versa.

# [SYNTAX](#SYNTAX)

## [C Syntax](#C_Syntax)

```
#include <mpi.h>
int MPI_Session_f2c(const MPI_Fint *f_session, MPI_Session *c_session)
int MPI_Session_c2f(const MPI_Session *c_session, MPI_Fint *f_session)
```

# [PARAMETERS](#PARAMETERS)

- **f\_session**: **mpi**-style **INTEGER** MPI session object
- **c\_session**: C-style MPI session object

# [DESCRIPTION](#DESCRIPTION)

These two procedures are provided in C to convert from a Fortran session (which is an array of integers) to a C session (which is a structure), and vice versa. The conversion occurs on all the information in **session**, including that which is hidden. That is, no session information is lost in the conversion.

When using MPI\_Session\_f2c(), if **f\_session** is a valid Fortran session, then MPI\_Session\_f2c() returns in **c\_session** a valid C session with the same content. If **f\_session** is the Fortran value of MPI\_SESSION\_NULL, or if **f\_session** is not a valid Fortran session, then the call is erroneous.

When using MPI\_Session\_c2f(), the opposite conversion is applied. If **c\_session** is MPI\_SESSION\_NULL, or if **c\_session** is not a valid C session, then the call is erroneous.

# [NOTES](#NOTES)

These functions are only available in C; they are not available in any of the Fortran MPI interfaces.

# [Copyright](#Copyright)

2003-2026, The Open MPI Community

October 9, 2026

---

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