Skip to content

Commit

Permalink
Merge pull request ESMCI#1731 from NCAR/ejh_openmpi
Browse files Browse the repository at this point in the history
Add C testing with openmpi-4.0.4, netcdf-c-4.7.4, pnetcdf-1.12.1
  • Loading branch information
edwardhartnett authored Aug 25, 2020
2 parents 0043527 + 0f2db9d commit 00e667f
Show file tree
Hide file tree
Showing 11 changed files with 191 additions and 6 deletions.
135 changes: 135 additions & 0 deletions .github/workflows/a3.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions .github/workflows/autotools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/cmake_ncint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/strict_autotools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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=<command>],
[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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion examples/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions examples/c/run_tests.sh → examples/c/run_tests.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/cunit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/cunit/run_tests.sh → tests/cunit/run_tests.sh.in
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 00e667f

Please sign in to comment.