Skip to content

Commit dcf84f6

Browse files
committed
Github Action: extract CI using PnetCDF master branch into another yaml file
Update MPICH version to 5.0.1 Update PnetCDF version to 1.15.0
1 parent 4414bc5 commit dcf84f6

2 files changed

Lines changed: 186 additions & 15 deletions

File tree

.github/workflows/main.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88
inputs:
99
reason:
10-
description: 'Enable manual run because PnetCDF is updated more frequently'
10+
description: 'Enable manual run'
1111
required: false
1212
default: 'Manual trigger'
1313
push:
@@ -24,9 +24,9 @@ on:
2424
- '**/*.txt'
2525

2626
env:
27-
MPICH_VERSION: 4.3.2
27+
MPICH_VERSION: 5.0.1
2828
OPENMPI_VERSION: 5.0.9
29-
PNETCDF_VERSION: 1.14.1
29+
PNETCDF_VERSION: 1.15.0
3030
LIBTOOL_VERSION: 2.5.4
3131
MPI_DIR: ${{ github.workspace }}/MPI
3232
PNETCDF_DIR: ${{ github.workspace }}/PnetCDF-install
@@ -38,7 +38,6 @@ jobs:
3838
matrix:
3939
python-version: ["3.10"]
4040
mpi_vendor: [ MPICH, OpenMPI ]
41-
pnetcdf_ver: [ release, master ]
4241

