Skip to content

Commit c37de48

Browse files
committed
Replace MPI_Bcast with MPI_Allreduce for all ierr checking
1 parent 02e865e commit c37de48

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/clib/pio_nc.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ int PIOc_inq_impl(int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdi
235235
}
236236

237237
/* A failure to inquire is not fatal */
238-
mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm);
238+
mpierr = MPI_Allreduce(MPI_IN_PLACE, &ierr, 1, MPI_INT, MPI_BOR, ios->my_comm);
239239
if(mpierr != MPI_SUCCESS){
240240
spio_ltimer_stop(ios->io_fstats->tot_timer_name);
241241
spio_ltimer_stop(file->io_fstats->tot_timer_name);
@@ -922,7 +922,7 @@ int PIOc_inq_dim_impl(int ncid, int dimid, char *name, PIO_Offset *lenp)
922922
}
923923

924924
/* A failure to inquire is not fatal */
925-
mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm);
925+
mpierr = MPI_Allreduce(MPI_IN_PLACE, &ierr, 1, MPI_INT, MPI_BOR, ios->my_comm);
926926
if(mpierr != MPI_SUCCESS){
927927
spio_ltimer_stop(ios->io_fstats->tot_timer_name);
928928
spio_ltimer_stop(file->io_fstats->tot_timer_name);
@@ -1156,7 +1156,7 @@ int PIOc_inq_dimid_impl(int ncid, const char *name, int *idp)
11561156
LOG((3, "nc_inq_dimid call complete ierr = %d", ierr));
11571157

11581158
/* A failure to inquire is not fatal */
1159-
mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm);
1159+
mpierr = MPI_Allreduce(MPI_IN_PLACE, &ierr, 1, MPI_INT, MPI_BOR, ios->my_comm);
11601160
if(mpierr != MPI_SUCCESS){
11611161
spio_ltimer_stop(ios->io_fstats->tot_timer_name);
11621162
spio_ltimer_stop(file->io_fstats->tot_timer_name);
@@ -1431,7 +1431,7 @@ int PIOc_inq_var_impl(int ncid, int varid, char *name, int namelen, nc_type *xty
14311431
}
14321432

14331433
/* A failure to inquire is not fatal */
1434-
mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm);
1434+
mpierr = MPI_Allreduce(MPI_IN_PLACE, &ierr, 1, MPI_INT, MPI_BOR, ios->my_comm);
14351435
if(mpierr != MPI_SUCCESS){
14361436
spio_ltimer_stop(ios->io_fstats->tot_timer_name);
14371437
spio_ltimer_stop(file->io_fstats->tot_timer_name);
@@ -1797,7 +1797,7 @@ int PIOc_inq_varid_impl(int ncid, const char *name, int *varidp)
17971797
}
17981798

17991799
/* A failure to inquire is not fatal */
1800-
mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm);
1800+
mpierr = MPI_Allreduce(MPI_IN_PLACE, &ierr, 1, MPI_INT, MPI_BOR, ios->my_comm);
18011801
if(mpierr != MPI_SUCCESS){
18021802
spio_ltimer_stop(ios->io_fstats->tot_timer_name);
18031803
spio_ltimer_stop(file->io_fstats->tot_timer_name);
@@ -2034,7 +2034,7 @@ int PIOc_inq_att_impl(int ncid, int varid, const char *name, nc_type *xtypep,
20342034
}
20352035

20362036
/* A failure to inquire is not fatal */
2037-
mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm);
2037+
mpierr = MPI_Allreduce(MPI_IN_PLACE, &ierr, 1, MPI_INT, MPI_BOR, ios->my_comm);
20382038
if(mpierr != MPI_SUCCESS){
20392039
spio_ltimer_stop(ios->io_fstats->tot_timer_name);
20402040
spio_ltimer_stop(file->io_fstats->tot_timer_name);
@@ -2420,7 +2420,7 @@ int PIOc_inq_attid_impl(int ncid, int varid, const char *name, int *idp)
24202420
}
24212421

24222422
/* A failure to inquire is not fatal */
2423-
mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm);
2423+
mpierr = MPI_Allreduce(MPI_IN_PLACE, &ierr, 1, MPI_INT, MPI_BOR, ios->my_comm);
24242424
if(mpierr != MPI_SUCCESS){
24252425
spio_ltimer_stop(ios->io_fstats->tot_timer_name);
24262426
spio_ltimer_stop(file->io_fstats->tot_timer_name);

0 commit comments

Comments
 (0)