Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MPI_Allreduce for error code checking #595

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/clib/pio_nc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ int PIOc_inq_impl(int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdi
}

/* A failure to inquire is not fatal */
mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm);
mpierr = MPI_Allreduce(MPI_IN_PLACE, &ierr, 1, MPI_INT, MPI_BOR, ios->my_comm);
if(mpierr != MPI_SUCCESS){
spio_ltimer_stop(ios->io_fstats->tot_timer_name);
spio_ltimer_stop(file->io_fstats->tot_timer_name);
Expand Down Expand Up @@ -469,7 +469,8 @@ int PIOc_inq_unlimdims_impl(int ncid, int *nunlimdimsp, int *unlimdimidsp)
#endif

/* A failure to inquire is not fatal */
mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm);
mpierr = MPI_Allreduce(MPI_IN_PLACE, &ierr, 1, MPI_INT, MPI_BOR, ios->my_comm);

if(mpierr != MPI_SUCCESS){
spio_ltimer_stop(ios->io_fstats->tot_timer_name);
spio_ltimer_stop(file->io_fstats->tot_timer_name);
Expand Down Expand Up @@ -921,7 +922,7 @@ int PIOc_inq_dim_impl(int ncid, int dimid, char *name, PIO_Offset *lenp)
}

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

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

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

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

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

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