From 50563b1b427b98d52350bcac3f9db830523ea93c Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 24 Feb 2025 13:33:08 -0700 Subject: [PATCH] Update PIO from pio2_6_2 to pio2_6_5 I did this update by simply copying the ParallelIO repository (checked out at pio2_6_5) to here, and then deleting the .git directory. I confirmed that, prior to this update, there were no diffs from the ParallelIO repository (at pio2_6_2), so it is safe to do the update in this simple manner. Changes here: pio2_6_3: Merge pull request #1982 from alperaltuntas/bugfix_debug - fix minor bugs in pio_nc4.c pio2_6_4: Bug fix release. Fixes issues with large datasets and with autoconf/cmake configure option. pio2_6_5: Updated for compatibility with netcdf-c 4.9.3 and cygwin. Resolves esmf-org/esmf#353 --- .../.github/actions/buildhdf5/action.yml | 5 +- .../.github/actions/buildmpich/action.yml | 2 +- .../.github/actions/buildnetcdf/action.yml | 2 +- .../.github/actions/buildnetcdff/action.yml | 2 +- .../.github/actions/buildopenmpi/action.yml | 2 +- .../.github/actions/buildpnetcdf/action.yml | 4 +- .../.github/actions/intelcompilers/action.yml | 20 ++- .../actions/parallelio_autotools/action.yml | 6 +- .../actions/parallelio_cmake/action.yml | 4 +- .../.github/workflows/autotools.yml | 4 +- .../ParallelIO/.github/workflows/cmake.yml | 2 +- .../.github/workflows/cmake_ubuntu_latest.yml | 4 +- .../ParallelIO/.github/workflows/intel.yml | 131 ------------------ .../netcdf_hdf5_no_pnetcdf_ncint_mpich.yml | 10 +- .../netcdf_hdf5_pnetcdf_ncint_mpich_asan.yml | 12 +- .../workflows/netcdf_pnetcdf_openmpi.yml | 12 +- .../strict_autotools_ubuntu_latest.yml | 4 +- .../.github/workflows/withspack.yml | 77 ---------- .../IO/PIO/ParallelIO/CMakeLists.txt | 28 ++-- .../IO/PIO/ParallelIO/configure.ac | 14 +- .../ParallelIO/doc/source/Introduction.txt | 2 +- .../ParallelIO/examples/basic/kinds_mod.F90 | 8 +- .../IO/PIO/ParallelIO/src/clib/CMakeLists.txt | 4 +- .../IO/PIO/ParallelIO/src/clib/pio.h | 3 + .../PIO/ParallelIO/src/clib/pio_darray_int.c | 32 +++-- .../IO/PIO/ParallelIO/src/clib/pio_nc.c | 8 +- .../IO/PIO/ParallelIO/src/clib/pio_nc4.c | 7 +- .../PIO/ParallelIO/src/clib/pio_rearrange.c | 22 +-- .../IO/PIO/ParallelIO/src/clib/pioc_support.c | 17 ++- .../IO/PIO/ParallelIO/src/flib/pio_nf.F90 | 10 +- .../IO/PIO/ParallelIO/src/flib/piolib_mod.F90 | 3 +- .../IO/PIO/ParallelIO/src/gptl/perf_utils.F90 | 8 +- 32 files changed, 142 insertions(+), 327 deletions(-) delete mode 100644 src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/intel.yml delete mode 100644 src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/withspack.yml diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildhdf5/action.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildhdf5/action.yml index 4ba086823b..b720886359 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildhdf5/action.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildhdf5/action.yml @@ -34,7 +34,7 @@ inputs: runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: HDFGroup/hdf5 path: hdf5-src @@ -50,7 +50,10 @@ runs: -DHDF5_ENABLE_PARALLEL=${{ inputs.enable_parallel }} \ -DHDF5_ENABLE_Z_LIB_SUPPORT=ON \ -DBUILD_TESTING=${{ inputs.enable_testing }} \ + -DHDF5_ENABLE_DEPRICATED_SYMBOLS=OFF \ + -DHDF5_BUILD_EXAMPLES=OFF \ -DHDF5_BUILD_TOOLS=OFF \ + -DCMAKE_BUILD_TYPE=REL \ ../ make make install diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildmpich/action.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildmpich/action.yml index 3437a6065f..6b18b3c44e 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildmpich/action.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildmpich/action.yml @@ -13,7 +13,7 @@ inputs: runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: pmodels/mpich path: mpich-src diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildnetcdf/action.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildnetcdf/action.yml index a7d168f657..709b05e5a1 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildnetcdf/action.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildnetcdf/action.yml @@ -45,7 +45,7 @@ inputs: runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: Unidata/netcdf-c path: netcdf-c-src diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildnetcdff/action.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildnetcdff/action.yml index 4063a11cb7..0388a3358c 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildnetcdff/action.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildnetcdff/action.yml @@ -19,7 +19,7 @@ inputs: runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: Unidata/netcdf-fortran path: netcdf-fortran-src diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildopenmpi/action.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildopenmpi/action.yml index f5f95fcf75..02cf3bf914 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildopenmpi/action.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildopenmpi/action.yml @@ -13,7 +13,7 @@ inputs: runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: open-mpi/ompi path: openmpi-src diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildpnetcdf/action.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildpnetcdf/action.yml index 43f2ad8c05..24210fbf45 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildpnetcdf/action.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/buildpnetcdf/action.yml @@ -2,7 +2,7 @@ description: 'Build the pnetcdf library' inputs: pnetcdf_version: description: 'Tag in the pnetcdf repository to use' - default: checkpoint.1.12.3 + default: checkpoint.1.14.0 required: False type: string install_prefix: @@ -23,7 +23,7 @@ inputs: runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: Parallel-NetCDF/PnetCDF path: pnetcdf-src diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/intelcompilers/action.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/intelcompilers/action.yml index 5f7c658d66..895d7ea404 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/intelcompilers/action.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/intelcompilers/action.yml @@ -2,22 +2,20 @@ description: 'Install Intel Compilers' runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: setup repo shell: bash run: | - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + #wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + # download the key to system keyring + wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + #sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + #rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list sudo apt-get update - name: install shell: bash run: | - sudo apt-get install -y intel-oneapi-common-vars - sudo apt-get install -y intel-oneapi-compiler-fortran - sudo apt-get install -y intel-oneapi-mkl - sudo apt-get install -y intel-oneapi-mpi - sudo apt-get install -y intel-oneapi-mpi-devel + sudo apt-get install intel-oneapi-hpc-toolkit source /opt/intel/oneapi/setvars.sh - printenv >> $GITHUB_ENV + source /opt/intel/oneapi/compiler/latest/env/vars.sh intel64 diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/parallelio_autotools/action.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/parallelio_autotools/action.yml index fd85ebe8af..4ef041708f 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/parallelio_autotools/action.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/parallelio_autotools/action.yml @@ -2,7 +2,7 @@ description: 'Build the parallelio library using cmake' inputs: parallelio_version: description: 'Tag in the parallelio repository to use' - default: pio2_5_10 + default: pio2_6_3 required: False type: string shared_libraries: @@ -101,12 +101,12 @@ runs: using: composite steps: - name: Check if already present - uses: andstor/file-existence-action@v2 + uses: andstor/file-existence-action@v3 with: files: ${{ inputs.src_path }} - name: get parallelio if: ${{ steps.check_files.outputs.files_exists != 'true' }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: NCAR/ParallelIO path: ${{ inputs.src_path }} diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/parallelio_cmake/action.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/parallelio_cmake/action.yml index 5a135fce2c..c51cbe77d8 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/parallelio_cmake/action.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/actions/parallelio_cmake/action.yml @@ -2,7 +2,7 @@ description: 'Build the parallelio library using cmake' inputs: parallelio_version: description: 'Tag in the parallelio repository to use' - default: pio2_5_9 + default: pio2_6_3 required: False type: string shared_libraries: @@ -110,7 +110,7 @@ inputs: runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: NCAR/ParallelIO path: parallelio-src diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/autotools.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/autotools.yml index eba2d60bfe..ed9cec2480 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/autotools.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/autotools.yml @@ -19,7 +19,7 @@ jobs: LDFLAGS: "-L/usr/lib/x86_64-linux-gnu -lnetcdf_mpi -lpnetcdf" FCFLAGS: "-Wall -Werror -fallow-argument-mismatch -Wno-conversion" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Installs run: | set -x @@ -54,4 +54,4 @@ jobs: # - name: Setup tmate session # if: ${{ failure() }} -# uses: mxschmitt/action-tmate@v3 +# uses: mxschmitt/action-tmate@v4 diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/cmake.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/cmake.yml index e554dd6904..96bb68ba83 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/cmake.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/cmake.yml @@ -19,7 +19,7 @@ jobs: # LDFLAGS: "-static-libasan" # ASAN_OPTIONS: "detect_odr_violation=0" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Installs run: | set -x diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/cmake_ubuntu_latest.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/cmake_ubuntu_latest.yml index eb24571d5e..29beb42c49 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/cmake_ubuntu_latest.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/cmake_ubuntu_latest.yml @@ -23,7 +23,7 @@ jobs: PNETCDF_VERSION: checkpoint.1.12.3 FCFLAGS: "-fallow-argument-mismatch" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Installs run: | set -x @@ -36,7 +36,7 @@ jobs: - name: cache-pnetcdf id: cache-pnetcdf - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/pnetcdf key: pnetcdf-${{ runner.os }}-${{ env.PNETCDF_VERSION }} diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/intel.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/intel.yml deleted file mode 100644 index 10eb10fcaa..0000000000 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/intel.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: Intel OneAPI -# Tests ParallelIO using Intel Compiler and IMPI library. -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - - env: - CC: mpicc - FC: mpiifort - # Versions should match the github tag names - PNETCDF_VERSION: checkpoint.1.12.3 - NETCDF_C_VERSION: v4.9.2 - NETCDF_FORTRAN_VERSION: v4.6.1 - HDF5_VERSION: hdf5_1_12_2 - steps: - - uses: actions/checkout@v3 - - name: Installs - run: | - set -x - sudo apt-get update - sudo apt-get install libcurl4-gnutls-dev - sudo apt-get install libz-dev - echo "/opt/intel/oneapi/compiler/2023.2.1/linux/bin/intel64/" >> $GITHUB_PATH - - name: cache intel compiler - id: cache-intel - uses: actions/cache@v3 - with: - path: /opt/intel/oneapi - key: intel-${{ runner.os }} - - name: Install Intel OneAPI - if: steps.cache-intel.outputs.cache-hit != 'true' - uses: ./.github/actions/intelcompilers - - name: Prep Intel OneAPI - if: steps.cache-intel.outputs.cache-hit == 'true' - run: | - source /opt/intel/oneapi/setvars.sh - printenv >> $GITHUB_ENV - - - name: cache-hdf5 - id: cache-hdf5 - uses: actions/cache@v3 - with: - path: ~/work/ParallelIO/ParallelIO/hdf5 - key: hdf5-${{ runner.os }}-${{ env.HDF5_VERSION }}-impi - - name: build-hdf5 - if: steps.cache-hdf5.outputs.cache-hit != 'true' - uses: ./.github/actions/buildhdf5 - with: - install_prefix: ${GITHUB_WORKSPACE}/hdf5 - enable_parallel: True - hdf5_version: ${{ env.HDF5_VERSION }} - mpi_path: /opt/intel/mpi - - name: cache netcdf C - id: cache-netcdf-c - uses: actions/cache@v3 - with: - path: ~/work/ParallelIO/ParallelIO/netcdf-c - key: netcdf-c-${{ runner.os }}-${{ env.NETCDF_C_VERSION }}-impi-hdf5-${{ env.HDF5_VERSION }} - - name: cache netcdf Fortran - id: cache-netcdf-f - uses: actions/cache@v3 - with: - path: ~/work/ParallelIO/ParallelIO/netcdf-f - key: netcdf-f-${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-impi-hdf5-${{ env.HDF5_VERSION }} - - - name: prep netcdf-c - run: | - export PATH=$GITHUB_WORKSPACE/hdf5/bin:$GITHUB_WORKSPACE/netcdf/bin:$PATH - export LDFLAGS="$LDFLAGS -L$GITHUB_WORKSPACE/hdf5/lib -L/usr/lib/x86_64-linux-gnu/ -lcurl" - export CPPFLAGS="$CPPFLAGS -I$GITHUB_WORKSPACE/hdf5/include -I$GITHUB_WORKSPACE/netcdf/include" - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/hdf5/lib:/usr/lib/x86_64-linux-gnu/:/opt/intel/oneapi/compiler/2023.2.1/linux/compiler/lib/intel64_lin/" - printenv >> $GITHUB_ENV - - name: build-netcdf-c - if: steps.cache-netcdf-c.outputs.cache-hit != 'true' - uses: ./.github/actions/buildnetcdf - with: - netcdf_version: ${{ env.NETCDF_C_VERSION }} - install_prefix: ${GITHUB_WORKSPACE}/netcdf-c - - - name: Build NetCDF Fortran - if: steps.cache-netcdf-f.outputs.cache-hit != 'true' - uses: ./.github/actions/buildnetcdff - with: - netcdf_fortran_version: ${{ env.NETCDF_FORTRAN_VERSION }} - install_prefix: ${GITHUB_WORKSPACE}/netcdf-f - netcdf_c_path: ${GITHUB_WORKSPACE}/netcdf-c - - - name: cache-pnetcdf - id: cache-pnetcdf - uses: actions/cache@v3 - with: - path: ~/work/ParallelIO/ParallelIO/pnetcdf - key: pnetcdf-${{ runner.os }}-${{ env.PNETCDF_VERSION }}-impi-5 - - - name: Build PNetCDF - if: steps.cache-pnetcdf.outputs.cache-hit != 'true' - uses: ./.github/actions/buildpnetcdf - with: - pnetcdf_version: ${{ env.PNETCDF_VERSION }} - install_prefix: ${GITHUB_WORKSPACE}/pnetcdf - - - name: cmake build - uses: ./.github/actions/parallelio_cmake - with: - parallelio_version: ${{ env.GITHUB_SHA }} - enable_fortran: True - netcdf_c_library: $GITHUB_WORKSPACE/netcdf-c/lib/libnetcdf.so - netcdf_c_include_dir: $GITHUB_WORKSPACE/netcdf-c/include - netcdf_fortran_library: $GITHUB_WORKSPACE/netcdf-f/lib/libnetcdff.so - netcdf_fortran_include_dir: $GITHUB_WORKSPACE/netcdf-f/include - pnetcdf_library: $GITHUB_WORKSPACE/pnetcdf/lib/libpnetcdf.a - pnetcdf_include_dir: $GITHUB_WORKSPACE/pnetcdf/include - install_prefix: $GITHUB_WORKSPACE/parallelio - - name: parallelio tests - run: | - pushd $GITHUB_WORKSPACE/build - make tests - ctest -VV -E test_async_ - popd - # the following can be used by developers to login to the github server in case of errors - # see https://github.com/marketplace/actions/debugging-with-tmate for further details -# - name: Setup tmate session -# if: ${{ failure() }} -# uses: mxschmitt/action-tmate@v3 diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_hdf5_no_pnetcdf_ncint_mpich.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_hdf5_no_pnetcdf_ncint_mpich.yml index 81b0d0635e..44222f4456 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_hdf5_no_pnetcdf_ncint_mpich.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_hdf5_no_pnetcdf_ncint_mpich.yml @@ -19,13 +19,13 @@ jobs: FFLAGS: "-fallow-argument-mismatch" FCFLAGS: "-fallow-argument-mismatch" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Installs run: | sudo apt-get install doxygen graphviz wget gfortran libjpeg-dev libz-dev libcurl4-gnutls-dev - name: cache-mpich id: cache-mpich - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/work/ParallelIO/ParallelIO/mpich key: mpich-${{ runner.os }}-${{ env.MPICH_VERSION }} @@ -39,7 +39,7 @@ jobs: - name: cache-hdf5 id: cache-hdf5 - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/work/ParallelIO/ParallelIO/hdf5 key: hdf5-${{ runner.os }}-${{ env.HDF5_VERSION }}-mpich-${{ env.MPICH_VERSION }} @@ -55,7 +55,7 @@ jobs: - name: cache-netcdf id: cache-netcdf - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/work/ParallelIO/ParallelIO/netcdf key: netcdf-${{ runner.os }}-${{ env.NETCDF_C_VERSION }}-${{ env.NETCDF_FORTRAN_VERSION }}-mpich-${{ env.MPICH_VERSION }}-hdf5-${{ env.HDF5_VERSION }} @@ -79,7 +79,7 @@ jobs: - name: cache-netcdf-fortran id: cache-netcdf-fortran - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/netcdf-fortran key: netcdf-fortran-${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-mpich-${{ env.MPICH_VERSION }}-hdf5-${{ env.HDF5_VERSION }} diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_hdf5_pnetcdf_ncint_mpich_asan.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_hdf5_pnetcdf_ncint_mpich_asan.yml index 5b055f0466..02c258115b 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_hdf5_pnetcdf_ncint_mpich_asan.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_hdf5_pnetcdf_ncint_mpich_asan.yml @@ -20,13 +20,13 @@ jobs: FCFLAGS: "-fallow-argument-mismatch" FFLAGS: "-fallow-argument-mismatch" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Installs run: | sudo apt-get install doxygen graphviz wget gfortran libjpeg-dev libz-dev - name: cache-mpich id: cache-mpich - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/mpich key: mpich-${{ runner.os }}-${{ env.MPICH_VERSION }} @@ -40,7 +40,7 @@ jobs: - name: cache-hdf5 id: cache-hdf5 - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/hdf5 key: hdf5-${{ runner.os }}-${{ env.HDF5_VERSION }}-mpich-${{ env.MPICH_VERSION }} @@ -55,7 +55,7 @@ jobs: mpi_path: $HOME/mpich - name: cache-netcdf-c id: cache-netcdf-c - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/netcdf-c key: netcdf-c-${{ runner.os }}-${{ env.NETCDF_C_VERSION }}-mpich-${{ env.MPICH_VERSION }}-hdf5-${{ env.HDF5_VERSION }} @@ -69,7 +69,7 @@ jobs: - name: cache-netcdf-fortran id: cache-netcdf-fortran - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/netcdf-fortran key: netcdf-fortran-${{ runner.os }}-${{ env.NETCDF_F_VERSION }}-mpich-${{ env.MPICH_VERSION }}-hdf5-${{ env.HDF5_VERSION_MAJOR }}.${{ env.HDF5_VERSION_PATCH }} @@ -84,7 +84,7 @@ jobs: - name: cache-pnetcdf id: cache-pnetcdf - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/pnetcdf key: pnetcdf-${{ runner.os }}-${{ env.PNETCDF_VERSION }}-mpich-${{ env.MPICH_VERSION }} diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_pnetcdf_openmpi.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_pnetcdf_openmpi.yml index 1b3b6c1b05..1bd6d64d79 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_pnetcdf_openmpi.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/netcdf_pnetcdf_openmpi.yml @@ -22,13 +22,13 @@ jobs: FCFLAGS: "-fallow-argument-mismatch" FFLAGS: "-fallow-argument-mismatch" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Installs run: | sudo apt-get install doxygen graphviz wget gfortran libjpeg-dev libz-dev - name: cache-openmpi id: cache-openmpi - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/work/ParallelIO/ParallelIO/openmpi key: openmpi-${{ runner.os }}-${{ env.OPENMPI_VERSION }} @@ -42,7 +42,7 @@ jobs: - name: cache-hdf5 id: cache-hdf5 - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/work/ParallelIO/ParallelIO/hdf5 key: hdf5-${{ runner.os }}-${{ env.HDF5_VERSION }}-openmpi-${{ env.OPENMPI_VERSION }} @@ -58,7 +58,7 @@ jobs: - name: cache-netcdf id: cache-netcdf - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/work/ParallelIO/ParallelIO/netcdf key: netcdf-${{ runner.os }}-${{ env.NETCDF_C_VERSION }}-${{ env.NETCDF_FORTRAN_VERSION }}-openmpi-${{ env.OPENMPI_VERSION }}-hdf5-${{ env.HDF5_VERSION }} @@ -73,7 +73,7 @@ jobs: # - name: Setup tmate session # if: ${{ failure() }} -# uses: mxschmitt/action-tmate@v3 +# uses: mxschmitt/action-tmate@v4 - name: Build NetCDF Fortran if: steps.cache-netcdf.outputs.cache-hit != 'true' @@ -85,7 +85,7 @@ jobs: # - name: cache-pnetcdf # id: cache-pnetcdf - # uses: actions/cache@v3 + # uses: actions/cache@v4 # with: # path: ~/pnetcdf # key: pnetcdf-${{ runner.os }}-${{ env.PNETCDF_VERSION }}-openmpi-${{ env.OPENMPI_VERSION_MAJOR }}.${{ env.OPENMPI_VERSION_PATCH }} diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/strict_autotools_ubuntu_latest.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/strict_autotools_ubuntu_latest.yml index 952348a5fb..0fe740d542 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/strict_autotools_ubuntu_latest.yml +++ b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/strict_autotools_ubuntu_latest.yml @@ -20,7 +20,7 @@ jobs: FCFLAGS: "-fallow-argument-mismatch -Wall" PNETCDF_VERSION: checkpoint.1.12.3 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Installs run: | set -x @@ -29,7 +29,7 @@ jobs: - name: cache-pnetcdf id: cache-pnetcdf - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/work/ParallelIO/ParallelIO/pnetcdf key: pnetcdf-${{ runner.os }}-${{ env.PNETCDF_VERSION }}-openmpi diff --git a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/withspack.yml b/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/withspack.yml deleted file mode 100644 index 998d61ea01..0000000000 --- a/src/Infrastructure/IO/PIO/ParallelIO/.github/workflows/withspack.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Build with Spack -# Tests ParallelIO using spack tools -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Installs - run: | - set -x - sudo apt-get update - sudo apt-get install wget - sudo apt-get install libjpeg-dev - sudo apt-get install libz-dev - sudo apt-get install gfortran - - - name: Get latest spack release tag - run: | - export SPACK_LATEST="$(curl -sL https://github.com/spack/spack/releases/latest |grep 'Release' | awk '{print $2}')" - printenv >> $GITHUB_ENV - - name: cache spack - id: cache-spack - uses: actions/cache@v3 - with: - path: | - ~/work/ParallelIO/ParallelIO/spack - ~/.spack - key: spack-${{ runner.os }}-${{ env.SPACK_LATEST }} - - name: Get Spack - if: steps.cache-spack.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: spack/spack - path: spack - ref: ${{ env.SPACK_LATEST }} - - - name: Prep spack - run: | - source $GITHUB_WORKSPACE/spack/share/spack/setup-env.sh - spack compiler find - # Remove the patch for gfortran, we don't want it - # - sed -i 's/patch(.*$//' $GITHUB_WORKSPACE/spack/var/spack/repos/builtin/packages/parallelio/package.py - - name: Build with spack - run: | - source $GITHUB_WORKSPACE/spack/share/spack/setup-env.sh - mkdir genf90 - pushd genf90 - ln -fs $GITHUB_WORKSPACE/scripts/genf90.pl . - popd - # the || true prevents a fail if parallelio is not installed - # spack uninstall -y parallelio@=develop+pnetcdf+fortran ^mpich || true - # spack dev-build -d $GITHUB_WORKSPACE parallelio@=develop+pnetcdf+fortran ^mpich - spack uninstall -y parallelio@=develop+pnetcdf+fortran ^mpich || true - spack dev-build -d $GITHUB_WORKSPACE parallelio@=develop+pnetcdf+fortran ^mpich - - - name: Test parallelio - run: | - pioblddir=$(ls -td */ | head -1) - pushd $pioblddir - make tests - # Exclude two tests that are timing out. - ctest -VV -LE skipforspack - popd - - - - name: Setup tmate session - if: ${{ failure() }} - uses: mxschmitt/action-tmate@v3 diff --git a/src/Infrastructure/IO/PIO/ParallelIO/CMakeLists.txt b/src/Infrastructure/IO/PIO/ParallelIO/CMakeLists.txt index 906727f061..7e26a0f0f6 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/CMakeLists.txt +++ b/src/Infrastructure/IO/PIO/ParallelIO/CMakeLists.txt @@ -10,7 +10,7 @@ project (PIO C) # The project version number. set(VERSION_MAJOR 2 CACHE STRING "Project major version number.") set(VERSION_MINOR 6 CACHE STRING "Project minor version number.") -set(VERSION_PATCH 2 CACHE STRING "Project patch version number.") +set(VERSION_PATCH 5 CACHE STRING "Project patch version number.") mark_as_advanced(VERSION_MAJOR VERSION_MINOR VERSION_PATCH) # Create version info in autotools parlance for pio_meta.h. @@ -29,18 +29,18 @@ include(CheckSymbolExists) # Determine the configure date. IF(DEFINED ENV{SOURCE_DATE_EPOCH}) - EXECUTE_PROCESS( - COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" - OUTPUT_VARIABLE CONFIG_DATE - ) + EXECUTE_PROCESS( + COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" + OUTPUT_VARIABLE CONFIG_DATE + ) ELSE() - EXECUTE_PROCESS( - COMMAND date - OUTPUT_VARIABLE CONFIG_DATE - ) + EXECUTE_PROCESS( + COMMAND date + OUTPUT_VARIABLE CONFIG_DATE + ) ENDIF() IF(CONFIG_DATE) - string(STRIP ${CONFIG_DATE} CONFIG_DATE) + string(STRIP ${CONFIG_DATE} CONFIG_DATE) ENDIF() # A function used to create autotools-style 'yes/no' definitions. @@ -352,7 +352,7 @@ CHECK_C_SOURCE_COMPILES(" #if !NC_HAS_SZIP_WRITE choke me #endif -int main() {return 0;}" HAVE_SZIP_WRITE) +int main() {return 0;}" USE_SZIP) ### # Check to see if parallel filters are supported by HDF5/netcdf-c. @@ -363,9 +363,9 @@ if (HAVE_NETCDF_PAR) #if !NC_HAS_PAR_FILTERS choke me #endif -int main() {return 0;}" HAVE_PAR_FILTERS) +int main() {return 0;}" PIO_HAS_PAR_FILTERS) else() - set(HAVE_PAR_FILTERS 0) + set(PIO_HAS_PAR_FILTERS 0) endif() ### @@ -486,7 +486,7 @@ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") INSTALL(FILES "${PIO_BINARY_DIR}/libpio.settings" DESTINATION lib COMPONENT libraries) - + ##### # Create pio_meta.h include file. ##### diff --git a/src/Infrastructure/IO/PIO/ParallelIO/configure.ac b/src/Infrastructure/IO/PIO/ParallelIO/configure.ac index 1ba2087881..7f8aa1ba28 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/configure.ac +++ b/src/Infrastructure/IO/PIO/ParallelIO/configure.ac @@ -2,7 +2,7 @@ ## Ed Hartnett 8/16/17 # Initialize autoconf and automake. -AC_INIT(pio, 2.6.2) +AC_INIT(pio, 2.6.5) AC_CONFIG_SRCDIR(src/clib/pio_darray.c) AM_INIT_AUTOMAKE([foreign serial-tests]) @@ -11,7 +11,7 @@ AM_INIT_AUTOMAKE([foreign serial-tests]) # AC_DEFINE_UNQUOTED for config.h. AC_SUBST([PIO_VERSION_MAJOR]) PIO_VERSION_MAJOR=2 AC_SUBST([PIO_VERSION_MINOR]) PIO_VERSION_MINOR=6 -AC_SUBST([PIO_VERSION_PATCH]) PIO_VERSION_PATCH=2 +AC_SUBST([PIO_VERSION_PATCH]) PIO_VERSION_PATCH=5 AC_DEFINE_UNQUOTED([PIO_VERSION_MAJOR], [$PIO_VERSION_MAJOR], [PIO major version]) AC_DEFINE_UNQUOTED([PIO_VERSION_MINOR], [$PIO_VERSION_MINOR], [PIO minor version]) AC_DEFINE_UNQUOTED([PIO_VERSION_PATCH], [$PIO_VERSION_PATCH], [PIO patch version]) @@ -19,7 +19,7 @@ AC_DEFINE_UNQUOTED([PIO_VERSION_PATCH], [$PIO_VERSION_PATCH], [PIO patch version # Once more for the documentation. AC_SUBST([VERSION_MAJOR], [2]) AC_SUBST([VERSION_MINOR], [6]) -AC_SUBST([VERSION_PATCH], [2]) +AC_SUBST([VERSION_PATCH], [5]) # The m4 directory holds macros for autoconf. @@ -38,7 +38,7 @@ fi LD=ld # Required for MPE to work. LT_INIT -# Find and learn about install +# Find and learn about install AC_PROG_INSTALL # Find and learn about the C compiler. @@ -294,7 +294,7 @@ AC_MSG_CHECKING([whether netCDF provides parallel filter support]) AC_CHECK_LIB([netcdf], [nc_inq_filter_avail], [have_par_filters=yes], [have_par_filters=no]) AC_MSG_RESULT([${have_par_filters}]) if test "x$have_par_filters" = xyes ; then - AC_DEFINE([HAVE_PAR_FILTERS], [1], [if true, netcdf-c supports filters with parallel I/O]) + AC_DEFINE([PIO_HAS_PAR_FILTERS], [1], [if true, netcdf-c supports filters with parallel I/O]) fi # Is this version 4.7.2, which does not work? @@ -472,8 +472,8 @@ AC_CONFIG_HEADERS([config.h]) # Create the makefiles. AC_CONFIG_FILES(Makefile - src/Makefile - src/clib/Makefile + src/Makefile + src/clib/Makefile src/ncint/Makefile src/flib/Makefile src/gptl/Makefile diff --git a/src/Infrastructure/IO/PIO/ParallelIO/doc/source/Introduction.txt b/src/Infrastructure/IO/PIO/ParallelIO/doc/source/Introduction.txt index 888c44a84f..8393865428 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/doc/source/Introduction.txt +++ b/src/Infrastructure/IO/PIO/ParallelIO/doc/source/Introduction.txt @@ -45,7 +45,7 @@ processors (see @ref iosystem). PIO uses <a href=http://www.unidata.ucar.edu/software/netcdf/docs/html_guide/index.html#user_guide> netcdf </a> and <a -href=http://trac.mcs.anl.gov/projects/parallel-netcdf> pnetcdf</a> to +href=https://parallel-netcdf.github.io/> pnetcdf</a> to read and write the netCDF files (see @ref install). ## Basic description of how to optimize IO in a parallel environment: diff --git a/src/Infrastructure/IO/PIO/ParallelIO/examples/basic/kinds_mod.F90 b/src/Infrastructure/IO/PIO/ParallelIO/examples/basic/kinds_mod.F90 index ec2db1a3ae..7388264141 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/examples/basic/kinds_mod.F90 +++ b/src/Infrastructure/IO/PIO/ParallelIO/examples/basic/kinds_mod.F90 @@ -2,7 +2,7 @@ module kinds_mod -!BOP +! ! !MODULE: kinds_mod ! ! !DESCRIPTION: @@ -31,9 +31,9 @@ module kinds_mod r4 = selected_real_kind(6) ,& r8 = selected_real_kind(13) -!EOP -!BOC -!EOC +! +! +! !*********************************************************************** end module kinds_mod diff --git a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/CMakeLists.txt b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/CMakeLists.txt index 609de6f575..35e188149a 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/CMakeLists.txt +++ b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/CMakeLists.txt @@ -175,8 +175,8 @@ endif () include(CheckTypeSize) check_type_size("size_t" SIZEOF_SIZE_T) -CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) -if (NOT ${SIZEOF_SIZE_T} EQUAL ${SIZEOF_LONG_LONG}) +check_type_size("long long" SIZEOF_LONG_LONG) +if (NOT "${SIZEOF_SIZE_T}" STREQUAL "${SIZEOF_LONG_LONG}") message (FATAL_ERROR "size_t and long long must be the same size!") endif () diff --git a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio.h b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio.h index a4b20b7522..b15d61b0bc 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio.h +++ b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio.h @@ -27,6 +27,9 @@ (((NC_VERSION_MAJOR == Maj) && (NC_VERSION_MINOR == Min) && (NC_VERSION_PATCH >= Pat)) || \ ((NC_VERSION_MAJOR == Maj) && (NC_VERSION_MINOR > Min)) || (NC_VERSION_MAJOR > Maj)) +#ifndef NC_FillValue +#define NC_FillValue _FillValue +#endif /** PIO_OFFSET is an integer type of size sufficient to represent the * size (in bytes) of the largest file supported by MPI. This is not diff --git a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_darray_int.c b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_darray_int.c index 084a214293..880ad61a0a 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_darray_int.c +++ b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_darray_int.c @@ -430,7 +430,7 @@ write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *vari ierr = ncmpi_wait_all(file->fh, NC_REQ_ALL, NULL, NULL); #endif /* _PNETCDF */ - + MPI_Offset chkcnt2=0; /* Process each region of data to be written. */ for (int regioncnt = 0; regioncnt < num_regions; regioncnt++) { @@ -438,6 +438,11 @@ write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *vari if ((ierr = find_start_count(iodesc->ndims, fndims, vdesc, region, frame, start, count))) return pio_err(ios, file, ierr, __FILE__, __LINE__); + size_t cnt = 1; + for(int i=0; i<fndims; i++){ + cnt *= count[i]; + } + chkcnt2 += cnt; /* IO tasks will run the netCDF/pnetcdf functions to write the data. */ switch (file->iotype) @@ -490,10 +495,10 @@ write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *vari for (int i = 0; i < fndims; i++) { startlist[rrcnt][i] = start[i]; - countlist[rrcnt][i] = count[i]; - PLOG((3, "startlist[%d][%d] = %d countlist[%d][%d] = %d", rrcnt, i, + countlist[rrcnt][i] = count[i]; + PLOG((3, "startlist[%d][%d] = %lld countlist[%d][%d] = %lld", rrcnt, i, startlist[rrcnt][i], rrcnt, i, countlist[rrcnt][i])); - } + } rrcnt++; } @@ -645,11 +650,22 @@ write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *vari else /* don't flush yet, accumulate the request size */ vard_llen += llen; #else - ierr = ncmpi_iput_varn(file->fh, varids[nv], rrcnt, startlist, countlist, - bufptr, llen, iodesc->mpitype, NULL); - - + bufptr, chkcnt2, iodesc->mpitype, NULL); +// bufptr, llen, iodesc->mpitype, NULL); + + + if (ierr){ + MPI_Offset chksize=0; + for (int j = 0; j < rrcnt; j++) + { +/* printf("%d: nv=%d startlist[%d][%d] = %lld countlist[%d][%d] = %lld\n", ios->io_rank, nv, j, i, + startlist[j][i], j, i, countlist[j][i]); +*/ + chksize += countlist[j][0]*countlist[j][1]*countlist[j][2]; + } + printf("llen = %lld chksize = %lld chkcnt2 = %lld\n",llen, chksize, chkcnt2); + } vdesc->nreqs++; #endif } diff --git a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_nc.c b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_nc.c index 2808e45ec3..d6849b59ae 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_nc.c +++ b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_nc.c @@ -2322,7 +2322,7 @@ PIOc_def_var(int ncid, const char *name, nc_type xtype, int ndims, * * When the fill mode for the file is NC_FILL, then fill values are * used for missing data. This function sets the fill value to be used - * for a variable. If no specific fill value is set (as a _FillValue + * for a variable. If no specific fill value is set (as a NC_FillValue * attribute), then the default fill values from netcdf.h are used. * * NetCDF-4 and pnetcdf files allow setting fill_mode (to NC_FILL or @@ -2430,7 +2430,7 @@ PIOc_def_var_fill(int ncid, int varid, int fill_mode, const void *fill_valuep) { ierr = nc_set_fill(file->fh, NC_FILL, NULL); if (!ierr) - ierr = nc_put_att(file->fh, varid, _FillValue, xtype, 1, fill_valuep); + ierr = nc_put_att(file->fh, varid, NC_FillValue, xtype, 1, fill_valuep); } } else @@ -2477,7 +2477,7 @@ PIOc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep) { iosystem_desc_t *ios; /* Pointer to io system information. */ file_desc_t *file; /* Pointer to file information. */ - nc_type xtype; /* Type of variable and its _FillValue attribute. */ + nc_type xtype; /* Type of variable and its NC_FillValue attribute. */ PIO_Offset type_size; /* Size in bytes of this variable's type. */ int mpierr = MPI_SUCCESS, mpierr2; /* Return code from MPI function codes. */ int ierr = PIO_NOERR; /* Return code from function calls. */ @@ -2574,7 +2574,7 @@ PIOc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep) if (!ierr && fill_valuep) { - ierr = nc_get_att(file->fh, varid, _FillValue, fill_valuep); + ierr = nc_get_att(file->fh, varid, NC_FillValue, fill_valuep); if (ierr == NC_ENOTATT) { char char_fill_value = NC_FILL_CHAR; diff --git a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_nc4.c b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_nc4.c index 3074bbd95a..b0c045bcbe 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_nc4.c +++ b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_nc4.c @@ -1308,7 +1308,6 @@ PIOc_get_var_chunk_cache(int ncid, int varid, PIO_Offset *sizep, PIO_Offset *nel } /* use this variable in the NETCDF library (introduced in v4.9.0) to determine if the following functions are available */ -#ifdef NC_HAS_MULTIFILTERS /** * Set the variable filter ids * @@ -1337,8 +1336,8 @@ PIOc_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams, unsign PLOG((1, "PIOc_def_var_filter ncid = %d varid = %d id = %d nparams = %d", ncid, varid, id, nparams)); #ifdef DEBUG - for(i=0; i<nparams; i++) - PLOG(1, " param %d %d\n",i, params[i]); + for(int i=0; i<nparams; i++) + PLOG((1, " param %d %d\n",i, params[i])); #endif /* Get the file info. */ @@ -1878,8 +1877,6 @@ PIOc_inq_filter_avail(int ncid, unsigned int id ) } // PIO_HAS_PAR_FILTERS #endif -// NC_HAS_MULTIFILTERS -#endif #ifdef NC_HAS_QUANTIZE /** * Turn on quantization for a variable diff --git a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_rearrange.c b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_rearrange.c index 2aabacb5bd..74627f6462 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_rearrange.c +++ b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pio_rearrange.c @@ -80,9 +80,6 @@ expand_region(int dim, const int *gdimlen, int maplen, const PIO_Offset *map, int region_size, int region_stride, const int *max_size, PIO_Offset *count) { - /* Flag used to signal that we can no longer expand the region - along dimension dim. */ - int expansion_done = 0; /* Check inputs. */ pioassert(dim >= 0 && gdimlen && maplen >= 0 && map && region_size >= 0 && maplen >= region_size && region_stride >= 0 && max_size && count, @@ -100,26 +97,18 @@ expand_region(int dim, const int *gdimlen, int maplen, const PIO_Offset *map, Assuming monotonicity in the map, we could skip this for the innermost dimension, but it's necessary past that because the region does not necessarily comprise contiguous values. */ - for (int j = 0; j < region_size; j++) + int test_idx = i * region_size; + for (int j = 0; j < region_size; j++, test_idx++) { - int test_idx; /* Index we are testing. */ - - test_idx = j + i * region_size; - /* If we have exhausted the map, or the map no longer matches, we are done, break out of both loops. */ //PLOG((3,"dim=%d maplen = %d map[%d]=%d map[%d]=%d i=%d region_stride=%d",dim, maplen, test_idx, map[test_idx], j, map[j],i,region_stride)); if (test_idx >= maplen || map[test_idx] != map[j] + i * region_stride) { - expansion_done = 1; - break; + return; } } - if (expansion_done) - break; - } - PLOG((3,"expansion_done = %d count[%d]=%ld",expansion_done, dim, count[dim])); /* Move on to next outermost dimension if there are more left, * else return. */ if (dim > 0) @@ -1827,7 +1816,10 @@ compare_offsets(const void *a, const void *b) mapsort *y = (mapsort *)b; if (!x || !y) return 0; - return (int)(x->iomap - y->iomap); + + if (x->iomap < y->iomap) { return -1; } + if (x->iomap > y->iomap) { return 1; } + return 0; } /** diff --git a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pioc_support.c b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pioc_support.c index 9d44d1ee7f..7c1c349e43 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pioc_support.c +++ b/src/Infrastructure/IO/PIO/ParallelIO/src/clib/pioc_support.c @@ -9,7 +9,15 @@ #include <pio.h> #include <pio_internal.h> +#if defined __has_include +#if __has_include (<execinfo.h>) +#define PLATFORM_HAS_EXECINFO +#endif /* __has_include (<execinfo.h>) */ +#endif /* __has_include */ + +#ifdef PLATFORM_HAS_EXECINFO #include <execinfo.h> +#endif /* PLATFORM_HAS_EXECINFO */ /** This is used with text decomposition files. */ #define VERSNO 2001 @@ -522,6 +530,7 @@ pio_log(int severity, const char *fmt, ...) void print_trace(FILE *fp) { +#ifdef PLATFORM_HAS_EXECINFO void *array[10]; size_t size; char **strings; @@ -540,6 +549,9 @@ print_trace(FILE *fp) fprintf(fp,"%s\n", strings[i]); free(strings); +#else + (void)fp; +#endif /* PLATFORM_HAS_EXECINFO */ } /** @@ -1532,6 +1544,7 @@ pioc_write_nc_decomp_int(iosystem_desc_t *ios, const char *filename, int cmode, strlen(my_order_str) + 1, my_order_str))) return pio_err(ios, NULL, ret, __FILE__, __LINE__); +#ifdef PLATFORM_HAS_EXECINFO /* Write an attribute with the stack trace. This can be helpful * for debugging. */ void *bt[MAX_BACKTRACE]; @@ -1562,6 +1575,7 @@ pioc_write_nc_decomp_int(iosystem_desc_t *ios, const char *filename, int cmode, if ((ret = PIOc_put_att_text(ncid, NC_GLOBAL, DECOMP_BACKTRACE_ATT_NAME, strlen(full_bt) + 1, full_bt))) return pio_err(ios, NULL, ret, __FILE__, __LINE__); +#endif /* PLATFORM_HAS_EXECINFO */ /* We need a dimension for the dimensions in the data. (Example: * for 4D data we will need to store 4 dimension IDs.) */ @@ -3111,7 +3125,8 @@ iotype_is_valid(int iotype) ret++; /* Some builds include netCDF-4. */ -#ifdef NC_HAS_NC4 + /* as of netcdf 4.9.3 NC_HAS_NC4 is no longer defined */ +#if NC_HAS_NC4 || (NC_VERSION_PATCH > 2) if (iotype == PIO_IOTYPE_NETCDF4C || iotype == PIO_IOTYPE_NETCDF4P) ret++; #endif /* _NETCDF4 */ diff --git a/src/Infrastructure/IO/PIO/ParallelIO/src/flib/pio_nf.F90 b/src/Infrastructure/IO/PIO/ParallelIO/src/flib/pio_nf.F90 index db08a7725b..72d6a399e3 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/src/flib/pio_nf.F90 +++ b/src/Infrastructure/IO/PIO/ParallelIO/src/flib/pio_nf.F90 @@ -140,7 +140,7 @@ module pio_nf pio_def_var_quantize , & pio_inq_var_quantize , & #endif -#ifdef NC_HAS_MULTIFILTERS +!!#ifdef NC_HAS_MULTIFILTERS #ifdef NC_HAS_BZ pio_inq_var_bzip2 , & pio_def_var_bzip2 , & @@ -154,7 +154,7 @@ module pio_nf pio_inq_var_filter_info , & pio_inq_filter_avail , & #endif -#endif +!!#endif pio_set_fill ! pio_copy_att to be done @@ -400,19 +400,19 @@ module pio_nf #ifdef NC_HAS_QUANTIZE interface pio_def_var_quantize module procedure & - def_var_quantize_desc , & + def_var_quantize_desc, & def_var_quantize_id end interface pio_def_var_quantize interface pio_inq_var_quantize module procedure & - inq_var_quantize_desc , & + inq_var_quantize_desc, & inq_var_quantize_id end interface pio_inq_var_quantize #endif #ifdef PIO_HAS_PAR_FILTERS interface pio_inq_var_filter_ids module procedure & - inq_var_filter_ids_desc , & + inq_var_filter_ids_desc , & inq_var_filter_ids_id end interface pio_inq_var_filter_ids interface pio_inq_var_filter_info diff --git a/src/Infrastructure/IO/PIO/ParallelIO/src/flib/piolib_mod.F90 b/src/Infrastructure/IO/PIO/ParallelIO/src/flib/piolib_mod.F90 index 908af2cfea..265a0e102d 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/src/flib/piolib_mod.F90 +++ b/src/Infrastructure/IO/PIO/ParallelIO/src/flib/piolib_mod.F90 @@ -1343,8 +1343,7 @@ end function pio_iotype_available !! @param file The returned file descriptor !! @param iotype @copydoc PIO_iotype !! @param fname The name of the file to open - !! @param amode_in The NetCDF creation mode flag - NC_NOWRITE for - !! read-only access or NC_WRITE for read-write access. + !! @param amode_in The NetCDF creation mode flag: PIO_CLOBBER, PIO_NOCLOBBER, PIO_64BIT_OFFSET, PIO_64BIT_DATA !! @retval ierr @copydoc error_return !! @author Jim Edwards !< diff --git a/src/Infrastructure/IO/PIO/ParallelIO/src/gptl/perf_utils.F90 b/src/Infrastructure/IO/PIO/ParallelIO/src/gptl/perf_utils.F90 index 76c7294136..88fab3c5f5 100644 --- a/src/Infrastructure/IO/PIO/ParallelIO/src/gptl/perf_utils.F90 +++ b/src/Infrastructure/IO/PIO/ParallelIO/src/gptl/perf_utils.F90 @@ -317,7 +317,7 @@ END SUBROUTINE shr_mpi_bcastl0 !================== Routines from csm_share/shr/shr_file_mod.F90 =============== !=============================================================================== -!BOP =========================================================================== +!=========================================================================== ! ! !IROUTINE: shr_file_getUnit -- Get a free FORTRAN unit number ! @@ -333,7 +333,7 @@ INTEGER FUNCTION shr_file_getUnit () implicit none -!EOP +! !----- local parameters ----- integer(SHR_KIND_IN),parameter :: shr_file_minUnit = 10 ! Min unit number to give @@ -367,7 +367,7 @@ END FUNCTION shr_file_getUnit !=============================================================================== !=============================================================================== -!BOP =========================================================================== +!=============================================================================== ! ! !IROUTINE: shr_file_freeUnit -- Free up a FORTRAN unit number ! @@ -387,7 +387,7 @@ SUBROUTINE shr_file_freeUnit ( unit) integer(SHR_KIND_IN),intent(in) :: unit ! unit number to be freed -!EOP +! !----- local parameters ----- integer(SHR_KIND_IN),parameter :: shr_file_minUnit = 10 ! Min unit number to give