From 6c800d452ddfc09965048c4b9a47775ecdbd2cce Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 23 Jul 2007 13:05:34 +0000 Subject: [PATCH] Bring orte tests up to date with revised rml system. Make first cut at fixing non-direct xcast modes This commit was SVN r15553. --- orte/mca/grpcomm/basic/grpcomm_basic_module.c | 42 +++++++------------ orte/test/system/orte_ring.c | 2 +- orte/test/system/orte_stage_gate.c | 3 +- orte/test/system/spawn_child.c | 2 +- 4 files changed, 18 insertions(+), 31 deletions(-) diff --git a/orte/mca/grpcomm/basic/grpcomm_basic_module.c b/orte/mca/grpcomm/basic/grpcomm_basic_module.c index a7940089e8..c681b00ad1 100644 --- a/orte/mca/grpcomm/basic/grpcomm_basic_module.c +++ b/orte/mca/grpcomm/basic/grpcomm_basic_module.c @@ -478,42 +478,28 @@ static int xcast_linear(orte_jobid_t job, */ OPAL_THREAD_LOCK(&orte_grpcomm_basic.mutex); orte_grpcomm_basic.num_active += range; - if (orte_process_info.daemon || - orte_process_info.seed || - orte_process_info.singleton) { - /* we never send to ourselves, - * so we need to adjust the number of sends - * we are expecting to complete - */ - orte_grpcomm_basic.num_active--; - if (orte_grpcomm_basic.num_active <= 0) { - OPAL_THREAD_UNLOCK(&orte_grpcomm_basic.mutex); - rc = ORTE_SUCCESS; - goto CLEANUP; - } - } OPAL_THREAD_UNLOCK(&orte_grpcomm_basic.mutex); /* send the message to each daemon as fast as we can */ dummy.jobid = 0; for (i=0; i < range; i++) { - if (ORTE_PROC_MY_NAME->vpid != i) { /* don't send to myself */ - dummy.vpid = i; - if (0 > (rc = orte_rml.send_buffer_nb(&dummy, buf, ORTE_RML_TAG_ORTED_ROUTED, - 0, xcast_send_cb, NULL))) { - if (ORTE_ERR_ADDRESSEE_UNKNOWN != rc) { - ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE); - rc = ORTE_ERR_COMM_FAILURE; - OPAL_THREAD_LOCK(&orte_grpcomm_basic.mutex); - orte_grpcomm_basic.num_active -= (range-i); - OPAL_THREAD_UNLOCK(&orte_grpcomm_basic.mutex); - goto CLEANUP; - } - /* decrement the number we are waiting to see */ + dummy.vpid = i; + opal_output(orte_grpcomm_basic.output, "%s xcast to %s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(&dummy)); + if (0 > (rc = orte_rml.send_buffer_nb(&dummy, buf, ORTE_RML_TAG_ORTED_ROUTED, + 0, xcast_send_cb, NULL))) { + if (ORTE_ERR_ADDRESSEE_UNKNOWN != rc) { + ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE); + rc = ORTE_ERR_COMM_FAILURE; OPAL_THREAD_LOCK(&orte_grpcomm_basic.mutex); - orte_grpcomm_basic.num_active--; + orte_grpcomm_basic.num_active -= (range-i); OPAL_THREAD_UNLOCK(&orte_grpcomm_basic.mutex); + goto CLEANUP; } + /* decrement the number we are waiting to see */ + OPAL_THREAD_LOCK(&orte_grpcomm_basic.mutex); + orte_grpcomm_basic.num_active--; + OPAL_THREAD_UNLOCK(&orte_grpcomm_basic.mutex); } } rc = ORTE_SUCCESS; diff --git a/orte/test/system/orte_ring.c b/orte/test/system/orte_ring.c index 56f192722b..c7d7a067bd 100644 --- a/orte/test/system/orte_ring.c +++ b/orte/test/system/orte_ring.c @@ -91,7 +91,7 @@ main(int argc, char *argv[]){ &msg, 1, MY_TAG, - MCA_OOB_ALLOC) ) { + ORTE_RML_ALLOC) ) { printf("error A... %d\n", __LINE__); } diff --git a/orte/test/system/orte_stage_gate.c b/orte/test/system/orte_stage_gate.c index 176881711c..dce198955b 100644 --- a/orte/test/system/orte_stage_gate.c +++ b/orte/test/system/orte_stage_gate.c @@ -20,6 +20,7 @@ #include "orte/mca/smr/smr.h" #include "orte/mca/errmgr/errmgr.h" #include "orte/mca/rml/rml.h" +#include "orte/mca/grpcomm/grpcomm.h" int main(int argc, char* argv[]) { @@ -93,7 +94,7 @@ int main(int argc, char* argv[]) } /* FIRST BARRIER - WAIT FOR MSG FROM RMGR_PROC_STAGE_GATE_MGR TO ARRIVE */ - if (ORTE_SUCCESS != (rc = orte_rml.xcast_gate(orte_gpr.deliver_notify_msg))) { + if (ORTE_SUCCESS != (rc = orte_grpcomm.xcast_gate(orte_gpr.deliver_notify_msg))) { ORTE_ERROR_LOG(rc); error = "failed to see all procs register\n"; goto error; diff --git a/orte/test/system/spawn_child.c b/orte/test/system/spawn_child.c index 6ab65c2443..4d9bbc0ede 100644 --- a/orte/test/system/spawn_child.c +++ b/orte/test/system/spawn_child.c @@ -30,7 +30,7 @@ int main(int argc, char* argv[]) pid = getpid(); /* wait for message from our parent */ - if (0 > orte_rml.recv(ORTE_NAME_WILDCARD, &msg, 1, MY_TAG, MCA_OOB_ALLOC)) { + if (0 > orte_rml.recv(ORTE_NAME_WILDCARD, &msg, 1, MY_TAG, ORTE_RML_ALLOC)) { printf("error at line %d\n", __LINE__); }