MPI_T_PVAR_READRESET(3)

✨ NAME ✨

MPI_T_pvar_readreset β€” atomically read and reset the value of a performance variable πŸ’…

okay so real quick before anything else: this whole page is from Open MPI, and the manpage header is MPI_T_PVAR_READRESET(3) β€” section 3, the library-calls section, bestie. that's where we live now 🫢


πŸ’– SYNOPSIS πŸ’–

C Syntax

#include <mpi.h>

int MPI_T_pvar_readreset(MPI_T_pvar_session session, MPI_T_pvar_handle handle, const void *buf)

yeah that's it, that's the whole flex. three arguments, one int coming back at you πŸ”₯


🌸 INPUT PARAMETERS 🌸

  • session β€” performance experiment session. the whole vibe container for your perf stuff, iykyk.
  • handle β€” performance variable handle. this is your lil pointer-passport to one specific variable.
  • buf β€” initial address of storage location for variable value. like, where the answer goes. you bring the space, it brings the number πŸ“¦

πŸ¦‹ DESCRIPTION πŸ¦‹

MPI_T_pvar_readreset is, no joke, doing TWO things in ONE breath: it atomically queries and resets the value of a performance variable bound to the handle you gave it as handle, inside the session you gave it as session. the result lands in the buffer that buf points to. iconic. main character energy. one syscall-shaped moment, two whole outcomes ✨

BUT. and this is the part where you need to lock in πŸ“’ this function can only be used with performance variables that are atomic and not readonly. not "usually". not "if you're lucky". those are the rules, periodt.

and the other thing: the caller must ensure that the buffer pointed to by buf is large enough to hold the entire value of the performance variable. that's on you, not on MPI. MPI will not check. MPI will not warn you. you're the one holding the bag πŸ’€ so make that buffer big enough, please, for me.


😭 ERRORS 😭

MPI_T_pvar_readreset will fail if:

  • MPI_T_ERR_NOT_INITIALIZED β€” the MPI Tools interface not initialized 🚫 like, you gotta boot the thing up first, bestie.
  • MPI_T_ERR_INVALID_HANDLE β€” the handle is invalid or not associated with the session πŸ™ˆ that handle doesn't belong here.
  • MPI_T_ERR_INVALID_SESSION β€” session argument is not a valid session πŸ’” the session said "who are you".
  • MPI_T_ERR_PVAR_NO_ATOMIC β€” variable cannot be read and written atomically ⚑ nope, not that kind of variable, sorry.
  • MPI_T_ERR_PVAR_NO_WRITE β€” variable cannot be reset πŸ”’ read-only-ish energy, we can't touch it.

πŸŽ€ SEE ALSO πŸŽ€

go read these next, they're all part of the same friend group:

  • MPI_T_pvar_handle_alloc
  • MPI_T_pvar_get_info
  • MPI_T_pvar_session_create
  • MPI_T_pvar_read
  • MPI_T_pvar_reset

2003-2026, The Open MPI Community


okay that's the whole page, mwah πŸ’‹ this was Open MPI, page MPI_T_PVAR_READRESET(3), dated Sep 10, 2026 β€” and the original footer says exactly that too. so go definitely-not-forget-to-size-your-buf, and I'll see you in the next man page. byeee πŸ§šπŸ’œ

πŸ“¦ where this page comes from