From 555c170ca4d9f844040ce6e9ae9b7b328f7da63d Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 18 Nov 2024 11:02:13 -0700 Subject: [PATCH] Minor fixes to support simple group construct Support the operation when all group members call group construct, where members are either all from the same namespace or from different namespaces. Signed-off-by: Ralph Castain --- src/mca/grpcomm/direct/grpcomm_direct_group.c | 6 ++-- src/prted/pmix/pmix_server_group.c | 35 +++++-------------- 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/src/mca/grpcomm/direct/grpcomm_direct_group.c b/src/mca/grpcomm/direct/grpcomm_direct_group.c index d1ffebfe8b..4f3a0cc760 100644 --- a/src/mca/grpcomm/direct/grpcomm_direct_group.c +++ b/src/mca/grpcomm/direct/grpcomm_direct_group.c @@ -1151,7 +1151,7 @@ static int create_dmns(prte_grpcomm_direct_group_signature_t *sig, } if (PMIX_RANK_WILDCARD == sig->members[n].rank) { PMIX_OUTPUT_VERBOSE((1, prte_grpcomm_base_framework.framework_output, - "%s grpcomm:direct:fence::create_dmns called for all procs in job %s", + "%s grpcomm:direct:group::create_dmns called for all procs in job %s", PRTE_NAME_PRINT(PRTE_PROC_MY_NAME), PRTE_JOBID_PRINT(sig->members[0].nspace))); /* all daemons hosting this jobid are participating */ @@ -1174,7 +1174,7 @@ static int create_dmns(prte_grpcomm_direct_group_signature_t *sig, } if (!found) { PMIX_OUTPUT_VERBOSE((5, prte_grpcomm_base_framework.framework_output, - "%s grpcomm:direct:fence::create_dmns adding daemon %s to list", + "%s grpcomm:direct:group::create_dmns adding daemon %s to list", PRTE_NAME_PRINT(PRTE_PROC_MY_NAME), PRTE_NAME_PRINT(&node->daemon->name))); nm = PMIX_NEW(prte_namelist_t); @@ -1223,7 +1223,7 @@ static int create_dmns(prte_grpcomm_direct_group_signature_t *sig, nds = 0; while (NULL != (nm = (prte_namelist_t *) pmix_list_remove_first(&ds))) { PMIX_OUTPUT_VERBOSE((5, prte_grpcomm_base_framework.framework_output, - "%s grpcomm:direct:fence::create_dmns adding daemon %s to array", + "%s grpcomm:direct:group::create_dmns adding daemon %s to array", PRTE_NAME_PRINT(PRTE_PROC_MY_NAME), PRTE_NAME_PRINT(&nm->name))); dns[nds++] = nm->name.rank; PMIX_RELEASE(nm); diff --git a/src/prted/pmix/pmix_server_group.c b/src/prted/pmix/pmix_server_group.c index ff659cf461..b833e9f92b 100644 --- a/src/prted/pmix/pmix_server_group.c +++ b/src/prted/pmix/pmix_server_group.c @@ -223,14 +223,12 @@ pmix_status_t pmix_server_group_fn(pmix_group_operation_t op, char *grpid, prte_pmix_grp_caddy_t *cd; int rc; size_t i; - bool assignID = false; - bool fence = false; bool force_local = false; - struct timeval tv = {0, 0}; pmix_output_verbose(2, prte_pmix_server_globals.output, - "%s Group request recvd with %lu directives", - PRTE_NAME_PRINT(PRTE_PROC_MY_NAME), (unsigned long)ndirs); + "%s Group request %s recvd with %lu directives", + PRTE_NAME_PRINT(PRTE_PROC_MY_NAME), + (NULL == grpid) ? "NULL" : grpid, (unsigned long)ndirs); /* they are required to pass us an id */ if (NULL == grpid) { @@ -239,36 +237,19 @@ pmix_status_t pmix_server_group_fn(pmix_group_operation_t op, char *grpid, /* check the directives */ for (i = 0; i < ndirs; i++) { - /* see if they want a context id assigned */ - if (PMIX_CHECK_KEY(&directives[i], PMIX_GROUP_ASSIGN_CONTEXT_ID)) { - assignID = PMIX_INFO_TRUE(&directives[i]); - - } else if (PMIX_CHECK_KEY(&directives[i], PMIX_EMBED_BARRIER)) { - fence = PMIX_INFO_TRUE(&directives[i]); - - } else if (PMIX_CHECK_KEY(&directives[i], PMIX_TIMEOUT)) { - tv.tv_sec = directives[i].value.data.uint32; - - } else if (PMIX_CHECK_KEY(&directives[i], PMIX_GROUP_LOCAL_ONLY)) { + /* see if this is local only */ + if (PMIX_CHECK_KEY(&directives[i], PMIX_GROUP_LOCAL_ONLY)) { force_local = PMIX_INFO_TRUE(&directives[i]); + break; } } - if (0 < tv.tv_sec) { - return PMIX_ERR_NOT_SUPPORTED; - } - /* if they don't want us to do a fence and they don't want a - * context id assigned and they aren't adding members, or they - * insist on forcing local completion of the operation, then + /* if they insist on forcing local completion of the operation, then * we are done */ - if ((!fence && !assignID) || force_local) { + if (force_local) { pmix_output_verbose(2, prte_pmix_server_globals.output, "%s group request - purely local", PRTE_NAME_PRINT(PRTE_PROC_MY_NAME)); - if (force_local && assignID) { - // we cannot do that - return PMIX_ERR_BAD_PARAM; - } cd = PMIX_NEW(prte_pmix_grp_caddy_t); cd->op = op; cd->grpid = strdup(grpid);