MPI\_T\_CVAR\_HANDLE\_ALLOC(3) Open MPI MPI\_T\_CVAR\_HANDLE\_ALLOC(3)

MPI\_T\_cvar\_handle\_alloc, MPI\_T\_cvar\_handle\_free &lt;#mpi-t-cvar-handle-free&gt; - Allocate/free control variable handles

# [SYNTAX](#SYNTAX)

## [C Syntax](#C_Syntax)

```
#include <mpi.h>
int MPI_T_cvar_handle_alloc(int cvar_index, void *obj_handle,


                            MPI_T_cvar_handle *handle, int *count)
int MPI_T_cvar_handle_free(MPI_T_cvar_handle *handle)
```

# [DESCRIPTION](#DESCRIPTION)

MPI\_T\_cvar\_handle\_alloc binds the control variable specified in *cvar\_index* to the MPI object specified in *obj\_handle*. If MPI\_T\_cvar\_get\_info &lt;#mpi-t-cvar-get-info&gt; returns MPI\_T\_BIND\_NO\_OBJECT as the binding of the variable the *obj\_handle* argument is ignored. The number of values represented by this control variable is returned in the *count* parameter. If the control variable represents a string then *count* will be the maximum length of the string.

MPI\_T\_cvar\_handle\_free &lt;#mpi-t-cvar-handle-free&gt; frees a handle allocated by MPI\_T\_cvar\_handle\_alloc and sets the *handle* argument to MPI\_T\_CVAR\_HANDLE\_NULL.

# [NOTES](#NOTES)

Open MPI does not currently support binding MPI objects to control variables so the *obj\_handle* argument is always ignored.

# [ERRORS](#ERRORS)

MPI\_T\_cvar\_handle\_alloc will fail if:

- **MPI\_T\_ERR\_NOT\_INITIALIZED**: The MPI Tools interface not initialized
- **MPI\_T\_ERR\_INVALID\_INDEX**: The control variable index is invalid
- **MPI\_T\_ERR\_OUT\_OF\_HANDLES**: No more handles available

MPI\_T\_cvar\_handle\_free &lt;#mpi-t-cvar-handle-free&gt; will fail if:

- **MPI\_T\_ERR\_NOT\_INITIALIZED**: The MPI Tools interface not initialized
- **MPI\_T\_ERR\_INVALID\_HANDLE**: The handle is invalid

**See also:**

•

MPI\_T\_cvar\_get\_info &lt;#mpi-t-cvar-get-info&gt;

# [Copyright](#Copyright)

2003-2026, The Open MPI Community

July 6, 2026

---

Document: MPI_T_cvar_handle_alloc(3) from openmpi-cuda-12.4 5.0.10-r2 (Chainguard OS)
Source: https://github.com/open-mpi/ompi
