Skip to content

Commit

Permalink
pm/hydra: Fix appnum retrieval in pmi2 server
Browse files Browse the repository at this point in the history
appnum was always hardcoded to 0 in the PMI2_Init response. Get the
information out of the executable list and return it like in pmi1.
  • Loading branch information
raffenet committed Feb 15, 2022
1 parent 93de48a commit 3e08da7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,18 @@ static HYD_status fn_fullinit(int fd, char *args[])
break;
}
}
int idx = i;
HYDU_ASSERT(i < HYD_pmcd_pmip.local.proxy_process_count, status);

/* find executable information */
i = 0;
struct HYD_exec *exec;
for (exec = HYD_pmcd_pmip.exec_list; exec; exec = exec->next) {
i += exec->proc_count;
if (idx < i)
break;
}

HYD_STRING_STASH_INIT(stash);
HYD_STRING_STASH(stash,
MPL_strdup("cmd=fullinit-response;pmi-version=2;pmi-subversion=0;rank="),
Expand All @@ -183,7 +193,8 @@ static HYD_status fn_fullinit(int fd, char *args[])
HYD_STRING_STASH(stash, MPL_strdup(";size="), status);
HYD_STRING_STASH(stash, HYDU_int_to_str(HYD_pmcd_pmip.system_global.global_process_count),
status);
HYD_STRING_STASH(stash, MPL_strdup(";appnum=0"), status);
HYD_STRING_STASH(stash, MPL_strdup(";appnum="), status);
HYD_STRING_STASH(stash, HYDU_int_to_str(exec->appnum), status);
if (HYD_pmcd_pmip.local.spawner_kvsname) {
HYD_STRING_STASH(stash, MPL_strdup(";spawner-jobid="), status);
HYD_STRING_STASH(stash, MPL_strdup(HYD_pmcd_pmip.local.spawner_kvsname), status);
Expand Down

0 comments on commit 3e08da7

Please sign in to comment.