Skip to content

Commit 6b6b24a

Browse files
committed
Retry failed nczarr opens with netcdf4p
Retry using NetCDF4 parallel (non-nczarr) APIs when opening file as an NCZarr file fails
1 parent 0dab860 commit 6b6b24a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/clib/pioc_support.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5253,6 +5253,11 @@ int PIOc_openfile_retry_impl(int iosysid, int *ncidp, int *iotype, const char *f
52535253
if(!filename_nczarr.empty()){
52545254
ierr = nc_open_par(filename_nczarr.c_str(), file->mode,
52555255
ios->io_comm, ios->info, &file->fh);
5256+
if(ierr != NC_NOERR){
5257+
/* The file being opened may not be NCZarr, for now retry with NetCDF4 */
5258+
file->iotype = PIO_IOTYPE_NETCDF4P;
5259+
ierr = nc_open_par(filename, file->mode, ios->io_comm, ios->info, &file->fh);
5260+
}
52565261
}
52575262
}
52585263
LOG((2, "nc_open_par returned %d file->fh = %d", ierr, file->fh));

0 commit comments

Comments
 (0)