@@ -356,6 +356,17 @@ void pmix_server_notify(int status, orte_process_name_t* sender,
356
356
}
357
357
}
358
358
359
+ /* protect against infinite loops by marking that this notification was
360
+ * passed down to the server by me */
361
+ if (NULL == cd -> info ) {
362
+ cd -> info = OBJ_NEW (opal_list_t );
363
+ }
364
+ val = OBJ_NEW (opal_value_t );
365
+ val -> key = strdup ("orte.notify.donotloop" );
366
+ val -> type = OPAL_BOOL ;
367
+ val -> data .flag = true;
368
+ opal_list_append (cd -> info , & val -> super );
369
+
359
370
opal_output_verbose (2 , orte_pmix_server_globals .output ,
360
371
"%s NOTIFYING PMIX SERVER OF STATUS %d" ,
361
372
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ), ret );
@@ -382,6 +393,14 @@ int pmix_server_notify_event(int code, opal_process_name_t *source,
382
393
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),
383
394
ORTE_NAME_PRINT (source ), code );
384
395
396
+ /* check to see if this is one we sent down */
397
+ OPAL_LIST_FOREACH (val , info , opal_value_t ) {
398
+ if (0 == strcmp (val -> key , "orte.notify.donotloop" )) {
399
+ /* yep - do not process */
400
+ goto done ;
401
+ }
402
+ }
403
+
385
404
/* a local process has generated an event - we need to xcast it
386
405
* to all the daemons so it can be passed down to their local
387
406
* procs */
@@ -448,6 +467,7 @@ int pmix_server_notify_event(int code, opal_process_name_t *source,
448
467
/* maintain accounting */
449
468
OBJ_RELEASE (sig );
450
469
470
+ done :
451
471
/* execute the callback */
452
472
if (NULL != cbfunc ) {
453
473
cbfunc (ORTE_SUCCESS , cbdata );
0 commit comments