Skip to content

Commit 1f0f03b

Browse files
author
Ralph Castain
committed
Print a better error message when srun isn't found in the path. Ensure we don't segfault if -host specifies a node not included in the allocation
Signed-off-by: Ralph Castain <[email protected]>
1 parent 3d0fc29 commit 1f0f03b

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

orte/mca/plm/base/plm_base_launch_support.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,11 +2151,13 @@ int orte_plm_base_setup_virtual_machine(orte_job_t *jdata)
21512151
}
21522152

21532153
/* ensure we are not on the list */
2154-
item = opal_list_get_first(&nodes);
2155-
node = (orte_node_t*)item;
2156-
if (0 == node->index) {
2157-
opal_list_remove_item(&nodes, item);
2158-
OBJ_RELEASE(item);
2154+
if (0 < opal_list_get_size(&nodes)) {
2155+
item = opal_list_get_first(&nodes);
2156+
node = (orte_node_t*)item;
2157+
if (0 == node->index) {
2158+
opal_list_remove_item(&nodes, item);
2159+
OBJ_RELEASE(item);
2160+
}
21592161
}
21602162

21612163
/* if we didn't get anything, then we are the only node in the

orte/mca/plm/slurm/help-plm-slurm.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ are running.
4949

5050
Please consult with your system administrator about obtaining
5151
such support.
52+
[no-srun]
53+
The SLURM process starter for OpenMPI was unable to locate a
54+
usable "srun" command in its path. Please check your path
55+
and try again.

orte/mca/plm/slurm/plm_slurm_module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,8 @@ static int plm_slurm_start_proc(int argc, char **argv, char **env,
587587
orte_proc_t *dummy;
588588

589589
if (NULL == exec_argv) {
590-
return ORTE_ERR_NOT_FOUND;
590+
orte_show_help("help-plm-slurm.txt", "no-srun", true);
591+
return ORTE_ERR_SILENT;
591592
}
592593

593594
srun_pid = fork();

0 commit comments

Comments
 (0)