MPI_T_CVAR_GET_INFO(3)

πŸ’… MPI_T_CVAR_GET_INFO(3) πŸ’…

okay bestie so this is a page from the Open MPI manual, and it's literally all about one lil function that lets you snoop on a control variable. no cap. also real quick, the MPI_T stuff has a whole other home: MPI_T see MPI-3 section 14.3.5.

✨ NAME ✨

MPI_T_cvar_get_info β€” Query information from a control variable πŸ•΅οΈβ™€οΈ


🌸 SYNTAX 🌸

C Syntax πŸŽ€

#include <mpi.h>

int MPI_T_cvar_get_info(int cvar_index, char *name, int *name_len,
                        int *verbosity, MPI_Datatype *datatype, MPI_T_enum *enumtype,
                        const *desc, int *desc_len, int *bind, int *scope)
bestie copy that exactly, i am not even playing. const *desc is in there like that, periodt.

πŸ“ INPUT PARAMETERS πŸ“

  • cvar_index β€” the index of the control variable we're gonna interrogate, iykyk.

πŸ¦‹ INPUT/OUTPUT PARAMETERS πŸ¦‹

  • name_len β€” the length of the string and/or the buffer for name, okay?
  • desc_len β€” the length of the string and/or the buffer for desc, same energy.

πŸ‘‘ OUTPUT PARAMETERS πŸ‘‘

  • name β€” the buffer where we return the string that holds the name of the control variable. iconic.
  • verbosity β€” the verbosity level of this variable, lowkey important.
  • datatype β€” the MPI datatype of the info stored in the control variable.
  • enumtype β€” optional descriptor for enumeration info. optional!! πŸ™ˆ
  • desc β€” the buffer where we return the string that holds the description of the control variable.
  • bind β€” the type of MPI object this variable must be bound to.
  • scope β€” the scope of when changes to this variable are even possible.

πŸ’– DESCRIPTION πŸ’–

So MPI_T_cvar_get_info lets you query info about a control variable. the way it works is: it hands you back the verbosity, datatype, enumeration type, binding, and scope of the variable you asked about, dropping them into the arguments verbosity, datatype, enumtype, bind, and scope, respectively. and ngl the glow-up here is that control variables in Open MPI are literally the same thing as MCA parameters. same variable, different name. πŸ’…


🌈 VERBOSITY 🌈

okay so Open MPI exposes a very large number of MCA parameters (a.k.a. control variables), and to keep that from being a whole chaotic mess, control variables get sorted into nine verbosity levels, matching up with the equivalent ompi_info level. the nine levels, in increasing order, bestie:

  1. MPI_T_VERBOSITY_USER_BASIC: basic info that users actually care about ✨
  2. MPI_T_VERBOSITY_USER_DETAIL: detailed info that users care about
  3. MPI_T_VERBOSITY_USER_ALL: all the rest of the info that users care about
  4. MPI_T_VERBOSITY_TUNER_BASIC: basic info you need for tuning
  5. MPI_T_VERBOSITY_TUNER_DETAIL: detailed info you need for tuning
  6. MPI_T_VERBOSITY_TUNER_ALL: all the rest of the info you need for tuning
  7. MPI_T_VERBOSITY_MPIDEV_BASIC: basic info for MPI implementors
  8. MPI_T_VERBOSITY_MPIDEV_DETAIL: detailed info for MPI implementors
  9. MPI_T_VERBOSITY_MPIDEV_ALL: all the rest of the info for MPI implementors

for more deets, see MPI-3 section 14.3.1.


🧚 DATATYPE 🧚

the datatype that comes back from MPI_T_cvar_get_info is restricted to just one of these, no other options, that's the whole menu:

  • MPI_INT
  • MPI_UNSIGNED
  • MPI_UNSIGNED_LONG
  • MPI_UNSIGNED_LONG_LONG
  • MPI_COUNT
  • MPI_CHAR
  • MPI_DOUBLE

for more info on datatypes in MPI_T, hit up MPI-3 section 14.3.5. 🫢


πŸ”₯ SCOPE πŸ”₯

scope is the vibe check on when and how you're allowed to change a control variable. straight from MPI-3 section 14.3.6, scope can be any of these:

  • MPI_T_SCOPE_CONSTANT: read-only, the value is constant 🧊
  • MPI_T_SCOPE_READONLY: read-only, cannot be written, but it can still change πŸ‘€
  • MPI_T_SCOPE_LOCAL: may be writeable, and writing is a local operation
  • MPI_T_SCOPE_GROUP: may be writeable, but it has to be done to a group of processes β€” every process in a group must be set to consistent values
  • MPI_T_SCOPE_GROUP_EQ: may be writeable, must be done to a group of processes β€” every process in a group must be set to the same value
  • MPI_T_SCOPE_ALL: may be writeable, must be done to all processes β€” all connected processes must be set to consistent values
  • MPI_T_SCOPE_ALL_EQ: may be writeable, must be done to all processes β€” all connected processes must be set to the same value

for more info see MPI-3 section 14.3.6 Table 14.4.


😭 NOTES 😭

bestie pay attention, this part is a lil tricky. this MPI tool interface function returns two strings. and for each string it takes two arguments: a buffer to store the string, and a length that has to initially specify the size of that buffer.

so if the length you pass in is n, then this function will copy at most n - 1 characters of the string into the corresponding buffer, and it sets the length to the number of characters copied minus 1. math, but make it cozy. πŸŽ€

and if the length argument is NULL, or the value specified in the length is 0, then the corresponding string buffer gets straight up ignored and the string is not returned at all. so don't be surprised when nothing shows up. πŸ™ˆ

also, Open MPI does not currently support binding control variables to MPI objects. so like, that's a thing that just isn't a thing yet.

πŸ’€ ERRORS πŸ’€

MPI_T_cvar_get_info will fail if:

  • MPI_T_ERR_NOT_INITIALIZED: the MPI Tools interface was not initialized 😡
  • MPI_T_ERR_INVALID_INDEX: the control variable index is invalid 🚫

⭐ SEE ALSO ⭐

  • ompi_info

2003-2026, The Open MPI Community


and that's the whole page bestie, slay πŸ’…βœ¨ this was the Open MPI manual, MPI_T_CVAR_GET_INFO(3), dated Sep 10, 2026. go query some control variables, you've got this 🫢🌈

πŸ“¦ where this page comes from