Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions contrib/scaling/mpi_memprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <stdio.h>
#include "mpi.h"
#include "opal/mca/pmix/pmix.h"
#include "opal/util/argv.h"
#include "orte/runtime/runtime.h"
#include "orte/util/proc_info.h"
#include "orte/util/name_fns.h"
Expand Down Expand Up @@ -117,17 +118,19 @@ static void sample(void)
free(tmp);
OPAL_LIST_FOREACH(kv, &response, opal_value_t) {
lt = (opal_list_t*)kv->data.ptr;
OPAL_LIST_FOREACH(ival, lt, opal_value_t) {
if (0 == strcmp(ival->key, OPAL_PMIX_DAEMON_MEMORY)) {
asprintf(&tmp, "\tDaemon: %f", ival->data.fval);
opal_argv_append_nosize(&answer, tmp);
free(tmp);
} else if (0 == strcmp(ival->key, OPAL_PMIX_CLIENT_AVG_MEMORY)) {
asprintf(&tmp, "\tClient: %f", ival->data.fval);
opal_argv_append_nosize(&answer, tmp);
free(tmp);
} else {
fprintf(stderr, "\tUnknown key: %s", ival->key);
if (NULL != lt) {
OPAL_LIST_FOREACH(ival, lt, opal_value_t) {
if (0 == strcmp(ival->key, OPAL_PMIX_DAEMON_MEMORY)) {
asprintf(&tmp, "\tDaemon: %f", ival->data.fval);
opal_argv_append_nosize(&answer, tmp);
free(tmp);
} else if (0 == strcmp(ival->key, OPAL_PMIX_CLIENT_AVG_MEMORY)) {
asprintf(&tmp, "\tClient: %f", ival->data.fval);
opal_argv_append_nosize(&answer, tmp);
free(tmp);
} else {
fprintf(stderr, "\tUnknown key: %s", ival->key);
}
}
}
}
Expand All @@ -149,7 +152,6 @@ static void sample(void)
}
OPAL_LIST_DESTRUCT(&response);


if (0 == rank) {
/* send the notification to release the other procs */
wait_for_release = true;
Expand All @@ -162,19 +164,15 @@ static void sample(void)
active = -1;
if (OPAL_SUCCESS != opal_pmix.notify_event(MEMPROBE_RELEASE, NULL,
OPAL_PMIX_RANGE_GLOBAL, &response,
notifycbfunc, (void*)&active)) {
NULL, NULL)) {
fprintf(stderr, "Notify event failed\n");
exit(1);
}
while (-1 == active) {
} else {
/* now wait for notification */
while (wait_for_release) {
usleep(10);
}
OPAL_LIST_DESTRUCT(&response);
}

/* now wait for notification */
while (wait_for_release) {
usleep(10);
}
}

Expand Down
2 changes: 1 addition & 1 deletion opal/mca/pmix/pmix2x/pmix/include/pmix_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ typedef struct pmix_value {
free((m)->data.bo.bytes); \
} \
} else if (PMIX_DATA_ARRAY == (m)->type) { \
if (NULL != (m)->data.darray) { \
if (NULL != (m)->data.darray && NULL != (m)->data.darray->array) { \
if (PMIX_STRING == (m)->data.darray->type) { \
char **_str = (char**)(m)->data.darray->array; \
for (_n=0; _n < (m)->data.darray->size; _n++) { \
Expand Down
11 changes: 9 additions & 2 deletions opal/mca/pmix/pmix2x/pmix/src/buffer_ops/unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,8 @@ pmix_status_t pmix_bfrop_unpack_status(pmix_buffer_t *buffer, void *dest,
break;
/********************/
default:
pmix_output(0, "UNPACK-PMIX-VALUE: UNSUPPORTED TYPE %d", (int)val->type);
return PMIX_ERROR;
pmix_output(0, "UNPACK-PMIX-VALUE: UNSUPPORTED TYPE %d", (int)val->type);
return PMIX_ERROR;
}

return PMIX_SUCCESS;
Expand Down Expand Up @@ -765,6 +765,7 @@ pmix_status_t pmix_bfrop_unpack_info(pmix_buffer_t *buffer, void *dest,
m=1;
tmp = NULL;
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_string(buffer, &tmp, &m, PMIX_STRING))) {
PMIX_ERROR_LOG(ret);
return ret;
}
if (NULL == tmp) {
Expand All @@ -775,19 +776,22 @@ pmix_status_t pmix_bfrop_unpack_info(pmix_buffer_t *buffer, void *dest,
/* unpack the flags */
m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_infodirs(buffer, &ptr[i].flags, &m, PMIX_INFO_DIRECTIVES))) {
PMIX_ERROR_LOG(ret);
return ret;
}
/* unpack value - since the value structure is statically-defined
* instead of a pointer in this struct, we directly unpack it to
* avoid the malloc */
m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_int(buffer, &ptr[i].value.type, &m, PMIX_INT))) {
PMIX_ERROR_LOG(ret);
return ret;
}
pmix_output_verbose(20, pmix_globals.debug_output,
"pmix_bfrop_unpack: info type %d", ptr[i].value.type);
m=1;
if (PMIX_SUCCESS != (ret = unpack_val(buffer, &ptr[i].value))) {
PMIX_ERROR_LOG(ret);
return ret;
}
}
Expand Down Expand Up @@ -1272,6 +1276,9 @@ pmix_status_t pmix_bfrop_unpack_darray(pmix_buffer_t *buffer, void *dest,
case PMIX_STATUS:
nbytes = sizeof(pmix_status_t);
break;
case PMIX_INFO:
nbytes = sizeof(pmix_info_t);
break;
case PMIX_PROC:
nbytes = sizeof(pmix_proc_t);
break;
Expand Down