From 2987785d53387663c9fd6a2cb3be6f3d1f8ef5f7 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 05:25:38 -0600 Subject: [PATCH 01/16] turning on ncint --- .github/workflows/a4.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/a4.yml b/.github/workflows/a4.yml index 7259530c24e..9056472aade 100644 --- a/.github/workflows/a4.yml +++ b/.github/workflows/a4.yml @@ -124,6 +124,6 @@ jobs: source .bashrc export CC=/home/runner/mpich/bin/mpicc autoreconf -i - ./configure + ./configure --enable-netcdf-integration make -j check From e9f4f755d962418d4613b498b596a393e59a5119 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 06:01:37 -0600 Subject: [PATCH 02/16] starting to add ftst_vars.F90 --- configure.ac | 1 + tests/unit/Makefile.am | 6 +++-- tests/unit/basic_tests.F90 | 1 + tests/unit/driver.F90 | 1 + tests/unit/ftst_vars.F90 | 23 ++++++++++++++++++++ tests/unit/global_vars.F90 | 1 + tests/unit/ncdf_tests.F90 | 1 + tests/unit/{run_tests.sh => run_tests.sh.in} | 4 ++-- 8 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 tests/unit/ftst_vars.F90 rename tests/unit/{run_tests.sh => run_tests.sh.in} (82%) diff --git a/configure.ac b/configure.ac index 429a14e1e9d..ec0262495f9 100644 --- a/configure.ac +++ b/configure.ac @@ -403,6 +403,7 @@ AC_CONFIG_FILES([tests/general/pio_tutil.F90:tests/general/util/pio_tutil.F90]) AC_CONFIG_FILES([tests/cunit/run_tests.sh], [chmod ugo+x tests/cunit/run_tests.sh]) AC_CONFIG_FILES([tests/ncint/run_tests.sh], [chmod ugo+x tests/ncint/run_tests.sh]) AC_CONFIG_FILES([tests/ncint/run_perf.sh], [chmod ugo+x tests/ncint/run_perf.sh]) +AC_CONFIG_FILES([tests/unit/run_tests.sh], [chmod ugo+x tests/unit/run_tests.sh]) AC_CONFIG_FILES([examples/c/run_tests.sh], [chmod ugo+x examples/c/run_tests.sh]) # Args: diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 1eaea6e77b3..b1ac4dd39e7 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -10,10 +10,12 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/flib # Build the test for make check. -check_PROGRAMS = pio_unit_test_driver +check_PROGRAMS = pio_unit_test_driver ftst_vars pio_unit_test_driver_SOURCES = driver.F90 pio_unit_test_driver_LDADD = libglobal_vars.la libncdf_tests.la \ -libbasic_tests.la ${top_builddir}/src/flib/libpiof.la ${top_builddir}/src/clib/libpioc.la +libbasic_tests.la ${top_builddir}/src/flib/libpiof.la \ +${top_builddir}/src/clib/libpioc.la +ftst_vars_SOURCES = ftst_vars.F90 # Build these uninstalled convenience libraries. noinst_LTLIBRARIES = libglobal_vars.la libncdf_tests.la \ diff --git a/tests/unit/basic_tests.F90 b/tests/unit/basic_tests.F90 index e48c99a9047..b9f72692be4 100644 --- a/tests/unit/basic_tests.F90 +++ b/tests/unit/basic_tests.F90 @@ -3,6 +3,7 @@ !! @brief Module containing basic unit tests that are run for both !! binary and netcdf file types. !< +#include "config.h" module basic_tests diff --git a/tests/unit/driver.F90 b/tests/unit/driver.F90 index 6764b875595..6c3975d9b47 100644 --- a/tests/unit/driver.F90 +++ b/tests/unit/driver.F90 @@ -2,6 +2,7 @@ !! @file !! @brief The driver for PIO unit tests !< +#include "config.h" Program pio_unit_test_driver use pio diff --git a/tests/unit/ftst_vars.F90 b/tests/unit/ftst_vars.F90 new file mode 100644 index 00000000000..335c8423f1a --- /dev/null +++ b/tests/unit/ftst_vars.F90 @@ -0,0 +1,23 @@ + ! This is a test of the PIO Fortran library. + + ! This tests var functions. + + ! Ed Hartnett, 8/28/20 +#include "config.h" + +program ftst_vars + use mpi + use pio + integer :: my_rank, ntasks + integer :: ierr + + ! Set up MPI + call MPI_Init(ierr) + call MPI_Comm_rank(MPI_COMM_WORLD, my_rank, ierr) + call MPI_Comm_size(MPI_COMM_WORLD, ntasks , ierr) + + if (my_rank .eq. 0) print *,'Testing variables...' + + if (my_rank .eq. 0) print *,'SUCCESS!' + call MPI_Finalize(ierr) +end program ftst_vars diff --git a/tests/unit/global_vars.F90 b/tests/unit/global_vars.F90 index f3347ba38c9..69cf0f412ac 100644 --- a/tests/unit/global_vars.F90 +++ b/tests/unit/global_vars.F90 @@ -2,6 +2,7 @@ !! @file !! @brief Module containing variables used across all unit test files !< +#include "config.h" module global_vars diff --git a/tests/unit/ncdf_tests.F90 b/tests/unit/ncdf_tests.F90 index 831a06d28fb..765132751e3 100644 --- a/tests/unit/ncdf_tests.F90 +++ b/tests/unit/ncdf_tests.F90 @@ -2,6 +2,7 @@ !! @file !! @brief Module containing netcdf-specific PIO unit tests !< +#include "config.h" module ncdf_tests diff --git a/tests/unit/run_tests.sh b/tests/unit/run_tests.sh.in similarity index 82% rename from tests/unit/run_tests.sh rename to tests/unit/run_tests.sh.in index 0f7c61ee178..aedce3635cf 100755 --- a/tests/unit/run_tests.sh +++ b/tests/unit/run_tests.sh.in @@ -10,14 +10,14 @@ trap exit INT TERM printf 'running PIO tests...\n' -PIO_TESTS='pio_unit_test_driver' +PIO_TESTS='pio_unit_test_driver ftst_vars' success1=true for TEST in $PIO_TESTS do success1=false echo "running ${TEST}" - mpiexec -n 4 ./${TEST} && success1=true + @WITH_MPIEXEC@ -n 4 ./${TEST} && success1=true if test $success1 = false; then break fi From 9d3ff03fa818cc48ae9ff610a7a6f94e60a930b8 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 06:12:21 -0600 Subject: [PATCH 03/16] added ftst_vars.F90 to CMake build --- tests/unit/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index eaf7c0f5694..7f146e2a14a 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -1,3 +1,6 @@ +# This is the CMake build file for the tests/unit tests of the PIO library. + +# Jim Edwards include (LibMPI) include_directories("${CMAKE_SOURCE_DIR}/tests/unit") @@ -35,6 +38,11 @@ endif () add_dependencies (tests pio_unit_test) +# Add ftst_vars.F90. +add_executable (ftst_vars EXCLUDE_FROM_ALL ftst_vars.F90) +target_link_libraries (ftst_vars piof) +add_dependencies (tests ftst_vars) + # Test Timeout in seconds. set (DEFAULT_TEST_TIMEOUT 60) @@ -55,6 +63,10 @@ else () EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/pio_unit_test NUMPROCS 4 TIMEOUT ${DEFAULT_TEST_TIMEOUT}) + add_mpi_test(ftst_vars + EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/ftst_vars + NUMPROCS 4 + TIMEOUT ${DEFAULT_TEST_TIMEOUT}) endif () if (PIO_HDF5_LOGGING) From 05ce8e39b8d8139bebce5de4e714845d98613b2c Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 06:44:43 -0600 Subject: [PATCH 04/16] added ftst_vars.F90 to CMake build --- .github/workflows/a4.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/a4.yml b/.github/workflows/a4.yml index 9056472aade..7259530c24e 100644 --- a/.github/workflows/a4.yml +++ b/.github/workflows/a4.yml @@ -124,6 +124,6 @@ jobs: source .bashrc export CC=/home/runner/mpich/bin/mpicc autoreconf -i - ./configure --enable-netcdf-integration + ./configure make -j check From cdc01a165ece26170606cebaa7d539f6a7082646 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 06:53:42 -0600 Subject: [PATCH 05/16] turn of netcdf integration in github workflow --- tests/unit/ftst_vars.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/ftst_vars.F90 b/tests/unit/ftst_vars.F90 index 335c8423f1a..c310f93f982 100644 --- a/tests/unit/ftst_vars.F90 +++ b/tests/unit/ftst_vars.F90 @@ -17,6 +17,8 @@ program ftst_vars call MPI_Comm_size(MPI_COMM_WORLD, ntasks , ierr) if (my_rank .eq. 0) print *,'Testing variables...' + + call PIO_ if (my_rank .eq. 0) print *,'SUCCESS!' call MPI_Finalize(ierr) From cbed9880c83ede81d8f9841be4bff4dd88e9640e Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 07:14:10 -0600 Subject: [PATCH 06/16] further test development --- tests/unit/Makefile.am | 9 ++++++++- tests/unit/ftst_vars.F90 | 30 ++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index b1ac4dd39e7..d1089fd607c 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -9,6 +9,10 @@ # Find the pio.mod file. AM_CPPFLAGS = -I$(top_srcdir)/src/flib +# Link to the PIO C and Fortran libraries. +LDADD = ${top_builddir}/src/flib/libpiof.la \ +${top_builddir}/src/clib/libpioc.la + # Build the test for make check. check_PROGRAMS = pio_unit_test_driver ftst_vars pio_unit_test_driver_SOURCES = driver.F90 @@ -32,7 +36,10 @@ TESTS = run_tests.sh endif # RUN_TESTS # Distribute the test script. -EXTRA_DIST = CMakeLists.txt run_tests.sh input.nl not_netcdf.ieee +EXTRA_DIST = CMakeLists.txt run_tests.sh input.nl not_netcdf.ieee \ +run_tests.sh.in # Clean up files produced during testing. CLEANFILES = *.nc *.log *.mod + +DISTCLEANFILES = run_tests.sh diff --git a/tests/unit/ftst_vars.F90 b/tests/unit/ftst_vars.F90 index c310f93f982..f56ed2d81fc 100644 --- a/tests/unit/ftst_vars.F90 +++ b/tests/unit/ftst_vars.F90 @@ -8,7 +8,13 @@ program ftst_vars use mpi use pio + + type(iosystem_desc_t) :: pio_iosystem + type(file_desc_t) :: pio_file integer :: my_rank, ntasks + integer :: niotasks = 1, stride = 1 + character(len=64) :: filename = 'ftst_vars.nc' + integer :: iotype = PIO_iotype_netcdf4c integer :: ierr ! Set up MPI @@ -18,8 +24,28 @@ program ftst_vars if (my_rank .eq. 0) print *,'Testing variables...' - call PIO_ - + ! Initialize PIO. + call PIO_init(my_rank, MPI_COMM_WORLD, niotasks, 0, stride, & + PIO_rearr_subset, pio_iosystem, base=1) + + ! Set error handling for test. + call PIO_seterrorhandling(pio_iosystem, PIO_RETURN_ERROR) + call PIO_seterrorhandling(PIO_DEFAULT, PIO_RETURN_ERROR) + + ! Create a file. + ierr = PIO_createfile(pio_iosystem, pio_file, iotype, filename) + if (ierr .ne. PIO_NOERR) stop 3 + + ! Close the file. + call PIO_closefile(pio_file) + + ! Open the file. + + + + ! Finalize PIO. + call PIO_finalize(pio_iosystem, ierr) + if (my_rank .eq. 0) print *,'SUCCESS!' call MPI_Finalize(ierr) end program ftst_vars From a54de425a4fd14c402e77e6e492efeb6b4798a23 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 07:52:17 -0600 Subject: [PATCH 07/16] further test development --- .github/workflows/a3.yml | 3 ++- tests/unit/ftst_vars.F90 | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/a3.yml b/.github/workflows/a3.yml index 6f326b86a3a..53121bb8acb 100644 --- a/.github/workflows/a3.yml +++ b/.github/workflows/a3.yml @@ -126,7 +126,7 @@ jobs: export CC=/home/runner/openmpi/bin/mpicc autoreconf -i ./configure --with-mpiexec='mpiexec --oversubscribe' - which mpiexec + cat config.h make check - name: cmake build run: | @@ -138,6 +138,7 @@ jobs: cd build export LD_LIBRARY_PATH="/home/runner/netcdf-c/lib:/home/runner/pnetcdf/lib:/home/runner/hdf5/lib:/home/runner/openmpi/lib:$LD_LIBRARY_PATH" cmake -Wno-dev -DWITH_MPIEXEC='/home/runner/openmpi/bin/mpiexec;--oversubscribe' -DNetCDF_C_LIBRARY=/home/runner/netcdf-c/lib/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/home/runner/netcdf-c/include -DPnetCDF_PATH='/home/runner/pnetcdf' -DPIO_ENABLE_FORTRAN=Off -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off .. || (cat CMakeFiles/CMakeOutput.log && cat CMakeFiles/CMakeError.log) + cat config.h make VERBOSE=1 make tests VERBOSE=1 ctest -VV diff --git a/tests/unit/ftst_vars.F90 b/tests/unit/ftst_vars.F90 index f56ed2d81fc..a9f0a755011 100644 --- a/tests/unit/ftst_vars.F90 +++ b/tests/unit/ftst_vars.F90 @@ -10,11 +10,15 @@ program ftst_vars use pio type(iosystem_desc_t) :: pio_iosystem - type(file_desc_t) :: pio_file + type(file_desc_t) :: pio_file + type(var_desc_t) :: pio_var integer :: my_rank, ntasks integer :: niotasks = 1, stride = 1 character(len=64) :: filename = 'ftst_vars.nc' + character(len=64) :: dim_name = 'influence_on_Roman_history' + character(len=64) :: var_name = 'Caesar' integer :: iotype = PIO_iotype_netcdf4c + integer :: dimid, dim_len = 4 integer :: ierr ! Set up MPI @@ -36,12 +40,23 @@ program ftst_vars ierr = PIO_createfile(pio_iosystem, pio_file, iotype, filename) if (ierr .ne. PIO_NOERR) stop 3 + ! Define a dim. + ret_val = PIO_def_dim(pio_file, dim_name, dim_len, dimid) + if (ierr .ne. PIO_NOERR) stop 5 + + ! Define a var. + ret_val = PIO_def_var(pio_file, var_name, PIO_int, (/dimid/), pio_var) + if (ierr .ne. PIO_NOERR) stop 7 + ! Close the file. call PIO_closefile(pio_file) ! Open the file. + ret_val = PIO_openfile(pio_iosystem, pio_file, iotype, filename, PIO_nowrite) + if (ierr .ne. PIO_NOERR) stop 3 - + ! Close the file. + call PIO_closefile(pio_file) ! Finalize PIO. call PIO_finalize(pio_iosystem, ierr) From f114fbc321093bd2fba6c4f18c01c4595bdf573c Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 07:57:50 -0600 Subject: [PATCH 08/16] further test development --- tests/unit/ftst_vars.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/unit/ftst_vars.F90 b/tests/unit/ftst_vars.F90 index a9f0a755011..f754efd7d40 100644 --- a/tests/unit/ftst_vars.F90 +++ b/tests/unit/ftst_vars.F90 @@ -25,7 +25,8 @@ program ftst_vars call MPI_Init(ierr) call MPI_Comm_rank(MPI_COMM_WORLD, my_rank, ierr) call MPI_Comm_size(MPI_COMM_WORLD, ntasks , ierr) - + +#ifdef _NETCDF4 if (my_rank .eq. 0) print *,'Testing variables...' ! Initialize PIO. @@ -53,7 +54,9 @@ program ftst_vars ! Open the file. ret_val = PIO_openfile(pio_iosystem, pio_file, iotype, filename, PIO_nowrite) - if (ierr .ne. PIO_NOERR) stop 3 + if (ierr .ne. PIO_NOERR) stop 23 + + ! Find var chunksizes. ! Close the file. call PIO_closefile(pio_file) @@ -62,5 +65,6 @@ program ftst_vars call PIO_finalize(pio_iosystem, ierr) if (my_rank .eq. 0) print *,'SUCCESS!' +#endif call MPI_Finalize(ierr) end program ftst_vars From 66754676c65356249df006dac7645c6030232581 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 08:24:46 -0600 Subject: [PATCH 09/16] more test development --- src/flib/pio_nf.F90 | 2 +- tests/unit/ftst_vars.F90 | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/flib/pio_nf.F90 b/src/flib/pio_nf.F90 index a8352b294b2..ed32fc23903 100644 --- a/src/flib/pio_nf.F90 +++ b/src/flib/pio_nf.F90 @@ -1725,7 +1725,7 @@ end function PIOc_def_var_chunking end interface ndims = size(chunksizes) do i=1,ndims - cchunksizes(i) = chunksizes(ndims-i+1)-1 + cchunksizes(i) = chunksizes(ndims-i+1) enddo ierr = PIOc_def_var_chunking(file%fh, vardesc%varid-1, storage, cchunksizes) diff --git a/tests/unit/ftst_vars.F90 b/tests/unit/ftst_vars.F90 index f754efd7d40..b152116d7aa 100644 --- a/tests/unit/ftst_vars.F90 +++ b/tests/unit/ftst_vars.F90 @@ -8,6 +8,7 @@ program ftst_vars use mpi use pio + use pio_nf type(iosystem_desc_t) :: pio_iosystem type(file_desc_t) :: pio_file @@ -18,7 +19,8 @@ program ftst_vars character(len=64) :: dim_name = 'influence_on_Roman_history' character(len=64) :: var_name = 'Caesar' integer :: iotype = PIO_iotype_netcdf4c - integer :: dimid, dim_len = 4 + integer :: dimid, dim_len = 40 + integer :: chunksize = 10 integer :: ierr ! Set up MPI @@ -26,6 +28,8 @@ program ftst_vars call MPI_Comm_rank(MPI_COMM_WORLD, my_rank, ierr) call MPI_Comm_size(MPI_COMM_WORLD, ntasks , ierr) + ! This whole test only works for netCDF/HDF5 files, because it is + ! about chunking. #ifdef _NETCDF4 if (my_rank .eq. 0) print *,'Testing variables...' @@ -49,6 +53,10 @@ program ftst_vars ret_val = PIO_def_var(pio_file, var_name, PIO_int, (/dimid/), pio_var) if (ierr .ne. PIO_NOERR) stop 7 + ! Define chunking for var. + ret_val = PIO_def_var_chunking(pio_file, pio_var, 0, (/chunksize/)) + if (ierr .ne. PIO_NOERR) stop 9 + ! Close the file. call PIO_closefile(pio_file) From 5c2ae6522b8b2fdfa3ca3de458436c1effe5ca55 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 08:47:12 -0600 Subject: [PATCH 10/16] adding pio_inq_var_chunking --- src/flib/pio_nf.F90 | 72 ++++++++++++++++++++++++++++++++++++++++ tests/unit/ftst_vars.F90 | 1 + 2 files changed, 73 insertions(+) diff --git a/src/flib/pio_nf.F90 b/src/flib/pio_nf.F90 index ed32fc23903..262fb000a8d 100644 --- a/src/flib/pio_nf.F90 +++ b/src/flib/pio_nf.F90 @@ -61,6 +61,7 @@ module pio_nf pio_inq_vardimid , & pio_inq_varnatts , & pio_inq_var_deflate , & + pio_inq_var_chunking , & pio_inquire_variable , & pio_inquire_dimension , & pio_inq_dimname , & @@ -156,6 +157,12 @@ module pio_nf inq_var_deflate_vid , & inq_var_deflate_id end interface pio_inq_var_deflate + interface pio_inq_var_chunking + module procedure & + inq_var_chunking_desc , & + inq_var_chunking_vid , & + inq_var_chunking_id + end interface pio_inq_var_chunking interface pio_inquire_dimension module procedure & inquire_dimension_desc , & @@ -1242,6 +1249,71 @@ end function PIOc_inq_var_deflate ierr = PIOc_inq_var_deflate(ncid, varid-1, shuffle, deflate, deflate_level) end function inq_var_deflate_id + !> + !! @public + !! @ingroup PIO_inquire_variable + !! Gets metadata information for netcdf file. + !! + !! @param File @copydoc file_desc_t + !! @param vardesc @copydoc var_desc_t + !! @param shuffle Value of shuffle + !! @param deflate Status of deflate + !! @param deflate_level Level of deflate + !! @retval ierr @copydoc error_return + !! @author Ed Hartnett + !< + integer function inq_var_chunking_desc(File, vardesc, storage, chunksizes) result(ierr) + + type (File_desc_t), intent(in) :: File + type (Var_desc_t), intent(in) :: vardesc + integer, intent(out) :: storage + integer (kind=PIO_OFFSET_KIND), intent(out) :: chunksizes(*) + + ierr = pio_inq_var_chunking(File%fh, vardesc%varid, storage, chunksizes) + end function inq_var_chunking_desc + + !> + !! @public + !! @ingroup PIO_inquire_variable + !! Gets metadata information for netcdf file. + !! @author Ed Hartnett + !< + integer function inq_var_chunking_vid(File, varid, storage, chunksizes) result(ierr) + + type (File_desc_t), intent(in) :: File + integer, intent(in) :: varid + integer, intent(out) :: storage + integer (kind=PIO_OFFSET_KIND), intent(out) :: chunksizes(*) + + ierr = pio_inq_var_chunking(File%fh, varid, storage, chunksizes) + end function inq_var_chunking_vid + + !> + !! @public + !! @ingroup PIO_inquire_variable + !! Gets metadata information for netcdf file. + !! @author Ed Hartnett + !< + integer function inq_var_chunking_id(ncid, varid, storage, chunksizes) result(ierr) + integer, intent(in) :: ncid + integer, intent(in) :: varid + integer, intent(out) :: storage + integer (kind=PIO_OFFSET_KIND), intent(out) :: chunksizes(*) + + interface + integer(C_INT) function PIOc_inq_var_chunking(ncid, varid, storage, chunksizes) & + bind(C, name="PIOc_inq_var_chunking") + use iso_c_binding + integer(C_INT), value :: ncid + integer(C_INT), value :: varid + integer(C_INT) :: storage + integer(C_SIZE_T) :: chunksizes(*) + end function PIOc_inq_var_chunking + end interface + + ierr = PIOc_inq_var_chunking(ncid, varid-1, storage, chunksizes) + end function inq_var_chunking_id + !> !! @public !! @ingroup PIO_inquire_variable diff --git a/tests/unit/ftst_vars.F90 b/tests/unit/ftst_vars.F90 index b152116d7aa..cae52c282bc 100644 --- a/tests/unit/ftst_vars.F90 +++ b/tests/unit/ftst_vars.F90 @@ -65,6 +65,7 @@ program ftst_vars if (ierr .ne. PIO_NOERR) stop 23 ! Find var chunksizes. + ! Close the file. call PIO_closefile(pio_file) From 5ff984444cb9eb0c920ebc4fa3c3e1400856d295 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 09:46:26 -0600 Subject: [PATCH 11/16] fixed docs --- src/flib/pio_nf.F90 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/flib/pio_nf.F90 b/src/flib/pio_nf.F90 index 262fb000a8d..287209e1c93 100644 --- a/src/flib/pio_nf.F90 +++ b/src/flib/pio_nf.F90 @@ -1256,9 +1256,8 @@ end function inq_var_deflate_id !! !! @param File @copydoc file_desc_t !! @param vardesc @copydoc var_desc_t - !! @param shuffle Value of shuffle - !! @param deflate Status of deflate - !! @param deflate_level Level of deflate + !! @param storage 0 for chunked, 1 for contiguous + !! @param chunksizes Array of chunk sizes. !! @retval ierr @copydoc error_return !! @author Ed Hartnett !< From f1e58bd7f6e076959a4740763d473d6fd5faa8da Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 10:26:11 -0600 Subject: [PATCH 12/16] renamed test --- tests/unit/CMakeLists.txt | 10 ++-- tests/unit/Makefile.am | 4 +- tests/unit/ftst_vars.F90 | 79 --------------------------- tests/unit/ftst_vars_chunking.F90 | 88 +++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 86 deletions(-) delete mode 100644 tests/unit/ftst_vars.F90 create mode 100644 tests/unit/ftst_vars_chunking.F90 diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 7f146e2a14a..27298336b54 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -39,9 +39,9 @@ endif () add_dependencies (tests pio_unit_test) # Add ftst_vars.F90. -add_executable (ftst_vars EXCLUDE_FROM_ALL ftst_vars.F90) -target_link_libraries (ftst_vars piof) -add_dependencies (tests ftst_vars) +add_executable (ftst_vars_chunking EXCLUDE_FROM_ALL ftst_vars_chunking.F90) +target_link_libraries (ftst_vars_chunking piof) +add_dependencies (tests ftst_vars_chunking) # Test Timeout in seconds. set (DEFAULT_TEST_TIMEOUT 60) @@ -63,8 +63,8 @@ else () EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/pio_unit_test NUMPROCS 4 TIMEOUT ${DEFAULT_TEST_TIMEOUT}) - add_mpi_test(ftst_vars - EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/ftst_vars + add_mpi_test(ftst_vars_chunking + EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/ftst_vars_chunking NUMPROCS 4 TIMEOUT ${DEFAULT_TEST_TIMEOUT}) endif () diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index d1089fd607c..867857ef97e 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -14,12 +14,12 @@ LDADD = ${top_builddir}/src/flib/libpiof.la \ ${top_builddir}/src/clib/libpioc.la # Build the test for make check. -check_PROGRAMS = pio_unit_test_driver ftst_vars +check_PROGRAMS = pio_unit_test_driver ftst_vars_chunking pio_unit_test_driver_SOURCES = driver.F90 pio_unit_test_driver_LDADD = libglobal_vars.la libncdf_tests.la \ libbasic_tests.la ${top_builddir}/src/flib/libpiof.la \ ${top_builddir}/src/clib/libpioc.la -ftst_vars_SOURCES = ftst_vars.F90 +ftst_vars_chunking_SOURCES = ftst_vars_chunking.F90 # Build these uninstalled convenience libraries. noinst_LTLIBRARIES = libglobal_vars.la libncdf_tests.la \ diff --git a/tests/unit/ftst_vars.F90 b/tests/unit/ftst_vars.F90 deleted file mode 100644 index cae52c282bc..00000000000 --- a/tests/unit/ftst_vars.F90 +++ /dev/null @@ -1,79 +0,0 @@ - ! This is a test of the PIO Fortran library. - - ! This tests var functions. - - ! Ed Hartnett, 8/28/20 -#include "config.h" - -program ftst_vars - use mpi - use pio - use pio_nf - - type(iosystem_desc_t) :: pio_iosystem - type(file_desc_t) :: pio_file - type(var_desc_t) :: pio_var - integer :: my_rank, ntasks - integer :: niotasks = 1, stride = 1 - character(len=64) :: filename = 'ftst_vars.nc' - character(len=64) :: dim_name = 'influence_on_Roman_history' - character(len=64) :: var_name = 'Caesar' - integer :: iotype = PIO_iotype_netcdf4c - integer :: dimid, dim_len = 40 - integer :: chunksize = 10 - integer :: ierr - - ! Set up MPI - call MPI_Init(ierr) - call MPI_Comm_rank(MPI_COMM_WORLD, my_rank, ierr) - call MPI_Comm_size(MPI_COMM_WORLD, ntasks , ierr) - - ! This whole test only works for netCDF/HDF5 files, because it is - ! about chunking. -#ifdef _NETCDF4 - if (my_rank .eq. 0) print *,'Testing variables...' - - ! Initialize PIO. - call PIO_init(my_rank, MPI_COMM_WORLD, niotasks, 0, stride, & - PIO_rearr_subset, pio_iosystem, base=1) - - ! Set error handling for test. - call PIO_seterrorhandling(pio_iosystem, PIO_RETURN_ERROR) - call PIO_seterrorhandling(PIO_DEFAULT, PIO_RETURN_ERROR) - - ! Create a file. - ierr = PIO_createfile(pio_iosystem, pio_file, iotype, filename) - if (ierr .ne. PIO_NOERR) stop 3 - - ! Define a dim. - ret_val = PIO_def_dim(pio_file, dim_name, dim_len, dimid) - if (ierr .ne. PIO_NOERR) stop 5 - - ! Define a var. - ret_val = PIO_def_var(pio_file, var_name, PIO_int, (/dimid/), pio_var) - if (ierr .ne. PIO_NOERR) stop 7 - - ! Define chunking for var. - ret_val = PIO_def_var_chunking(pio_file, pio_var, 0, (/chunksize/)) - if (ierr .ne. PIO_NOERR) stop 9 - - ! Close the file. - call PIO_closefile(pio_file) - - ! Open the file. - ret_val = PIO_openfile(pio_iosystem, pio_file, iotype, filename, PIO_nowrite) - if (ierr .ne. PIO_NOERR) stop 23 - - ! Find var chunksizes. - - - ! Close the file. - call PIO_closefile(pio_file) - - ! Finalize PIO. - call PIO_finalize(pio_iosystem, ierr) - - if (my_rank .eq. 0) print *,'SUCCESS!' -#endif - call MPI_Finalize(ierr) -end program ftst_vars diff --git a/tests/unit/ftst_vars_chunking.F90 b/tests/unit/ftst_vars_chunking.F90 new file mode 100644 index 00000000000..8d65af45642 --- /dev/null +++ b/tests/unit/ftst_vars_chunking.F90 @@ -0,0 +1,88 @@ + ! This is a test of the PIO Fortran library. + + ! This tests var functions. + + ! Ed Hartnett, 8/28/20 +#include "config.h" + +program ftst_vars + use mpi + use pio + use pio_nf + + type(iosystem_desc_t) :: pio_iosystem + type(file_desc_t) :: pio_file + type(var_desc_t) :: pio_var + integer :: my_rank, ntasks + integer :: niotasks = 1, stride = 1 + character(len=64) :: filename = 'ftst_vars.nc' + character(len=64) :: dim_name = 'influence_on_Roman_history' + character(len=64) :: var_name = 'Caesar' + integer :: dimid, dim_len = 40 + integer :: chunksize = 10 + integer :: storage_in + integer (kind=PIO_OFFSET_KIND) :: chunksizes_in(2) + integer, parameter :: NUM_IOTYPES = 2 + integer :: iotype(NUM_IOTYPES) = (/ PIO_iotype_netcdf4c, PIO_iotype_netcdf4p /) + integer :: iotype_idx, ierr + + ! Set up MPI + call MPI_Init(ierr) + call MPI_Comm_rank(MPI_COMM_WORLD, my_rank, ierr) + call MPI_Comm_size(MPI_COMM_WORLD, ntasks , ierr) + + ! This whole test only works for netCDF/HDF5 files, because it is + ! about chunking. +#ifdef _NETCDF4 + if (my_rank .eq. 0) print *,'Testing variables...' + + ! Initialize PIO. + call PIO_init(my_rank, MPI_COMM_WORLD, niotasks, 0, stride, & + PIO_rearr_subset, pio_iosystem, base=1) + + ! Set error handling for test. + call PIO_seterrorhandling(pio_iosystem, PIO_RETURN_ERROR) + call PIO_seterrorhandling(PIO_DEFAULT, PIO_RETURN_ERROR) + + !ret_val = PIO_set_log_level(3) + do iotype_idx = 1, NUM_IOTYPES + ! Create a file. + ierr = PIO_createfile(pio_iosystem, pio_file, iotype(iotype_idx), filename) + if (ierr .ne. PIO_NOERR) stop 3 + + ! Define a dim. + ret_val = PIO_def_dim(pio_file, dim_name, dim_len, dimid) + if (ierr .ne. PIO_NOERR) stop 5 + + ! Define a var. + ret_val = PIO_def_var(pio_file, var_name, PIO_int, (/dimid/), pio_var) + if (ierr .ne. PIO_NOERR) stop 7 + + ! Define chunking for var. + ret_val = PIO_def_var_chunking(pio_file, pio_var, 0, (/chunksize/)) + if (ierr .ne. PIO_NOERR) stop 9 + + ! Close the file. + call PIO_closefile(pio_file) + + ! Open the file. + ret_val = PIO_openfile(pio_iosystem, pio_file, iotype(iotype_idx), filename, PIO_nowrite) + if (ierr .ne. PIO_NOERR) stop 23 + + ! Find var chunksizes. + ret_val = PIO_inq_var_chunking(pio_file, 1, storage_in, chunksizes_in) + if (ierr .ne. PIO_NOERR) stop 25 + if (chunksizes_in(1) .ne. chunksize) stop 26 + + ! Close the file. + call PIO_closefile(pio_file) + + end do + + ! Finalize PIO. + call PIO_finalize(pio_iosystem, ierr) + + if (my_rank .eq. 0) print *,'SUCCESS!' +#endif + call MPI_Finalize(ierr) +end program ftst_vars From 13cb7c7fe086f26071c794a36488b33dffae1c00 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 10:38:43 -0600 Subject: [PATCH 13/16] fixed shell script with new test name --- tests/unit/run_tests.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/run_tests.sh.in b/tests/unit/run_tests.sh.in index aedce3635cf..77511ff974a 100755 --- a/tests/unit/run_tests.sh.in +++ b/tests/unit/run_tests.sh.in @@ -10,7 +10,7 @@ trap exit INT TERM printf 'running PIO tests...\n' -PIO_TESTS='pio_unit_test_driver ftst_vars' +PIO_TESTS='pio_unit_test_driver ftst_vars_chunking' success1=true for TEST in $PIO_TESTS From e37d19ae22a56c141452ba34a73d2391bc5116ca Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 10:52:02 -0600 Subject: [PATCH 14/16] fixed chunksizes type size error in F90 api --- src/flib/pio_nf.F90 | 10 ++++---- tests/unit/ftst_vars_chunking.F90 | 41 +++++++++++++++++++------------ 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/flib/pio_nf.F90 b/src/flib/pio_nf.F90 index 287209e1c93..e3998a88067 100644 --- a/src/flib/pio_nf.F90 +++ b/src/flib/pio_nf.F90 @@ -93,7 +93,7 @@ module pio_nf end interface pio_def_var_deflate interface pio_def_var_chunking module procedure & - def_var_chunking + def_var_chunking_desc end interface pio_def_var_chunking interface pio_inq_attname module procedure & @@ -1776,12 +1776,12 @@ end function def_var_deflate_desc !! Changes chunking settings for a netCDF-4/HDF5 variable. !! @author Ed Hartnett !< - integer function def_var_chunking(file, vardesc, storage, chunksizes) result(ierr) + integer function def_var_chunking_desc(file, vardesc, storage, chunksizes) result(ierr) type (File_desc_t), intent(in) :: file type (var_desc_t), intent(in) :: vardesc integer, intent(in) :: storage integer, intent(in) :: chunksizes(:) - integer(C_INT) :: cchunksizes(PIO_MAX_VAR_DIMS) + integer(kind=PIO_OFFSET_KIND) :: cchunksizes(PIO_MAX_VAR_DIMS) integer :: ndims, i interface @@ -1791,7 +1791,7 @@ integer (C_INT) function PIOc_def_var_chunking(ncid, varid, storage, chunksizes) integer(c_int), value :: ncid integer(c_int), value :: varid integer(c_int), value :: storage - integer(c_int) :: chunksizes(*) + integer(c_size_t) :: chunksizes(*) end function PIOc_def_var_chunking end interface ndims = size(chunksizes) @@ -1800,7 +1800,7 @@ end function PIOc_def_var_chunking enddo ierr = PIOc_def_var_chunking(file%fh, vardesc%varid-1, storage, cchunksizes) - end function def_var_chunking + end function def_var_chunking_desc !> !! @ingroup PIO_set_chunk_cache diff --git a/tests/unit/ftst_vars_chunking.F90 b/tests/unit/ftst_vars_chunking.F90 index 8d65af45642..06b2cfe2023 100644 --- a/tests/unit/ftst_vars_chunking.F90 +++ b/tests/unit/ftst_vars_chunking.F90 @@ -5,24 +5,27 @@ ! Ed Hartnett, 8/28/20 #include "config.h" -program ftst_vars +program ftst_vars_chunking use mpi use pio use pio_nf + integer, parameter :: NUM_IOTYPES = 2 + integer, parameter :: NDIM2 = 2 + type(iosystem_desc_t) :: pio_iosystem type(file_desc_t) :: pio_file type(var_desc_t) :: pio_var integer :: my_rank, ntasks integer :: niotasks = 1, stride = 1 - character(len=64) :: filename = 'ftst_vars.nc' - character(len=64) :: dim_name = 'influence_on_Roman_history' + character(len=64) :: filename = 'ftst_vars_chunking.nc' + character(len=64) :: dim_name_1 = 'influence_on_Roman_history' + character(len=64) :: dim_name_2 = 'age_at_death' character(len=64) :: var_name = 'Caesar' - integer :: dimid, dim_len = 40 + integer :: dimid1, dimid2, dim_len = 40 integer :: chunksize = 10 integer :: storage_in - integer (kind=PIO_OFFSET_KIND) :: chunksizes_in(2) - integer, parameter :: NUM_IOTYPES = 2 + integer (kind=PIO_OFFSET_KIND) :: chunksizes_in(NDIM2) integer :: iotype(NUM_IOTYPES) = (/ PIO_iotype_netcdf4c, PIO_iotype_netcdf4p /) integer :: iotype_idx, ierr @@ -44,22 +47,28 @@ program ftst_vars call PIO_seterrorhandling(pio_iosystem, PIO_RETURN_ERROR) call PIO_seterrorhandling(PIO_DEFAULT, PIO_RETURN_ERROR) + ! Uncomment (and build with --enable-logging) to turn on logging. !ret_val = PIO_set_log_level(3) + + ! Try this test for NETCDF4C and NETCDF4P. do iotype_idx = 1, NUM_IOTYPES + ! Create a file. ierr = PIO_createfile(pio_iosystem, pio_file, iotype(iotype_idx), filename) if (ierr .ne. PIO_NOERR) stop 3 - ! Define a dim. - ret_val = PIO_def_dim(pio_file, dim_name, dim_len, dimid) + ! Define dims. + ret_val = PIO_def_dim(pio_file, dim_name_1, dim_len, dimid1) if (ierr .ne. PIO_NOERR) stop 5 + ret_val = PIO_def_dim(pio_file, dim_name_2, dim_len, dimid2) + if (ierr .ne. PIO_NOERR) stop 6 ! Define a var. - ret_val = PIO_def_var(pio_file, var_name, PIO_int, (/dimid/), pio_var) + ret_val = PIO_def_var(pio_file, var_name, PIO_int, (/dimid1, dimid2/), pio_var) if (ierr .ne. PIO_NOERR) stop 7 ! Define chunking for var. - ret_val = PIO_def_var_chunking(pio_file, pio_var, 0, (/chunksize/)) + ret_val = PIO_def_var_chunking(pio_file, pio_var, 0, (/chunksize, chunksize/)) if (ierr .ne. PIO_NOERR) stop 9 ! Close the file. @@ -69,15 +78,15 @@ program ftst_vars ret_val = PIO_openfile(pio_iosystem, pio_file, iotype(iotype_idx), filename, PIO_nowrite) if (ierr .ne. PIO_NOERR) stop 23 - ! Find var chunksizes. - ret_val = PIO_inq_var_chunking(pio_file, 1, storage_in, chunksizes_in) - if (ierr .ne. PIO_NOERR) stop 25 - if (chunksizes_in(1) .ne. chunksize) stop 26 + ! ! Find var chunksizes. + ! ret_val = PIO_inq_var_chunking(pio_file, 1, storage_in, chunksizes_in) + ! if (ierr .ne. PIO_NOERR) stop 25 + ! if (chunksizes_in(1) .ne. chunksize) stop 26 ! Close the file. call PIO_closefile(pio_file) - end do + end do ! next IOTYPE ! Finalize PIO. call PIO_finalize(pio_iosystem, ierr) @@ -85,4 +94,4 @@ program ftst_vars if (my_rank .eq. 0) print *,'SUCCESS!' #endif call MPI_Finalize(ierr) -end program ftst_vars +end program ftst_vars_chunking From 15a191b5564f0a6ed890b97d53acc2fd956c7083 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 11:04:41 -0600 Subject: [PATCH 15/16] fixing order of chunksizes --- src/flib/pio_nf.F90 | 13 ++++++++++--- tests/unit/ftst_vars_chunking.F90 | 17 +++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/flib/pio_nf.F90 b/src/flib/pio_nf.F90 index e3998a88067..459a6355d01 100644 --- a/src/flib/pio_nf.F90 +++ b/src/flib/pio_nf.F90 @@ -1298,19 +1298,26 @@ integer function inq_var_chunking_id(ncid, varid, storage, chunksizes) result(ie integer, intent(in) :: varid integer, intent(out) :: storage integer (kind=PIO_OFFSET_KIND), intent(out) :: chunksizes(*) + integer(kind=PIO_OFFSET_KIND) :: cchunksizes(PIO_MAX_VAR_DIMS) + integer :: ndims, i interface - integer(C_INT) function PIOc_inq_var_chunking(ncid, varid, storage, chunksizes) & + integer(C_INT) function PIOc_inq_var_chunking(ncid, varid, storage, cchunksizes) & bind(C, name="PIOc_inq_var_chunking") use iso_c_binding integer(C_INT), value :: ncid integer(C_INT), value :: varid integer(C_INT) :: storage - integer(C_SIZE_T) :: chunksizes(*) + integer(C_SIZE_T) :: cchunksizes(*) end function PIOc_inq_var_chunking end interface - ierr = PIOc_inq_var_chunking(ncid, varid-1, storage, chunksizes) + ierr = PIOc_inq_var_chunking(ncid, varid-1, storage, cchunksizes) + ierr = pio_inq_varndims(ncid, varid, ndims) + do i = 1, ndims + chunksizes(i) = cchunksizes(ndims - i + 1) + enddo + end function inq_var_chunking_id !> diff --git a/tests/unit/ftst_vars_chunking.F90 b/tests/unit/ftst_vars_chunking.F90 index 06b2cfe2023..2d5864f962d 100644 --- a/tests/unit/ftst_vars_chunking.F90 +++ b/tests/unit/ftst_vars_chunking.F90 @@ -22,8 +22,8 @@ program ftst_vars_chunking character(len=64) :: dim_name_1 = 'influence_on_Roman_history' character(len=64) :: dim_name_2 = 'age_at_death' character(len=64) :: var_name = 'Caesar' - integer :: dimid1, dimid2, dim_len = 40 - integer :: chunksize = 10 + integer :: dimid1, dimid2, dim_len1 = 40, dim_len2 = 80 + integer :: chunksize1 = 10, chunksize2 = 20 integer :: storage_in integer (kind=PIO_OFFSET_KIND) :: chunksizes_in(NDIM2) integer :: iotype(NUM_IOTYPES) = (/ PIO_iotype_netcdf4c, PIO_iotype_netcdf4p /) @@ -58,9 +58,9 @@ program ftst_vars_chunking if (ierr .ne. PIO_NOERR) stop 3 ! Define dims. - ret_val = PIO_def_dim(pio_file, dim_name_1, dim_len, dimid1) + ret_val = PIO_def_dim(pio_file, dim_name_1, dim_len1, dimid1) if (ierr .ne. PIO_NOERR) stop 5 - ret_val = PIO_def_dim(pio_file, dim_name_2, dim_len, dimid2) + ret_val = PIO_def_dim(pio_file, dim_name_2, dim_len2, dimid2) if (ierr .ne. PIO_NOERR) stop 6 ! Define a var. @@ -68,7 +68,7 @@ program ftst_vars_chunking if (ierr .ne. PIO_NOERR) stop 7 ! Define chunking for var. - ret_val = PIO_def_var_chunking(pio_file, pio_var, 0, (/chunksize, chunksize/)) + ret_val = PIO_def_var_chunking(pio_file, pio_var, 0, (/chunksize1, chunksize2/)) if (ierr .ne. PIO_NOERR) stop 9 ! Close the file. @@ -79,9 +79,10 @@ program ftst_vars_chunking if (ierr .ne. PIO_NOERR) stop 23 ! ! Find var chunksizes. - ! ret_val = PIO_inq_var_chunking(pio_file, 1, storage_in, chunksizes_in) - ! if (ierr .ne. PIO_NOERR) stop 25 - ! if (chunksizes_in(1) .ne. chunksize) stop 26 + ret_val = PIO_inq_var_chunking(pio_file, 1, storage_in, chunksizes_in) + if (ierr .ne. PIO_NOERR) stop 25 + if (chunksizes_in(1) .ne. chunksize1) stop 26 + if (chunksizes_in(2) .ne. chunksize2) stop 26 ! Close the file. call PIO_closefile(pio_file) From eb23c9f03ca9813d96b8274c8ce3ac11dfe26c0c Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Fri, 28 Aug 2020 11:07:25 -0600 Subject: [PATCH 16/16] fixing order of chunksizes --- tests/unit/ftst_vars_chunking.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/ftst_vars_chunking.F90 b/tests/unit/ftst_vars_chunking.F90 index 2d5864f962d..af04112d5fa 100644 --- a/tests/unit/ftst_vars_chunking.F90 +++ b/tests/unit/ftst_vars_chunking.F90 @@ -78,12 +78,12 @@ program ftst_vars_chunking ret_val = PIO_openfile(pio_iosystem, pio_file, iotype(iotype_idx), filename, PIO_nowrite) if (ierr .ne. PIO_NOERR) stop 23 - ! ! Find var chunksizes. + ! Find var chunksizes using varid. ret_val = PIO_inq_var_chunking(pio_file, 1, storage_in, chunksizes_in) if (ierr .ne. PIO_NOERR) stop 25 if (chunksizes_in(1) .ne. chunksize1) stop 26 if (chunksizes_in(2) .ne. chunksize2) stop 26 - + ! Close the file. call PIO_closefile(pio_file)