@@ -274,6 +274,7 @@ typedef struct {
274
274
OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \
275
275
PMIX_INFO_LOAD(&_info, PMIX_OPTIONAL, NULL, PMIX_BOOL); \
276
276
(r) = PMIx_Get(&(_proc), (s), &(_info), 1, &(_kv)); \
277
+ PMIX_INFO_DESTRUCT(&_info); \
277
278
if (NULL == _kv) { \
278
279
(r) = PMIX_ERR_NOT_FOUND; \
279
280
} else if (_kv->type != (t)) { \
@@ -301,8 +302,8 @@ typedef struct {
301
302
* is to be returned
302
303
* t - the expected data type
303
304
*/
304
- #define OPAL_MODEX_RECV_VALUE_IMMEDIATE (r , s , p , d , t ) \
305
- do { \
305
+ #define OPAL_MODEX_RECV_VALUE_IMMEDIATE (r , s , p , d , t ) \
306
+ do { \
306
307
pmix_proc_t _proc; \
307
308
pmix_value_t *_kv = NULL; \
308
309
pmix_info_t _info; \
@@ -315,6 +316,7 @@ typedef struct {
315
316
OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \
316
317
PMIX_INFO_LOAD(&_info, PMIX_IMMEDIATE, NULL, PMIX_BOOL); \
317
318
(r) = PMIx_Get(&(_proc), (s), &(_info), 1, &(_kv)); \
319
+ PMIX_INFO_DESTRUCT(&_info); \
318
320
if (NULL == _kv) { \
319
321
(r) = PMIX_ERR_NOT_FOUND; \
320
322
} else if (_kv->type != (t)) { \
@@ -349,7 +351,7 @@ typedef struct {
349
351
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
350
352
__FILE__, __LINE__, \
351
353
OPAL_NAME_PRINT(*(p)), (s))); \
352
- OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \
354
+ OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \
353
355
(r) = PMIx_Get(&(_proc), (s), NULL, 0, &(_kv)); \
354
356
if (NULL == _kv) { \
355
357
(r) = PMIX_ERR_NOT_FOUND; \
@@ -401,6 +403,47 @@ typedef struct {
401
403
} \
402
404
} while (0 );
403
405
406
+ /**
407
+ * Provide a simplified macro for retrieving modex data
408
+ * from another process:
409
+ *
410
+ * r - the integer return status from the modex op (int)
411
+ * s - string key (char*)
412
+ * p - pointer to the opal_process_name_t of the proc that posted
413
+ * the data (opal_process_name_t*)
414
+ * d - pointer to a location wherein the data object
415
+ * it to be returned (char**)
416
+ * sz - pointer to a location wherein the number of bytes
417
+ * in the data object can be returned (size_t)
418
+ */
419
+ #define OPAL_MODEX_RECV_STRING_IMMEDIATE (r , s , p , d , sz ) \
420
+ do { \
421
+ pmix_proc_t _proc; \
422
+ pmix_value_t *_kv = NULL; \
423
+ pmix_info_t _info; \
424
+ OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \
425
+ "%s[%s:%d] MODEX RECV STRING FOR PROC %s KEY %s", \
426
+ OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
427
+ __FILE__, __LINE__, \
428
+ OPAL_NAME_PRINT(*(p)), (s))); \
429
+ *(d) = NULL; \
430
+ *(sz) = 0; \
431
+ OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \
432
+ PMIX_INFO_LOAD(&_info, PMIX_IMMEDIATE, NULL, PMIX_BOOL); \
433
+ (r) = PMIx_Get(&(_proc), (s), &_info, 1, &(_kv)); \
434
+ PMIX_INFO_DESTRUCT(&_info); \
435
+ if (NULL == _kv) { \
436
+ (r) = PMIX_ERR_NOT_FOUND; \
437
+ } else if (PMIX_SUCCESS == (r)) { \
438
+ *(d) = (uint8_t*)_kv->data.bo.bytes; \
439
+ *(sz) = _kv->data.bo.size; \
440
+ _kv->data.bo.bytes = NULL; /* protect the data */ \
441
+ } \
442
+ if (NULL != _kv ) { \
443
+ PMIX_VALUE_RELEASE (_kv ); \
444
+ } \
445
+ } while (0 );
446
+
404
447
/**
405
448
* Provide a simplified macro for retrieving modex data
406
449
* from another process:
@@ -432,6 +475,38 @@ typedef struct {
432
475
} \
433
476
} while(0);
434
477
478
+ /**
479
+ * Provide a simplified macro for retrieving modex data
480
+ * from another process:
481
+ *
482
+ * r - the integer return status from the modex op (int)
483
+ * s - the MCA component that posted the data (mca_base_component_t*)
484
+ * p - pointer to the opal_process_name_t of the proc that posted
485
+ * the data (opal_process_name_t*)
486
+ * d - pointer to a location wherein the data object
487
+ * it to be returned (char**)
488
+ * sz - pointer to a location wherein the number of bytes
489
+ * in the data object can be returned (size_t)
490
+ */
491
+ #define OPAL_MODEX_RECV_IMMEDIATE (r , s , p , d , sz ) \
492
+ do { \
493
+ char *_key; \
494
+ _key = mca_base_component_to_string((s)); \
495
+ OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \
496
+ "%s[%s:%d] MODEX RECV FOR PROC %s KEY %s", \
497
+ OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
498
+ __FILE__, __LINE__, \
499
+ OPAL_NAME_PRINT(*(p)), _key)); \
500
+ if (NULL == _key) { \
501
+ OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); \
502
+ (r) = OPAL_ERR_OUT_OF_RESOURCE; \
503
+ } else { \
504
+ OPAL_MODEX_RECV_STRING_IMMEDIATE((r), _key, (p), (d), (sz)); \
505
+ free(_key); \
506
+ } \
507
+ } while(0);
508
+
509
+
435
510
#define PMIX_ERROR_LOG (r ) \
436
511
opal_output(0, "[%s:%d] PMIx Error: %s", __FILE__, __LINE__, PMIx_Error_string((r)))
437
512
0 commit comments