Open andreapiacentini opened 2 months ago
This behavior appears to be related to the version of NetCDF-C. Updating to 4.9.2 on my PC solved the issue. Notice that 4.6.1, 4.6.2 and 4.7.1 are still widely used (more recent version have proven hard to tune on lustre filesystems)
In
core/src/ParallelNetcdfFile.cpp
theopen_par
function calls NetCDFnc_open_par
: if parallelism is enabled in NetCDF, themode
has to specify if theNC_MPIIO
orNC_PNETCDF
mode is chosen, otherwise anInvalid argument
exception is raised.Adding
| MPIIO
in the calls inside theswitch (fMode)
section fixed the problems, but it can be tailored as a choice.Cf, from XIOS,
src/io/onetcdf4.cpp
.I also noticed that the
MPI_Info info
argument is passed uninitialized to NetCDF. It should be set toMPI_INFO_NULL
if no hint is passed to NetCDF. This is done in XIOS (same file), but could be let open to optimization (probably a bit too much geeky, though).There a choice from removing the info argument from the API of
open_par
and set it toMPI_INFO_NULL
inside or to propagate the initialization to the callers.