44 static constexpr const char* task_count_variables[] = {
45 "SLURM_STEP_NUM_TASKS",
47 "OMPI_COMM_WORLD_SIZE",
48 "MV2_COMM_WORLD_SIZE",
52 for (
const char* variable : task_count_variables) {
53 const char* value = lookup(variable);
54 if (value ==
nullptr || *value ==
'\0') {
59 reported = std::stoi(value);
60 }
catch (
const std::exception&) {
63 if (reported > tasks.
count) {
64 tasks.
count = reported;
std::function< const char *(const char *)> EnvironmentLookup
Environment reader, so the detection can be tested without setenv.
LauncherTasks detect_launcher_tasks()
The same, against the real environment.
What the launcher said, and which variable said it.
int count
Tasks in this job step; 1 when no launcher variable was found.
std::string variable
The variable the count came from, empty when the count is the default.