Skip to content

error code checking #520

@wkliao

Description

@wkliao

This error code checking is problematic. Assuming it is possible that ierr can
be different among processes, checking only root's ierr at line 1429 after bcast
at line 1422 may not detect a failure on other processes.

scorpio/src/clib/pio_nc.c

Lines 1421 to 1434 in ac679a5

/* A failure to inquire is not fatal */
mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, 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);
return check_mpi(NULL, file, mpierr, __FILE__, __LINE__);
}
if(ierr != PIO_NOERR){
LOG((1, "nc*_inq_var failed, ierr = %d", ierr));
spio_ltimer_stop(ios->io_fstats->tot_timer_name);
spio_ltimer_stop(file->io_fstats->tot_timer_name);
return ierr;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions