Skip to content

Commit 4782e9a

Browse files
committed
Complete support for group-level info
Allow processes to contribute information during calls to PMIx_Group_construct that are shared with all construct participants. The values are returned to the participants as "qualified" values, each value qualified by the assigned group context ID. Signed-off-by: Ralph Castain <[email protected]>
1 parent b54565f commit 4782e9a

File tree

7 files changed

+343
-136
lines changed

7 files changed

+343
-136
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ src/include/pmix_config.h
103103
src/include/pmix_config.h.in
104104
src/include/pmix_config.h.in~
105105
src/include/pmix_frameworks.h
106-
src/include/dictionary.h
106+
src/include/pmix_dictionary.c
107+
src/include/pmix_dictionary.h
107108

108109
src/mca/pinstalldirs/config/pinstall_dirs.h
109110
src/mca/pdl/base/static-components.h

examples/group.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ int main(int argc, char **argv)
148148
if (NULL != results) {
149149
cid = 0;
150150
PMIX_VALUE_GET_NUMBER(rc, &results[0].value, cid, size_t);
151-
fprintf(stderr, "%d Group construct complete with status %s KEY %s CID %d\n",
152-
myproc.rank, PMIx_Error_string(rc), results[0].key, (int) cid);
151+
fprintf(stderr, "%d Group construct complete with status %s KEY %s CID %lu\n",
152+
myproc.rank, PMIx_Error_string(rc), results[0].key, (unsigned long) cid);
153153
} else {
154154
fprintf(stderr, "%d Group construct complete, but no CID returned\n", myproc.rank);
155155
}

examples/group_lcl_cid.c

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,15 @@ static void op_callbk(pmix_status_t status, void *cbdata)
6464
{
6565
mylock_t *lock = (mylock_t *) cbdata;
6666

67-
fprintf(stderr, "Client %s:%d OP CALLBACK CALLED WITH STATUS %d\n", myproc.nspace, myproc.rank,
68-
status);
6967
lock->status = status;
7068
DEBUG_WAKEUP_THREAD(lock);
7169
}
7270

7371
static void errhandler_reg_callbk(pmix_status_t status, size_t errhandler_ref, void *cbdata)
7472
{
7573
mylock_t *lock = (mylock_t *) cbdata;
76-
77-
fprintf(stderr,
78-
"Client %s:%d ERRHANDLER REGISTRATION CALLBACK CALLED WITH STATUS %d, ref=%lu\n",
79-
myproc.nspace, myproc.rank, status, (unsigned long) errhandler_ref);
74+
EXAMPLES_HIDE_UNUSED_PARAMS(errhandler_ref);
75+
8076
lock->status = status;
8177
DEBUG_WAKEUP_THREAD(lock);
8278
}
@@ -114,15 +110,6 @@ int main(int argc, char **argv)
114110
}
115111
nprocs = val->data.uint32;
116112
PMIX_VALUE_RELEASE(val);
117-
/* and our context ID */
118-
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_GROUP_CONTEXT_ID, NULL, 0, &val))) {
119-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get job context ID failed: %s\n", myproc.nspace,
120-
myproc.rank, PMIx_Error_string(rc));
121-
goto done;
122-
}
123-
cid = 0;
124-
PMIX_VALUE_GET_NUMBER(rc, val, cid, size_t);
125-
fprintf(stderr, "Client %s:%d job size %d CID %u\n", myproc.nspace, myproc.rank, nprocs, (unsigned)cid);
126113

127114
/* register our default errhandler */
128115
DEBUG_CONSTRUCT_LOCK(&lock);
@@ -201,11 +188,10 @@ int main(int argc, char **argv)
201188
if (NULL != results) {
202189
cid = 0;
203190
PMIX_VALUE_GET_NUMBER(rc, &results[0].value, cid, size_t);
204-
fprintf(stderr, "%d Group construct complete with status %s KEY %s CID %ld\n",
205-
myproc.rank, PMIx_Error_string(rc), results[0].key, cid);
191+
fprintf(stderr, "%d Group construct complete with status %s KEY %s CID %lu\n",
192+
myproc.rank, PMIx_Error_string(rc), results[0].key, (unsigned long) cid);
206193
} else {
207194
fprintf(stderr, "%d Group construct complete, but no CID returned\n", myproc.rank);
208-
goto done;
209195
}
210196
PMIX_PROC_FREE(procs, nprocs);
211197

@@ -221,6 +207,7 @@ int main(int argc, char **argv)
221207

222208
PMIX_INFO_CONSTRUCT(&tinfo[0]);
223209
PMIX_INFO_LOAD(&tinfo[0], PMIX_GROUP_CONTEXT_ID, &cid, PMIX_SIZE);
210+
PMIX_INFO_SET_QUALIFIER(&tinfo[0]);
224211
PMIX_INFO_CONSTRUCT(&tinfo[1]);
225212
PMIX_INFO_LOAD(&tinfo[1], PMIX_TIMEOUT, &get_timeout, PMIX_UINT32);
226213

@@ -231,18 +218,20 @@ int main(int argc, char **argv)
231218
myproc.nspace, myproc.rank, n, PMIx_Error_string(rc));
232219
continue;
233220
}
234-
if (PMIX_UINT64 != val->type) {
221+
if (PMIX_SIZE != val->type) {
235222
fprintf(stderr, "%s:%d: PMIx_Get LOCAL CID for rank %d returned wrong type: %s\n", myproc.nspace,
236223
myproc.rank, n, PMIx_Data_type_string(val->type));
237224
PMIX_VALUE_RELEASE(val);
238225
continue;
239226
}
240-
if ((1234UL + (unsigned long)n) != val->data.uint64) {
241-
fprintf(stderr, "%s:%d: PMIx_Get LOCAL CID for rank %d returned wrong value: %lu\n",
242-
myproc.nspace, myproc.rank, n, (unsigned long)val->data.uint64);
227+
if ((1234UL + (unsigned long)n) != val->data.size) {
228+
fprintf(stderr, "%s:%d: PMIx_Get LOCAL CID for rank %d returned wrong value: %s\n",
229+
myproc.nspace, myproc.rank, n, PMIx_Value_string(val));
243230
PMIX_VALUE_RELEASE(val);
244231
continue;
245232
}
233+
fprintf(stderr, "%s:%d: PMIx_Get LOCAL CID for rank %u SUCCESS value: %s\n",
234+
myproc.nspace, myproc.rank, n, PMIx_Value_string(val));
246235
PMIX_VALUE_RELEASE(val);
247236
}
248237

src/include/pmix_globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ PMIX_CLASS_DECLARATION(pmix_query_caddy_t);
434434
typedef struct {
435435
pmix_list_item_t super;
436436
pmix_proc_t proc;
437-
pmix_list_t ilist; // list of pmix_kval_t provided by this proc
437+
pmix_byte_object_t blob; // packed blob of info provided by this proc
438438
} pmix_grpinfo_t;
439439
PMIX_CLASS_DECLARATION(pmix_grpinfo_t);
440440

0 commit comments

Comments
 (0)