From edb3d99687ddc2d3f81cd5c6ef1586f5703dfc9c Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Fri, 26 Sep 2008 02:38:37 +0000 Subject: [PATCH] Update SLURM environmental variables used to describe allocation. Retain backwards compatibility to SLURM 1.1 and earlier versions. This commit was SVN r19647. --- orte/mca/ras/slurm/ras_slurm_module.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/orte/mca/ras/slurm/ras_slurm_module.c b/orte/mca/ras/slurm/ras_slurm_module.c index 09f95daca1..3710d8b749 100644 --- a/orte/mca/ras/slurm/ras_slurm_module.c +++ b/orte/mca/ras/slurm/ras_slurm_module.c @@ -75,11 +75,18 @@ static int orte_ras_slurm_allocate(opal_list_t *nodes) } regexp = strdup(slurm_node_str); - tasks_per_node = getenv("SLURM_TASKS_PER_NODE"); + tasks_per_node = getenv("SLURM_JOB_CPUS_PER_NODE"); if (NULL == tasks_per_node) { - orte_show_help("help-ras-slurm.txt", "slurm-env-var-not-found", 1, - "SLURM_TASKS_PER_NODE"); - return ORTE_ERR_NOT_FOUND; + /* didn't find SLURM 1.2 or above envar - look for prior + * version + */ + tasks_per_node = getenv("SLURM_TASKS_PER_NODE"); + if (NULL == tasks_per_node) { + /* couldn't find any version - abort */ + orte_show_help("help-ras-slurm.txt", "slurm-env-var-not-found", 1, + "SLURM_JOB_CPUS_PER NODE or SLURM_TASKS_PER_NODE"); + return ORTE_ERR_NOT_FOUND; + } } node_tasks = strdup(tasks_per_node);