Skip to content

Commit 290c4b6

Browse files
committed
Fix MPI environment variable list size
1 parent f6a8c83 commit 290c4b6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

modules/core/util/src/util.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ int ppc::util::GetNumThreads() {
2828
return 1;
2929
}
3030

31-
constexpr std::array<std::string_view, 13> kMpiEnvVars = {
31+
// List of environment variables that signal the application is running under
32+
// an MPI launcher. The array size must match the number of entries to avoid
33+
// looking up empty environment variable names.
34+
constexpr std::array<std::string_view, 10> kMpiEnvVars = {
3235
"OMPI_COMM_WORLD_SIZE", "OMPI_UNIVERSE_SIZE", "PMI_SIZE", "PMI_RANK", "PMI_FD",
3336
"HYDRA_CONTROL_FD", "PMIX_RANK", "SLURM_PROCID", "MSMPI_RANK", "MSMPI_LOCALRANK"};
3437

0 commit comments

Comments
 (0)