Repository navigation
mpi_t: register enum cvars with an MPI_T enum - #8040
Conversation
|
Performance impact. There's no overhead on any communication path. The cost is a one-time setup during initialization and a matching cleanup at finalize, and it's small.
To avoid the allocations, the enums and their item arrays could be generated as static constant tables instead of being built at init. That would need changes to the |
|
test:mpich/ch3/tcp ✔️ 1 TIMOUT |
|
Tested locally with a debug build ( A small MPI_T test program walks every CVAR with
valgrind reports 0 errors and no definite leaks through The |
extractcvars now creates an MPI_T enum for each enum cvar, with one item per value, and registers the cvar with it, so MPI_T_cvar_get_info returns an enum handle that a tool can use to map value names to numbers. MPIR_T_CVAR_REGISTER_impl stores the enum in the cvar, and enum_table holds pointers to the enums so that handles stay valid as it grows. Previously every cvar was registered with MPI_T_ENUM_NULL, and a tool could set an enum cvar only by its raw number. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pull Request Description
Every CVAR was registered with
MPI_T_ENUM_NULL, soMPI_T_cvar_get_inforeturned no enum for enum CVARs such asMPIR_CVAR_BCAST_INTRA_ALGORITHM. A tool could set them only by raw number, which depends on the order of values in the generated header. This matters for runtime tuning through MPI_T (see #8039).extractcvarsnow creates an MPI_T enum for each enum CVAR, named after the CVAR, with one item per value, and registers the CVAR with it. A tool can then map value names to numbers withMPI_T_enum_get_item.MPIR_T_CVAR_REGISTER_implnow stores itsetypeargument in the CVAR; it was taking it but never storing it.enum_tableholds pointers to the enums. AnMPI_T_enumhandle is the enum's address, and with the table storing the enums themselves, a handle went stale whenever the table grew. Nothing created enums before, so this never showed up.MPIR_T_CVAR_REGISTER_STATICtakes anetypeargument.extractcvarsis its only user.Author Checklist
🤖 Generated with Claude Code