Skip to content

Commit 8aa3ef7

Browse files
committed
pmix/s2: fix s2 component data placement
Use wildcard for the information related to the job-level data. Fixes s2 component with regard to PR #1897.
1 parent 81063f1 commit 8aa3ef7

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

opal/mca/pmix/s2/pmix_s2.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ static int s2_init(void)
173173
char **localranks;
174174
char *str;
175175
char nmtmp[64];
176+
opal_process_name_t wildcard_rank;
176177

177178
/* if we can't startup PMI, we can't be used */
178179
if ( PMI2_Initialized () ) {
@@ -232,6 +233,10 @@ static int s2_init(void)
232233
"%s pmix:s2: assigned tmp name",
233234
OPAL_NAME_PRINT(s2_pname));
234235

236+
/* setup wildcard rank*/
237+
wildcard_rank = OPAL_PROC_MY_NAME;
238+
wildcard_rank.vpid = OPAL_VPID_WILDCARD;
239+
235240
/* Slurm PMI provides the job id as an integer followed
236241
* by a '.', followed by essentially a stepid. The first integer
237242
* defines an overall job number. The second integer is the number of
@@ -241,7 +246,7 @@ static int s2_init(void)
241246
kv.key = strdup(OPAL_PMIX_JOBID);
242247
kv.type = OPAL_UINT32;
243248
kv.data.uint32 = s2_pname.jobid;
244-
if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) {
249+
if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&wildcard_rank, &kv))) {
245250
OPAL_ERROR_LOG(ret);
246251
OBJ_DESTRUCT(&kv);
247252
goto err_exit;
@@ -253,7 +258,7 @@ static int s2_init(void)
253258
kv.key = strdup(OPAL_PMIX_JOB_SIZE);
254259
kv.type = OPAL_UINT32;
255260
kv.data.uint32 = size;
256-
if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) {
261+
if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&wildcard_rank, &kv))) {
257262
OPAL_ERROR_LOG(rc);
258263
OBJ_DESTRUCT(&kv);
259264
goto err_exit;
@@ -282,7 +287,7 @@ static int s2_init(void)
282287
kv.key = strdup(OPAL_PMIX_UNIV_SIZE);
283288
kv.type = OPAL_UINT32;
284289
kv.data.uint32 = atoi(buf);
285-
if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) {
290+
if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&wildcard_rank, &kv))) {
286291
OPAL_ERROR_LOG(rc);
287292
OBJ_DESTRUCT(&kv);
288293
goto err_exit;
@@ -293,7 +298,7 @@ static int s2_init(void)
293298
kv.key = strdup(OPAL_PMIX_MAX_PROCS);
294299
kv.type = OPAL_UINT32;
295300
kv.data.uint32 = atoi(buf);
296-
if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) {
301+
if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&wildcard_rank, &kv))) {
297302
OPAL_ERROR_LOG(ret);
298303
OBJ_DESTRUCT(&kv);
299304
goto err_exit;
@@ -327,7 +332,7 @@ static int s2_init(void)
327332
kv.key = strdup(OPAL_PMIX_LOCAL_SIZE);
328333
kv.type = OPAL_UINT32;
329334
kv.data.uint32 = s2_nlranks;
330-
if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) {
335+
if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&wildcard_rank, &kv))) {
331336
OPAL_ERROR_LOG(rc);
332337
OBJ_DESTRUCT(&kv);
333338
goto err_exit;
@@ -359,7 +364,7 @@ static int s2_init(void)
359364
kv.key = strdup(OPAL_PMIX_LOCAL_PEERS);
360365
kv.type = OPAL_STRING;
361366
kv.data.string = str;
362-
if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) {
367+
if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&wildcard_rank, &kv))) {
363368
OPAL_ERROR_LOG(ret);
364369
OBJ_DESTRUCT(&kv);
365370
goto err_exit;

0 commit comments

Comments
 (0)