E3SM-Project / scorpio

A high-level Parallel I/O Library for structured grid applications
19 stars 16 forks source link

Configure check for NC4 chunking consts #536

Closed jayeshkrishna closed 10 months ago

jayeshkrishna commented 10 months ago

Adding a configure check (and appropriate warning messages) for NetCDF4 chunking constants.

Fixes #523

dqwu commented 10 months ago

@jayeshkrishna This PR works on Chrysalis, but the following CMake warning message is not found in bld/spio.bldlog.xxxx.gz: message(WARNING "NetCDF4 is available but NetCDF4 chunking constants are not defined (limits chunking support)")

jayeshkrishna commented 10 months ago

Are you suppressing warnings by any chance (-Wno-dev or something similar)?

dqwu commented 10 months ago

Are you suppressing warnings by any chance (-Wno-dev or something similar)?

-Wno-dev is added by CIME in Tools/Makefile:

CMAKE_OPTS += -Wno-dev -D CMAKE_Fortran_FLAGS:STRING="$(FFLAGS) $(EXTRA_PIO_FPPDEFS) $(INCLDIR)" \
          -D CMAKE_C_FLAGS:STRING="$(CFLAGS) $(EXTRA_PIO_CPPDEFS) $(INCLDIR)" \
          -D CMAKE_CXX_FLAGS:STRING="$(CXXFLAGS) $(EXTRA_PIO_CPPDEFS) $(INCLDIR)" \
          -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
          -D GPTL_PATH:STRING=$(INSTALL_SHAREDPATH) \
          -D PIO_ENABLE_TESTS:BOOL=OFF \
          -D PIO_USE_MALLOC:BOOL=ON \
          -D USER_CMAKE_MODULE_PATH:LIST="$(CIMEROOT)/CIME/non_py/src/CMake;$(EXTERN_PATH)/parallelio/cmake"
dqwu commented 10 months ago

@jayeshkrishna

Even without the "-Wno-dev" flag, the CMake configuration output is different on GCE and Chrysalis.

GCE:

-- Found NetCDF_Fortran: /nfs/gce/projects/climate/software/linux-ubuntu20.04-x86_64/netcdf/4.8.0c-4.3.1cxx-4.5.3f-parallel/mpich-4.0/gcc-11.1.0/lib/libnetcdff.a  
...
-- NetCDF Fortran library dependencies: ****
-- Checking Whether the NetCDF4 chunking constants are available
-- Checking Whether the NetCDF4 chunking constants are available - yes
-- Disabling support for PnetCDF

Chrysalis

-- Found NetCDF_Fortran: /gpfs/fs1/soft/chrysalis/spack/opt/spack/linux-centos8-x86_64/intel-20.0.4/netcdf-fortran-4.4.4-tplolxh/lib/libnetcdff.so  
-- NetCDF Fortran library dependencies: ****
-- Disabling support for PnetCDF

That is, the expected messages "Checking Whether the NetCDF4 chunking constants ..." are not shown on Chrysalis.

jayeshkrishna commented 10 months ago

The current configure checks only enable NetCDF4 if NetCDF4 parallel I/O is available. Since chrysalis does not support parallel I/O for NetCDF (netcdf_par.h is missing in the Fortran include dir) the chunking const check is not run too. This check (for checking NetCDF parallel I/O support) needs to be fixed in future. So the difference in behavior between the machines is not due to changes in this PR.