1
1

Replace the pattern while(flag) { opal_progress() }; in the C/R code

with the ORTE_WAIT_FOR_COMPLETION macro.

This commit was SVN r26794.
Этот коммит содержится в:
Abhishek Kulkarni 2012-07-13 23:31:56 +00:00
родитель 4d1920ee87
Коммит 1878f276cd
5 изменённых файлов: 49 добавлений и 105 удалений

Просмотреть файл

@ -32,6 +32,7 @@
#include "opal/mca/base/mca_base_param.h"
#include "orte/runtime/orte_globals.h"
#include "orte/runtime/orte_wait.h"
#include "orte/util/name_fns.h"
#include "orte/mca/grpcomm/grpcomm.h"
#include "orte/mca/rml/rml.h"
@ -3040,9 +3041,7 @@ ompi_crcp_base_pml_state_t* ompi_crcp_bkmrk_pml_ft_event(
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCPBR0);
orte_grpcomm.barrier(&coll);
while (coll.active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll.active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCP0);
@ -3111,9 +3110,7 @@ ompi_crcp_base_pml_state_t* ompi_crcp_bkmrk_pml_ft_event(
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_COREBR1);
orte_grpcomm.barrier(&coll);
while (coll.active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll.active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CORE2);
}
@ -6280,9 +6277,7 @@ static void display_all_timers(int state) {
}
else if( 2 == timing_enabled ) {
orte_grpcomm.barrier(&coll);
while (coll.active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll.active);
goto done;
}
}
@ -6304,9 +6299,7 @@ static void display_all_timers(int state) {
if( timing_enabled >= 2) {
barrier_start = get_time();
orte_grpcomm.barrier(&coll);
while (coll.active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll.active);
barrier_stop = get_time();
opal_output(0,
"crcp:bkmrk: timing(%20s): %20s = %10.2f s\n",

Просмотреть файл

@ -31,6 +31,7 @@
#include "opal/class/opal_bitmap.h"
#include "opal/util/output.h"
#include "orte/runtime/orte_wait.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/grpcomm/grpcomm.h"
#include "orte/util/show_help.h"
@ -679,9 +680,7 @@ int mca_pml_bfo_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCPBR1);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P0);
@ -693,9 +692,7 @@ int mca_pml_bfo_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_COREBR0);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P2);
}
@ -798,9 +795,7 @@ int mca_pml_bfo_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR1);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P3);
}
@ -819,9 +814,7 @@ int mca_pml_bfo_ft_event( int state )
OBJ_RELEASE(modex);
goto clean;
}
while (modex->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(modex->active);
OBJ_RELEASE(modex);
/*
@ -838,9 +831,7 @@ int mca_pml_bfo_ft_event( int state )
opal_output(0, "pml:bfo: ft_event(Restart): Failed in orte_grpcomm.barrier (%d)", ret);
return ret;
}
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
if( NULL != procs ) {
for(p = 0; p < (int)num_procs; ++p) {
@ -854,9 +845,7 @@ int mca_pml_bfo_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR2);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCP1);
}
@ -878,9 +867,7 @@ int mca_pml_bfo_ft_event( int state )
OBJ_RELEASE(modex);
goto clean;
}
while (modex->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(modex->active);
OBJ_RELEASE(modex);
/*
@ -897,9 +884,7 @@ int mca_pml_bfo_ft_event( int state )
opal_output(0, "pml:bfo: ft_event(Restart): Failed in orte_grpcomm.barrier (%d)", ret);
goto clean;
}
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
if( NULL != procs ) {
for(p = 0; p < (int)num_procs; ++p) {

Просмотреть файл

@ -33,6 +33,7 @@
#include "opal/util/crc.h"
#include "opal/util/output.h"
#include "orte/runtime/orte_wait.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/grpcomm/grpcomm.h"
#include "orte/util/show_help.h"
@ -662,9 +663,7 @@ int mca_pml_csum_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCPBR1);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P0);
@ -676,9 +675,7 @@ int mca_pml_csum_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_COREBR0);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P2);
}
@ -781,9 +778,7 @@ int mca_pml_csum_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR1);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P3);
}
@ -802,9 +797,7 @@ int mca_pml_csum_ft_event( int state )
OBJ_RELEASE(modex);
goto clean;
}
while (modex->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(modex->active);
OBJ_RELEASE(modex);
/*
@ -821,9 +814,7 @@ int mca_pml_csum_ft_event( int state )
opal_output(0, "pml:csum: ft_event(Restart): Failed in orte_grpcomm.barrier (%d)", ret);
goto clean;
}
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
if( NULL != procs ) {
for(p = 0; p < (int)num_procs; ++p) {
@ -837,9 +828,7 @@ int mca_pml_csum_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR2);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCP1);
}
@ -861,9 +850,7 @@ int mca_pml_csum_ft_event( int state )
OBJ_RELEASE(modex);
goto clean;
}
while (modex->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(modex->active);
OBJ_RELEASE(modex);
/*
@ -880,9 +867,7 @@ int mca_pml_csum_ft_event( int state )
opal_output(0, "pml:csum: ft_event(Restart): Failed in orte_grpcomm.barrier (%d)", ret);
goto clean;
}
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
if( NULL != procs ) {
for(p = 0; p < (int)num_procs; ++p) {

Просмотреть файл

@ -31,6 +31,7 @@
#include "opal/class/opal_bitmap.h"
#include "opal/util/output.h"
#include "orte/runtime/orte_wait.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/grpcomm/grpcomm.h"
#include "orte/util/show_help.h"
@ -639,9 +640,7 @@ int mca_pml_ob1_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCPBR1);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P0);
@ -653,9 +652,7 @@ int mca_pml_ob1_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_COREBR0);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P2);
}
@ -758,9 +755,7 @@ int mca_pml_ob1_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR1);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2P3);
}
@ -779,9 +774,7 @@ int mca_pml_ob1_ft_event( int state )
OBJ_RELEASE(modex);
goto clean;
}
while (modex->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(modex->active);
OBJ_RELEASE(modex);
/*
@ -798,9 +791,7 @@ int mca_pml_ob1_ft_event( int state )
opal_output(0, "pml:ob1: ft_event(Restart): Failed in orte_grpcomm.barrier (%d)", ret);
goto clean;
}
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
if( NULL != procs ) {
for(p = 0; p < (int)num_procs; ++p) {
@ -814,9 +805,7 @@ int mca_pml_ob1_ft_event( int state )
if( opal_cr_timing_barrier_enabled ) {
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR2);
orte_grpcomm.barrier(coll);
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
}
OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCP1);
}
@ -838,9 +827,7 @@ int mca_pml_ob1_ft_event( int state )
OBJ_RELEASE(modex);
goto clean;
}
while (modex->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(modex->active);
OBJ_RELEASE(modex);
/*
@ -857,9 +844,7 @@ int mca_pml_ob1_ft_event( int state )
opal_output(0, "pml:ob1: ft_event(Restart): Failed in orte_grpcomm.barrier (%d)", ret);
goto clean;
}
while (coll->active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
if( NULL != procs ) {
for(p = 0; p < (int)num_procs; ++p) {

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* Copyright (c) 2004-2012 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
@ -39,6 +39,7 @@
#include "orte/runtime/orte_cr.h"
#include "orte/runtime/orte_globals.h"
#include "orte/runtime/orte_wait.h"
#include "opal/runtime/opal_cr.h"
#include "opal/util/output.h"
#include "opal/mca/event/event.h"
@ -110,7 +111,7 @@ int app_coord_init()
orte_snapc_full_cmd_flag_t command = ORTE_SNAPC_FULL_REQUEST_OP_CMD;
orte_snapc_base_request_op_event_t op_event = ORTE_SNAPC_OP_INIT;
opal_buffer_t buffer;
orte_grpcomm_collective_t coll;
orte_grpcomm_collective_t *coll;
OPAL_OUTPUT_VERBOSE((20, mca_snapc_full_component.super.output_handle,
"App) Initalized for Application %s\n",
@ -154,18 +155,15 @@ int app_coord_init()
"app) Startup Barrier..."));
}
OBJ_CONSTRUCT(&coll, orte_grpcomm_collective_t);
coll.id = orte_process_info.peer_init_barrier;
if( ORTE_SUCCESS != (ret = orte_grpcomm.barrier(&coll)) ) {
ORTE_ERROR_LOG(ret);
coll = OBJ_NEW(orte_grpcomm_collective_t);
coll->id = orte_process_info.peer_init_barrier;
if( ORTE_SUCCESS != (ret = orte_grpcomm.barrier(coll)) ) {
ORTE_ERROR_LOG(ret);
exit_status = ret;
OBJ_DESTRUCT(&coll);
goto cleanup;
}
while (coll.active) {
opal_progress();
}
OBJ_DESTRUCT(&coll);
ORTE_WAIT_FOR_COMPLETION(coll->active);
OBJ_RELEASE(coll);
if( 0 == ORTE_PROC_MY_NAME->vpid ) {
OPAL_OUTPUT_VERBOSE((3, mca_snapc_full_component.super.output_handle,
@ -219,7 +217,7 @@ int app_coord_finalize()
orte_snapc_base_request_op_event_t op_event = ORTE_SNAPC_OP_FIN;
opal_buffer_t buffer;
orte_std_cntr_t count;
orte_grpcomm_collective_t coll;
orte_grpcomm_collective_t *coll;
/*
* All processes must sync here, so the Global coordinator can know that
@ -231,16 +229,14 @@ int app_coord_finalize()
"app) Shutdown Barrier..."));
}
OBJ_CONSTRUCT(&coll, orte_grpcomm_collective_t);
coll.id = orte_process_info.peer_init_barrier;
if( ORTE_SUCCESS != (ret = orte_grpcomm.barrier(&coll)) ) {
coll = OBJ_NEW(orte_grpcomm_collective_t);
coll->id = orte_process_info.peer_init_barrier;
if( ORTE_SUCCESS != (ret = orte_grpcomm.barrier(coll)) ) {
ORTE_ERROR_LOG(ret);
exit_status = ret;
goto cleanup;
}
while (coll.active) {
opal_progress();
}
ORTE_WAIT_FOR_COMPLETION(coll->active);
if( 0 == ORTE_PROC_MY_NAME->vpid ) {
OPAL_OUTPUT_VERBOSE((3, mca_snapc_full_component.super.output_handle,
@ -311,8 +307,8 @@ int app_coord_finalize()
"app) Shutdown Barrier: Waiting on barrier...!"));
}
coll.id = orte_process_info.peer_fini_barrier;
if( ORTE_SUCCESS != (ret = orte_grpcomm.barrier(&coll)) ) {
coll->id = orte_process_info.peer_fini_barrier;
if( ORTE_SUCCESS != (ret = orte_grpcomm.barrier(coll)) ) {
ORTE_ERROR_LOG(ret);
exit_status = ret;
goto cleanup;
@ -325,7 +321,7 @@ int app_coord_finalize()
cleanup:
/* cleanup */
OBJ_DESTRUCT(&coll);
OBJ_RELEASE(coll);
/*
* Cleanup named pipes