4342
runs-on: ubuntu-latest
4443
timeout-minutes: 60
@@ -105,7 +104,7 @@ jobs:
105104
make -s LIBTOOLFLAGS=--silent V=1 -j 8 distclean
106105
fi
107106
108-
- name: Build PnetCDF-C from ${{ matrix.pnetcdf_ver }}
107+
- name: Build PnetCDF-C from its latest release
109108
run: |
110109
set -x
111110
cd ${GITHUB_WORKSPACE}
@@ -115,16 +114,9 @@ jobs:
115114
autoconf --version
116115
automake --version
117116
libtool --version
118-
119-
if test "${{ matrix.pnetcdf_ver }}" = "master" ; then
120-
git clone -q https://github.com/Parallel-NetCDF/PnetCDF.git
121-
pushd PnetCDF
122-
autoreconf -i
123-
else
124-
wget -q https://parallel-netcdf.github.io/Release/pnetcdf-${PNETCDF_VERSION}.tar.gz
125-
tar -xzf pnetcdf-${PNETCDF_VERSION}.tar.gz
126-
pushd pnetcdf-${PNETCDF_VERSION}
127-
fi
117+
wget -q https://parallel-netcdf.github.io/Release/pnetcdf-${PNETCDF_VERSION}.tar.gz
118+
tar -xzf pnetcdf-${PNETCDF_VERSION}.tar.gz
119+
pushd pnetcdf-${PNETCDF_VERSION}
128120
./configure --prefix=$PNETCDF_DIR \
129121
--silent \
130122
--enable-shared \
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
name: Test using PnetCDF-C master branch
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
reason:
10+
description: 'Enable manual run'
11+
required: false
12+
default: 'Manual trigger'
13+
push:
14+
branches:
15+
- main
16+
paths-ignore:
17+
- '**/*.md'
18+
- '**/*.txt'
19+
pull_request:
20+
branches:
21+
- main
22+
paths-ignore:
23+
- '**/*.md'
24+
- '**/*.txt'
25+
26+
env:
27+
MPICH_VERSION: 5.0.1
28+
OPENMPI_VERSION: 5.0.9
29+
LIBTOOL_VERSION: 2.5.4
30+
MPI_DIR: ${{ github.workspace }}/MPI
31+
PNETCDF_DIR: ${{ github.workspace }}/PnetCDF-install
32+
33+
jobs:
34+
build:
35+
strategy:
36+
fail-fast: false # This disables the default cancel-on-failure behavior
37+
matrix:
38+
python-version: ["3.10"]
39+
mpi_vendor: [ MPICH, OpenMPI ]
40+
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 60
43+
44+
steps:
45+
46+
- uses: actions/checkout@v4
47+
48+
- name: Set up Python ${{ matrix.python-version }}
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
53+
- name: Install Ubuntu Dependencies
54+
run: |
55+
sudo apt-get update
56+
sudo apt-get install automake autoconf libtool libtool-bin m4
57+
58+
- name: Install GNU autotools
59+
run: |
60+
sudo apt-get update
61+
sudo apt-get install autoconf
62+
sudo apt-get install automake
63+
sudo apt-get install m4
64+
65+
wget -q https://ftp.gnu.org/gnu/libtool/libtool-${LIBTOOL_VERSION}.tar.gz
66+
gzip -dc libtool-${LIBTOOL_VERSION}.tar.gz | tar -xf -
67+
cd libtool-${LIBTOOL_VERSION}
68+
./configure --prefix=/usr --silent
69+
sudo make -s LIBTOOLFLAGS=--silent V=1 -j 8 install > qout 2>&1
70+
sudo make -s LIBTOOLFLAGS=--silent V=1 -j 8 distclean >> qout 2>&1
71+
72+
- name: Install MPI compiler vendor - ${{ matrix.mpi_vendor }}
73+
run: |
74+
set -x
75+
if test "${{ matrix.mpi_vendor }}" = "MPICH" ; then
76+
# MPICH versions older than 4.2.2 do not support the MPI large
77+
# count feature.
78+
echo "Install MPICH ${MPICH_VERSION} in ${GITHUB_WORKSPACE}/MPI"
79+
wget -q https://www.mpich.org/static/downloads/${MPICH_VERSION}/mpich-${MPICH_VERSION}.tar.gz
80+
gzip -dc mpich-${MPICH_VERSION}.tar.gz | tar -xf -
81+
cd mpich-${MPICH_VERSION}
82+
./configure --prefix=${MPI_DIR} \
83+
--silent \
84+
--enable-romio \
85+
--with-file-system=ufs \
86+
--with-device=ch3:sock \
87+
--disable-fortran \
88+
CC=gcc
89+
make -s LIBTOOLFLAGS=--silent V=1 -j 8 install
90+
make -s LIBTOOLFLAGS=--silent V=1 -j 8 distclean
91+
else # OpenMPI
92+
echo "Install OpenMPI ${OPENMPI_VERSION} in ${GITHUB_WORKSPACE}/MPI"
93+
VER_MAJOR=${OPENMPI_VERSION%.*}
94+
wget -q https://download.open-mpi.org/release/open-mpi/v${VER_MAJOR}/openmpi-${OPENMPI_VERSION}.tar.gz
95+
gzip -dc openmpi-${OPENMPI_VERSION}.tar.gz | tar -xf -
96+
cd openmpi-${OPENMPI_VERSION}
97+
./configure --prefix=${MPI_DIR} \
98+
--silent \
99+
--with-io-romio-flags="--with-file-system=ufs" \
100+
--disable-mpi-fortran \
101+
CC=gcc
102+
make -s LIBTOOLFLAGS=--silent V=1 -j 8 install
103+
make -s LIBTOOLFLAGS=--silent V=1 -j 8 distclean
104+
fi
105+
106+
- name: Build PnetCDF-C from its master branch
107+
run: |
108+
set -x
109+
cd ${GITHUB_WORKSPACE}
110+
export PATH="${MPI_DIR}/bin:${PATH}"
111+
export LD_LIBRARY_PATH="${MPI_DIR}/lib:${LD_LIBRARY_PATH}"
112+
m4 --version
113+
autoconf --version
114+
automake --version
115+
libtool --version
116+
git clone -q https://github.com/Parallel-NetCDF/PnetCDF.git
117+
git submodule update --init --recursive
118+
pushd PnetCDF
119+
autoreconf -i
120+
./configure --prefix=$PNETCDF_DIR \
121+
--silent \
122+
--enable-shared \
123+
--enable-debug \
124+
--disable-fortran \
125+
--disable-cxx \
126+
--with-mpi=$MPI_DIR
127+
make -s LIBTOOLFLAGS=--silent V=1 -j 4 install > qout 2>&1
128+
make -s -j 4 distclean >> qout 2>&1
129+
popd
130+
131+
- name: Install python dependencies via pip
132+
run: |
133+
python -m pip install --upgrade pip setuptools wheel
134+
pip install numpy cython cftime pytest twine check-manifest
135+
export MPICC=$MPI_DIR/bin/mpicc
136+
export CC=$MPI_DIR/bin/mpicc
137+
pip install mpi4py
138+
pip install torch torchvision
139+
140+
- name: Install PnetCDF-Python
141+
run: |
142+
export CC=$MPI_DIR/bin/mpicc
143+
pip install --verbose --no-build-isolation -e .
144+
145+
- name: Test PnetCDF-Python
146+
run: |
147+
export PATH=${PNETCDF_DIR}/bin:${MPI_DIR}/bin:${PATH}
148+
export LD_LIBRARY_PATH="${PNETCDF_DIR}/lib:${MPI_DIR}/lib:${LD_LIBRARY_PATH}"
149+
if test "${{ matrix.mpi_vendor }}" = "OpenMPI" ; then
150+
make ptests TESTMPIRUN="${MPI_DIR}/bin/mpiexec --oversubscribe"
151+
else
152+
make ptests TESTMPIRUN="${MPI_DIR}/bin/mpiexec"
153+
fi
154+
155+
- name: Re-install PnetCDF-Python from source distribution
156+
run: |
157+
pip uninstall -y pnetcdf
158+
make install-clean
159+
export CC=$MPI_DIR/bin/mpicc
160+
python setup.py sdist
161+
pip install --verbose dist/pnetcdf-*.tar.gz
162+
163+
- name: Test PnetCDF-Python
164+
run: |
165+
export PATH=${PNETCDF_DIR}/bin:${MPI_DIR}/bin:${PATH}
166+
export LD_LIBRARY_PATH="${PNETCDF_DIR}/lib:${MPI_DIR}/lib:${LD_LIBRARY_PATH}"
167+
if test "${{ matrix.mpi_vendor }}" = "OpenMPI" ; then
168+
make ptests TESTMPIRUN="${MPI_DIR}/bin/mpiexec --oversubscribe"
169+
else
170+
make ptests TESTMPIRUN="${MPI_DIR}/bin/mpiexec"
171+
fi
172+
# - name: Tarball
173+
# run: |
174+
# export PATH=${NETCDF_DIR}/bin:${PATH}
175+
# python setup.py --version
176+
# check-manifest --version
177+
# check-manifest --verbose
178+
# pip wheel . -w dist --no-deps
179+
# twine check dist/*

0 commit comments

Comments
 (0)