Skip to content

Commit 1e35d4d

Browse files
committed
scr_env: make work for PMIx
1 parent d2d9051 commit 1e35d4d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ OPTION(SCR_BGQ "Enable proper BGQ compilation" OFF)
178178
## PMIx
179179
IF(${SCR_RESOURCE_MANAGER} STREQUAL "PMIX")
180180
FIND_PACKAGE(PMIX REQUIRED)
181-
SET(HAVE_PMIX TRUE)
181+
SET(HAVE_LIBPMIX TRUE)
182182
INCLUDE_DIRECTORIES(${PMIX_INCLUDE_DIRS})
183183
LIST(APPEND SCR_EXTERNAL_LIBS ${PMIX_LIBRARIES})
184184
ENDIF(${SCR_RESOURCE_MANAGER} STREQUAL "PMIX")

src/scr_env.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
#include "cppr.h"
5454
#endif /* HAVE_CPPR */
5555

56-
#ifdef HAVE_PMIX
56+
#ifdef HAVE_LIBPMIX
5757
#include "pmix.h"
58-
#endif /* HAVE_PMIX */
58+
#endif /* HAVE_LIBPMIX */
5959

6060
#ifdef SCR_BGQ
6161
#include "firmware/include/personality.h" /* Personality_t */
@@ -126,8 +126,8 @@ char* scr_env_jobid()
126126
{
127127
char* jobid = NULL;
128128

129-
char* value;
130129
#ifdef SCR_RESOURCE_MANAGER_SLURM
130+
char* value;
131131
/* read $SLURM_JOBID environment variable for jobid string */
132132
if ((value = getenv("SLURM_JOBID")) != NULL) {
133133
jobid = strdup(value);
@@ -139,6 +139,7 @@ char* scr_env_jobid()
139139
}
140140
#endif
141141
#ifdef SCR_RESOURCE_MANAGER_APRUN
142+
char* value;
142143
/* read $PBS_JOBID environment variable for jobid string */
143144
if ((value = getenv("PBS_JOBID")) != NULL) {
144145
jobid = strdup(value);
@@ -178,6 +179,7 @@ char* scr_env_jobid()
178179
PMIX_PDATA_FREE(pmix_query_data, 1);
179180
#endif
180181
#ifdef SCR_RESOURCE_MANAGER_LSF
182+
char* value;
181183
/* read $PBS_JOBID environment variable for jobid string */
182184
if ((value = getenv("LSB_JOBID")) != NULL) {
183185
jobid = strdup(value);
@@ -263,12 +265,12 @@ int scr_env_init(void)
263265

264266
#ifdef SCR_RESOURCE_MANAGER_PMIX
265267
/* init pmix */
268+
pmix_proc_t scr_pmix_proc;
266269
int retval = PMIx_Init(&scr_pmix_proc, NULL, 0);
267270
if (retval != PMIX_SUCCESS) {
268-
scr_err("PMIx_Init failed: rc=%d @ %s:%d",
271+
scr_abort(-1, "PMIx_Init failed: rc=%d @ %s:%d",
269272
retval, __FILE__, __LINE__
270273
);
271-
return SCR_FAILURE;
272274
}
273275
scr_dbg(1, "PMIx_Init succeeded @ %s:%d", __FILE__, __LINE__);
274276
#endif /* SCR_MACHINE_TYPE == SCR_PMIX */

0 commit comments

Comments
 (0)