diff --git a/orte/orted/pmix/pmix_server_gen.c b/orte/orted/pmix/pmix_server_gen.c index 8993a6cdf0..2c9d7326fb 100644 --- a/orte/orted/pmix/pmix_server_gen.c +++ b/orte/orted/pmix/pmix_server_gen.c @@ -356,6 +356,17 @@ void pmix_server_notify(int status, orte_process_name_t* sender, } } + /* protect against infinite loops by marking that this notification was + * passed down to the server by me */ + if (NULL == cd->info) { + cd->info = OBJ_NEW(opal_list_t); + } + val = OBJ_NEW(opal_value_t); + val->key = strdup("orte.notify.donotloop"); + val->type = OPAL_BOOL; + val->data.flag = true; + opal_list_append(cd->info, &val->super); + opal_output_verbose(2, orte_pmix_server_globals.output, "%s NOTIFYING PMIX SERVER OF STATUS %d", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ret); @@ -382,6 +393,14 @@ int pmix_server_notify_event(int code, opal_process_name_t *source, ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(source), code); + /* check to see if this is one we sent down */ + OPAL_LIST_FOREACH(val, info, opal_value_t) { + if (0 == strcmp(val->key, "orte.notify.donotloop")) { + /* yep - do not process */ + goto done; + } + } + /* a local process has generated an event - we need to xcast it * to all the daemons so it can be passed down to their local * procs */ @@ -448,6 +467,7 @@ int pmix_server_notify_event(int code, opal_process_name_t *source, /* maintain accounting */ OBJ_RELEASE(sig); + done: /* execute the callback */ if (NULL != cbfunc) { cbfunc(ORTE_SUCCESS, cbdata);