diff --git a/.github/workflows/a3.yml b/.github/workflows/a3.yml new file mode 100644 index 00000000000..71e66ffd4d1 --- /dev/null +++ b/.github/workflows/a3.yml @@ -0,0 +1,135 @@ +name: netcdf-4.7.4_pnetcdf-12.1_ncint + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + env: + CPPFLAGS: "-I/home/runner/openmpi/include -I/home/runner/hdf5/include -I/home/runner/netcdf-c/include -I/home/runner/netcdf-fortran/include -I/home/runner/pnetcdf/include" + LDFLAGS: "-L/home/runner/openmpi/lib -L/home/runner/hdf5/lib -L/home/runner/netcdf-c/lib -L/home/runner/netcdf-fortran/lib -L/home/runner/pnetcdf/lib" + + steps: + - uses: actions/checkout@v2 + - name: Installs + run: | + sudo apt-get install doxygen graphviz wget gfortran libjpeg-dev libz-dev + - name: cache-openmpi + id: cache-openmpi + uses: actions/cache@v2 + with: + path: ~/openmpi + key: openmpi-${{ runner.os }}-4.0.4 + + - name: build-openmpi + if: steps.cache-openmpi.outputs.cache-hit != 'true' + run: | + wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.4.tar.gz &> /dev/null + tar -xzf openmpi-4.0.4.tar.gz + pushd openmpi-4.0.4 + ./configure --prefix=/home/runner/openmpi + make + sudo make install + popd + - name: cache-hdf5 + id: cache-hdf5 + uses: actions/cache@v2 + with: + path: ~/hdf5 + key: hdf5-${{ runner.os }}-1.10.6-openmpi-4.0.4 + + - name: build-hdf5 + if: steps.cache-hdf5.outputs.cache-hit != 'true' + run: | + set -x + export PATH="/home/runner/openmpi/bin:$PATH" + export CC=/home/runner/openmpi/bin/mpicc + wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.6/src/hdf5-1.10.6.tar.gz &> /dev/null + tar -xzf hdf5-1.10.6.tar.gz + pushd hdf5-1.10.6 + ./configure --prefix=/home/runner/hdf5 --enable-parallel --disable-tools --disable-fortran --disable-cxx --enable-parallel-tests + make + sudo make install + popd + - name: cache-netcdf-c + id: cache-netcdf-c + uses: actions/cache@v2 + with: + path: ~/netcdf-c + key: netcdf-c-${{ runner.os }}-4.7.4-openmpi-4.0.4 + + - name: build-netcdf-c + if: steps.cache-netcdf-c.outputs.cache-hit != 'true' + run: | + set -x + export PATH="/home/runner/openmpi/bin:$PATH" + export CC=/home/runner/openmpi/bin/mpicc + wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.7.4.tar.gz &> /dev/null + tar -xzf netcdf-c-4.7.4.tar.gz + pushd netcdf-c-4.7.4 + ./configure --prefix=/home/runner/netcdf-c --disable-dap --disable-utilities + make -j + sudo make install + popd + - name: cache-netcdf-fortran + id: cache-netcdf-fortran + uses: actions/cache@v2 + with: + path: ~/netcdf-fortran + key: netcdf-fortran-${{ runner.os }}-4.5.3-openmpi-4.0.4 + + - name: build-netcdf-fortran + if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true' + run: | + set -x + export PATH="/home/runner/openmpi/bin:$PATH" + export CC=/home/runner/openmpi/bin/mpicc + wget https://github.com/Unidata/netcdf-fortran/archive/v4.5.3.tar.gz &> /dev/null + tar -xzf v4.5.3.tar.gz + pushd netcdf-fortran-4.5.3 + ./configure --prefix=/home/runner/netcdf-fortran + make -j + sudo make install + popd + - name: cache-pnetcdf + id: cache-pnetcdf + uses: actions/cache@v2 + with: + path: ~/pnetcdf + key: pnetcdf-${{ runner.os }}-1.12.1-openmpi-4.0.4 + + - name: build-pnetcdf + if: steps.cache-pnetcdf.outputs.cache-hit != 'true' + run: | + set -x + export PATH="/home/runner/openmpi/bin:$PATH" + export CC=/home/runner/openmpi/bin/mpicc + wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz &> /dev/null + tar -xzf pnetcdf-1.12.1.tar.gz + pushd pnetcdf-1.12.1 + ./configure --prefix=/home/runner/pnetcdf --enable-shared --disable-cxx + make + sudo make install + popd + - name: autoreconf + run: autoreconf -i + - name: pio build + run: | + set -x + echo 'export PATH=/home/runner/openmpi/bin:$PATH' > .bashrc + echo $'alias mpiexec=\'mpiexec --oversubscribe\'' >> .bashrc + cat .bashrc + source .bashrc + export PATH="/home/runner/openmpi/bin:$PATH" + export CC=/home/runner/openmpi/bin/mpicc + ./configure --with-mpiexec='mpiexec --oversubscribe' + which mpiexec + make check + + diff --git a/.github/workflows/autotools.yml b/.github/workflows/autotools.yml index 249b1f60d90..052487e8b8d 100644 --- a/.github/workflows/autotools.yml +++ b/.github/workflows/autotools.yml @@ -21,6 +21,12 @@ jobs: - uses: actions/checkout@v2 - name: Installs run: | + set -x + sudo gem install apt-spy2 + sudo apt-spy2 check + sudo apt-spy2 fix --commit + # after selecting a specific mirror, we need to run 'apt-get update' + sudo apt-get update sudo apt-get install netcdf-bin libnetcdf-dev doxygen graphviz wget gfortran libjpeg-dev libz-dev openmpi-bin libopenmpi-dev - name: cache-pnetcdf id: cache-pnetcdf diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d129c69c97d..bf1671b94f9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,6 +22,12 @@ jobs: - uses: actions/checkout@v2 - name: Installs run: | + set -x + sudo gem install apt-spy2 + sudo apt-spy2 check + sudo apt-spy2 fix --commit + # after selecting a specific mirror, we need to run 'apt-get update' + sudo apt-get update sudo apt-get install netcdf-bin libnetcdf-dev doxygen graphviz wget gfortran libjpeg-dev libz-dev openmpi-bin libopenmpi-dev - name: cache-pnetcdf diff --git a/.github/workflows/cmake_ncint.yml b/.github/workflows/cmake_ncint.yml index 4948619eb2b..53a67a59c26 100644 --- a/.github/workflows/cmake_ncint.yml +++ b/.github/workflows/cmake_ncint.yml @@ -22,6 +22,12 @@ jobs: - uses: actions/checkout@v2 - name: Installs run: | + set -x + sudo gem install apt-spy2 + sudo apt-spy2 check + sudo apt-spy2 fix --commit + # after selecting a specific mirror, we need to run 'apt-get update' + sudo apt-get update sudo apt-get install netcdf-bin libnetcdf-dev doxygen graphviz wget gfortran libjpeg-dev libz-dev openmpi-bin libopenmpi-dev - name: cache-pnetcdf diff --git a/.github/workflows/strict_autotools.yml b/.github/workflows/strict_autotools.yml index 2d581aefd4d..b47c4b1ba5f 100644 --- a/.github/workflows/strict_autotools.yml +++ b/.github/workflows/strict_autotools.yml @@ -21,6 +21,12 @@ jobs: - uses: actions/checkout@v2 - name: Installs run: | + set -x + sudo gem install apt-spy2 + sudo apt-spy2 check + sudo apt-spy2 fix --commit + # after selecting a specific mirror, we need to run 'apt-get update' + sudo apt-get update sudo apt-get install netcdf-bin libnetcdf-dev doxygen graphviz wget gfortran libjpeg-dev libz-dev openmpi-bin libopenmpi-dev - name: cache-pnetcdf diff --git a/CMakeLists.txt b/CMakeLists.txt index 00816692f4e..6f1023cf9eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -442,3 +442,12 @@ configure_file ( "${PROJECT_SOURCE_DIR}/cmake_config.h.in" "${PROJECT_BINARY_DIR}/config.h" ) + +# Configure test scripts. +set(MPIEXEC mpiexec) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/tests/cunit/run_tests.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/tests/cunit/run_tests.sh @ONLY) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/examples/c/run_tests.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/examples/c/run_tests.sh @ONLY) diff --git a/configure.ac b/configure.ac index 9aa23ff0bf5..63ed63e6309 100644 --- a/configure.ac +++ b/configure.ac @@ -202,6 +202,15 @@ if test "x$enable_developer_docs" = xyes; then fi AM_CONDITIONAL(BUILD_DOCS, [test "x$enable_docs" = xyes]) +# Did the user specify an MPI launcher other than mpiexec? +AC_MSG_CHECKING([whether a user specified program to run mpi programs]) +AC_ARG_WITH([mpiexec], + [AS_HELP_STRING([--with-mpiexec=], + [Specify command to launch MPI parallel tests.])], + [MPIEXEC=$with_mpiexec], [MPIEXEC=mpiexec]) +AC_MSG_RESULT([$MPIEXEC]) +AC_SUBST([MPIEXEC], [$MPIEXEC]) + # Is doxygen installed? AC_CHECK_PROGS([DOXYGEN], [doxygen]) if test -z "$DOXYGEN" -a "x$enable_docs" = xyes; then @@ -390,6 +399,10 @@ AM_CONDITIONAL(NETCDF_INTEGRATION, [test "x$enable_netcdf_integration" = xyes]) AC_CONFIG_FILES([tests/general/pio_tutil.F90:tests/general/util/pio_tutil.F90]) +# The user may have changed the MPIEXEC for these test scripts. +AC_CONFIG_FILES([tests/cunit/run_tests.sh], [chmod ugo+x tests/cunit/run_tests.sh]) +AC_CONFIG_FILES([examples/c/run_tests.sh], [chmod ugo+x examples/c/run_tests.sh]) + # Args: # 1. netcdf_meta.h variable # 2. conditional variable that is yes or no. diff --git a/examples/c/Makefile.am b/examples/c/Makefile.am index 64398761f13..82d1889ed63 100644 --- a/examples/c/Makefile.am +++ b/examples/c/Makefile.am @@ -16,7 +16,9 @@ TESTS = run_tests.sh endif # RUN_TESTS # Distribute the test script. -EXTRA_DIST = run_tests.sh CMakeLists.txt example2.c +EXTRA_DIST = run_tests.sh.in CMakeLists.txt example2.c # Clean up files produced during testing. CLEANFILES = *.nc *.log *.clog2 *.slog2 + +DISTCLEANFILES = run_tests.sh diff --git a/examples/c/run_tests.sh b/examples/c/run_tests.sh.in similarity index 88% rename from examples/c/run_tests.sh rename to examples/c/run_tests.sh.in index 0d369bbb53d..1caefa7585d 100755 --- a/examples/c/run_tests.sh +++ b/examples/c/run_tests.sh.in @@ -19,7 +19,7 @@ for EXAMPLE in $PIO_EXAMPLES do success1=false echo "running ${EXAMPLE}" - mpiexec -n 4 ./${EXAMPLE} && success1=true + @MPIEXEC@ -n 4 ./${EXAMPLE} && success1=true if test $success1 = false; then break fi @@ -29,7 +29,7 @@ for EXAMPLE in $PIO_EXAMPLES_16 do success2=false echo "running ${EXAMPLE}" - mpiexec -n 16 ./${EXAMPLE} && success2=true + @MPIEXEC@ -n 16 ./${EXAMPLE} && success2=true if test $success2 = false; then break fi diff --git a/tests/cunit/Makefile.am b/tests/cunit/Makefile.am index 78bf18f24bb..7a8edd61941 100644 --- a/tests/cunit/Makefile.am +++ b/tests/cunit/Makefile.am @@ -69,7 +69,9 @@ test_async_1d_SOURCES = test_async_1d.c pio_tests.h test_simple_SOURCES = test_simple.c test_common.c pio_tests.h # Distribute the test script. -EXTRA_DIST = run_tests.sh CMakeLists.txt test_darray_frame.c +EXTRA_DIST = run_tests.sh.in CMakeLists.txt test_darray_frame.c # Clean up files produced during testing. CLEANFILES = *.nc *.log decomp*.txt *.clog2 *.slog2 + +DISTCLEANFILES = run_tests.sh diff --git a/tests/cunit/run_tests.sh b/tests/cunit/run_tests.sh.in old mode 100755 new mode 100644 similarity index 93% rename from tests/cunit/run_tests.sh rename to tests/cunit/run_tests.sh.in index ee6c7b542c1..bd6e4f29215 --- a/tests/cunit/run_tests.sh +++ b/tests/cunit/run_tests.sh.in @@ -26,7 +26,7 @@ for TEST in $PIO_TESTS do success1=false echo "running ${TEST}" - mpiexec -n 4 ./${TEST} && success1=true + @MPIEXEC@ -n 4 ./${TEST} && success1=true if test $success1 = false; then break fi @@ -38,7 +38,7 @@ for TEST in $PIO_TESTS_8 do success2=false echo "running ${TEST}" - mpiexec -n 8 ./${TEST} && success2=true + @MPIEXEC@ -n 8 ./${TEST} && success2=true if test $success2 = false; then break fi