diff --git a/src/mca/gpr/replica/functional_layer/gpr_replica_messaging_fn.c b/src/mca/gpr/replica/functional_layer/gpr_replica_messaging_fn.c index fef9fe5e19..b4547aed01 100644 --- a/src/mca/gpr/replica/functional_layer/gpr_replica_messaging_fn.c +++ b/src/mca/gpr/replica/functional_layer/gpr_replica_messaging_fn.c @@ -58,7 +58,7 @@ int orte_gpr_replica_process_callbacks(void) /* set flag indicating callbacks being processed */ orte_gpr_replica.processing_callbacks = true; - while (NULL != (cb = (orte_gpr_replica_callbacks_t*)ompi_list_remove_first(&orte_gpr_replica.callbacks))) { + while (NULL != (cb = (orte_gpr_replica_callbacks_t*)ompi_list_remove_last(&orte_gpr_replica.callbacks))) { if (NULL == cb->requestor) { /* local callback */ if (orte_gpr_replica_globals.debug) { diff --git a/src/mca/gpr/replica/functional_layer/gpr_replica_trig_ops_fn.c b/src/mca/gpr/replica/functional_layer/gpr_replica_trig_ops_fn.c index 19743a4462..371cbfd4a3 100644 --- a/src/mca/gpr/replica/functional_layer/gpr_replica_trig_ops_fn.c +++ b/src/mca/gpr/replica/functional_layer/gpr_replica_trig_ops_fn.c @@ -202,13 +202,6 @@ int orte_gpr_replica_check_subscriptions(orte_gpr_replica_segment_t *seg) i < (orte_gpr_replica.triggers)->size; i++) { if (NULL != trig[i]) { cntri++; - /* check if trigger is on this subscription - if so, check it */ - if (ORTE_GPR_TRIG_ANY & trig[i]->action) { - if (ORTE_SUCCESS != (rc = orte_gpr_replica_check_trig(trig[i]))) { - ORTE_ERROR_LOG(rc); - return rc; - } - } /* check if notifier is on this subscription - if so, check to see * if it has fired, but ONLY if NOTIFY_START is NOT set */ @@ -236,6 +229,18 @@ int orte_gpr_replica_check_subscriptions(orte_gpr_replica_segment_t *seg) } } } /* if notify */ + /* check if trigger is on this subscription - if so, check it. + * NOTE: MUST DO THIS *AFTER* THE NOTIFY CHECK. If the trigger was + * set to start notifies after firing, then checking notifies + * AFTER the triggers were processed causes the notification to + * be sent twice. + */ + if (ORTE_GPR_TRIG_ANY & trig[i]->action) { + if (ORTE_SUCCESS != (rc = orte_gpr_replica_check_trig(trig[i]))) { + ORTE_ERROR_LOG(rc); + return rc; + } + } } /* if trig not NULL */ } return ORTE_SUCCESS;