Skip to content

Commit

Permalink
skip tests if hdf5 was not built with parallel features
Browse files Browse the repository at this point in the history
  • Loading branch information
uramirez8707 committed Feb 20, 2025
1 parent 354c60e commit 3ca55b3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
5 changes: 3 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,10 @@ AC_MSG_RESULT([$nc_has_parallel4])

if test $nc_has_parallel4 = no; then
AC_MSG_WARN(netCDF was not build with HDF5 parallel I/O features, so collective netcdf io is not allowed)
AM_CONDITIONAL([NO_NC_PARALLEL4], true)
AC_DEFINE([NO_NC_PARALLEL4], [1], [HDF5 parallel I/O features not allowed])
AM_CONDITIONAL([SKIP_PARALLEL_TEST], true)
else
AM_CONDITIONAL([NO_NC_PARALLEL4], false)
AM_CONDITIONAL([SKIP_PARALLEL_TEST], false)
fi

#####
Expand Down
2 changes: 1 addition & 1 deletion fms2_io/netcdf_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ function netcdf_file_open(fileobj, path, mode, nc_format, pelist, is_restart, do
err = nf90_open(trim(fileobj%path), nf90_nowrite, fileobj%ncid, chunksize=fms2_ncchksz)
else
#ifdef NO_NC_PARALLEL4
call mpp_error(FATAL, "netCDF was not build with HDF5 parallel I/O features, "//
call mpp_error(FATAL, "netCDF was not build with HDF5 parallel I/O features, "//&
"so collective netcdf io is not allowed")
#endif
endif
Expand Down
12 changes: 9 additions & 3 deletions test_fms/fms2_io/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,21 @@ TESTS = test_bc_restart.sh test_fms2_io.sh test_atmosphere_io.sh test_io_simple.
test_collective_io.sh

if SKIP_NCDUMP_CHECKS
skipflag="skip"
ncdump_skip="skip"
else
skipflag=""
ncdump_skip=""
endif

if SKIP_PARALLEL_TEST
parallel_skip="skip"
else
parallel_skip=""
endif

# Set srcdir as evironment variable to be reference in the job script
TEST_EXTENSIONS = .sh
SH_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(abs_top_srcdir)/test_fms/tap-driver.sh
TESTS_ENVIRONMENT = srcdir="$(abs_top_srcdir)" ncdump_skip=${skipflag}
TESTS_ENVIRONMENT = srcdir="$(abs_top_srcdir)" ncdump_skip=${ncdump_skip} parallel_skip=${parallel_skip}

CLEANFILES = *.mod *.nc *.nc.* input.nml logfile.000000.out the_mask ascii_test1 *.dpi *.spi *.dyn *.spl *-files/*
4 changes: 4 additions & 0 deletions test_fms/fms2_io/test_collective_io.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
# Set common test settings.
. ../test-lib.sh

if [ ! -z $parallel_skip ]; then
SKIP_TESTS='test_collective_io.[1]'
fi

# Create and enter output directory
output_dir

Expand Down

0 comments on commit 3ca55b3

Please sign in to comment.