diff --git a/NEWS b/NEWS index 5268a3926d6c15f95543f8d9e07927e72c617b92..ed20103ce04227291fbff8bd1fc6389d63dd2b72 100644 --- a/NEWS +++ b/NEWS @@ -400,6 +400,7 @@ documents those changes that are of interest to users and admins. -- Make sure that "scancel -s KILL" terminates the job just like "scancel" including deletion of all job steps (Chris Holmes, HP, slurm,patch). -- Recognize ISO-8859 input to srun as a script (for non-English scripts). + -- switch/elan: Fix bug in propagation of ELAN_STATKEY environment variable. * Changes in SLURM 1.0.15 ========================= diff --git a/src/plugins/switch/elan/qsw.c b/src/plugins/switch/elan/qsw.c index d4edc20429f7c4473d860c4865d42dcfb0ed88f0..5bab4065d35c1913fc08c49d1b401796a64104aa 100644 --- a/src/plugins/switch/elan/qsw.c +++ b/src/plugins/switch/elan/qsw.c @@ -959,11 +959,15 @@ static int elan_statkey (int prgid) } /* - * Return the statkey to caller if shared memory was created + * Return the statkey to caller in keyp if shared memory was created + * Return -1 if shared memory creation failed. */ -int qsw_statkey (qsw_jobinfo_t jobinfo) +int qsw_statkey (qsw_jobinfo_t jobinfo, int *keyp) { - return (shmid > 0 ? elan_statkey (jobinfo->j_prognum) : -1); + if (shmid < 0) + return (-1); + *keyp = elan_statkey (jobinfo->j_prognum); + return (0); } /* diff --git a/src/plugins/switch/elan/qsw.h b/src/plugins/switch/elan/qsw.h index ac87fa7b4e62960552e6e6d7af8caefba00d5fe2..39a9c0a2af46f8484c0c38147c2ceee9c192e09a 100644 --- a/src/plugins/switch/elan/qsw.h +++ b/src/plugins/switch/elan/qsw.h @@ -136,6 +136,6 @@ char * qsw_capability_string(qsw_jobinfo_t j, char *buf, size_t len); void qsw_print_jobinfo(FILE *fp, struct qsw_jobinfo *jobinfo); /* Return Elan shared memory state key */ -int qsw_statkey (qsw_jobinfo_t jobinfo); +int qsw_statkey (qsw_jobinfo_t jobinfo, int *keyp); #endif /* _QSW_INCLUDED */ diff --git a/src/plugins/switch/elan/switch_elan.c b/src/plugins/switch/elan/switch_elan.c index cb31c105505fca096bdf317d2cc2a501b201a233..f97f563aa5945ad7efca88317c1050e5231010ef 100644 --- a/src/plugins/switch/elan/switch_elan.c +++ b/src/plugins/switch/elan/switch_elan.c @@ -693,10 +693,8 @@ int switch_p_job_attach ( switch_jobinfo_t jobinfo, char ***env, /* * Tell libelan the key to use for Elan state shmem segment */ - if ((id = qsw_statkey ((qsw_jobinfo_t) jobinfo)) > 0) + if (qsw_statkey ((qsw_jobinfo_t) jobinfo, &id) >= 0) slurm_setenvpf (env, "ELAN_STATKEY", "0x%x", id); - - return SLURM_SUCCESS; }