@@ -301,14 +301,14 @@ typedef struct {
301
301
* is to be returned
302
302
* t - the expected data type
303
303
*/
304
- #define OPAL_MODEX_RECV_VALUE_IMMEDIATE (r , s , p , d , t ) \
305
- do { \
304
+ #define OPAL_MODEX_RECV_VALUE_IMMEDIATE (r , s , p , d , t ) \
305
+ do { \
306
306
pmix_proc_t _proc; \
307
307
pmix_value_t *_kv = NULL; \
308
308
pmix_info_t _info; \
309
309
size_t _sz; \
310
310
OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \
311
- "%s[%s:%d] MODEX RECV VALUE OPTIONAL FOR PROC %s KEY %s", \
311
+ "%s[%s:%d] MODEX RECV VALUE IMMEDIATE FOR PROC %s KEY %s", \
312
312
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
313
313
__FILE__, __LINE__, \
314
314
OPAL_NAME_PRINT(*(p)), (s))); \
@@ -349,7 +349,7 @@ typedef struct {
349
349
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
350
350
__FILE__, __LINE__, \
351
351
OPAL_NAME_PRINT(*(p)), (s))); \
352
- OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \
352
+ OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \
353
353
(r) = PMIx_Get(&(_proc), (s), NULL, 0, &(_kv)); \
354
354
if (NULL == _kv) { \
355
355
(r) = PMIX_ERR_NOT_FOUND; \
@@ -363,6 +363,46 @@ typedef struct {
363
363
} \
364
364
} while(0);
365
365
366
+ /**
367
+ * Provide a simplified macro for retrieving modex data
368
+ * from another process:
369
+ *
370
+ * r - the integer return status from the modex op (int)
371
+ * s - string key (char*)
372
+ * p - pointer to the opal_process_name_t of the proc that posted
373
+ * the data (opal_process_name_t*)
374
+ * d - pointer to a location wherein the data object
375
+ * it to be returned (char**)
376
+ * sz - pointer to a location wherein the number of bytes
377
+ * in the data object can be returned (size_t)
378
+ */
379
+ #define OPAL_MODEX_RECV_STRING_OPTIONAL (r , s , p , d , sz ) \
380
+ do { \
381
+ pmix_proc_t _proc; \
382
+ pmix_value_t *_kv = NULL; \
383
+ pmix_info_t _info; \
384
+ OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \
385
+ "%s[%s:%d] MODEX RECV STRING OPTIONAL FOR PROC %s KEY %s", \
386
+ OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
387
+ __FILE__, __LINE__, \
388
+ OPAL_NAME_PRINT(*(p)), (s))); \
389
+ *(d) = NULL; \
390
+ *(sz) = 0; \
391
+ OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \
392
+ PMIX_INFO_LOAD(&_info, PMIX_OPTIONAL, NULL, PMIX_BOOL); \
393
+ (r) = PMIx_Get(&(_proc), (s), &(_info), 1, &(_kv)); \
394
+ if (NULL == _kv) { \
395
+ (r) = PMIX_ERR_NOT_FOUND; \
396
+ } else if (PMIX_SUCCESS == (r)) { \
397
+ *(d) = (uint8_t*)_kv->data.bo.bytes; \
398
+ *(sz) = _kv->data.bo.size; \
399
+ _kv->data.bo.bytes = NULL; /* protect the data */ \
400
+ } \
401
+ if (NULL != _kv ) { \
402
+ PMIX_VALUE_RELEASE (_kv ); \
403
+ } \
404
+ } while (0 );
405
+
366
406
/**
367
407
* Provide a simplified macro for retrieving modex data
368
408
* from another process:
0 commit comments