Hello,
I propose an alternative for Jeff's multi-device problem for you to think.
What we need is simply providing names for elements in an array-type var.
Jeff's workaround works but is not intuitive. Having a state pvar which simply gives 0. 1, 2, ... is an over-design. How about this one:
// Return true or false in has_subnames.
MPI_T_pvar_has_subnames(session, handle, int has_subnames);
// If has_subnames, use this function to get their names
MPI_T_pvar_get_subnames(session, handle, char * subnames[], int lens[]); // Very like the newly proposed MPI_T_PVAR_READ_STR(session, handle, char * const strs[], int lens[])
Do the same for cvars, MPI_T_cvar_has_subnames(); MPI_T_cvar_get_subnames();