Skip to content

Commit

Permalink
Minor fixes to support simple group construct
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rhc54 committed Nov 18, 2024
1 parent 41d7bf7 commit 555c170
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
6 changes: 3 additions & 3 deletions src/mca/grpcomm/direct/grpcomm_direct_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
35 changes: 8 additions & 27 deletions src/prted/pmix/pmix_server_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 555c170

Please sign in to comment.