Skip to content

Merge pull request #62 from wkliao/openmpi #3

Merge pull request #62 from wkliao/openmpi

Merge pull request #62 from wkliao/openmpi #3

Workflow file for this run

name: Using OpenMPI
on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.txt'
pull_request:
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.txt'
jobs:
build-linux:
name: Python (${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 60
env:
OPENMPI_VERSION: 5.0.7
OPENMPI_DIR: ${{ github.workspace }}/ompi-install
PNETCDF_VERSION: 1.14.0
PNETCDF_DIR: ${{ github.workspace }}/PnetCDF-install
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Ubuntu Dependencies
run: |
sudo apt-get update
sudo apt-get install m4
- name: Build OPENMPI
run: |
echo "Install OpenMPI ${OPENMPI_VERSION} in $OPENMPI_DIR"
VER_MAJOR=${OPENMPI_VERSION%.*}
rm -rf OPENMPI ; mkdir OPENMPI ; cd OPENMPI
wget -q https://download.open-mpi.org/release/open-mpi/v${VER_MAJOR}/openmpi-${OPENMPI_VERSION}.tar.gz
gzip -dc openmpi-${OPENMPI_VERSION}.tar.gz | tar -xf -
cd openmpi-${OPENMPI_VERSION}
./configure --prefix=$OPENMPI_DIR \
--with-io-romio-flags="--with-file-system=ufs" \
--with-hwloc=internal \
--with-pmix=internal \
--with-libevent=internal \
--disable-mpi-fortran \
CC=gcc
make -s LIBTOOLFLAGS=--silent V=1 -j 4 install > qout 2>&1
make -s -j 4 distclean >> qout 2>&1
- name: Build PnetCDF-C official release
run: |
echo "Download and build PnetCDF-C release version ${PNETCDF_VERSION}"
wget -q https://parallel-netcdf.github.io/Release/pnetcdf-${PNETCDF_VERSION}.tar.gz
tar -xzf pnetcdf-${PNETCDF_VERSION}.tar.gz
pushd pnetcdf-${PNETCDF_VERSION}
./configure --prefix=$PNETCDF_DIR \
--silent \
--enable-shared \
--enable-debug \
--disable-fortran \
--disable-cxx \
--with-mpi=$OPENMPI_DIR
make -s LIBTOOLFLAGS=--silent V=1 -j 4 install > qout 2>&1
make -s -j 4 distclean >> qout 2>&1
popd
- name: Install python dependencies via pip
run: |
python -m pip install --upgrade pip setuptools wheel
pip install numpy cython cftime pytest twine check-manifest
export MPICC=$OPENMPI_DIR/bin/mpicc
pip install mpi4py
pip install torch torchvision
- name: Install PnetCDF-Python
run: |
export CC=$OPENMPI_DIR/bin/mpicc
pip install --verbose --no-build-isolation -e .
- name: Test PnetCDF-Python
run: |
export PATH=${OPENMPI_DIR}/bin:${PATH}
make ptests TESTMPIRUN="${OPENMPI_DIR}/bin/mpiexec --oversubscribe"
- name: Re-install PnetCDF-Python from source distribution
run: |
pip uninstall -y pnetcdf
make install-clean
export CC=$OPENMPI_DIR/bin/mpicc
python setup.py sdist
pip install --verbose dist/pnetcdf-*.tar.gz
- name: Test PnetCDF-Python
run: |
export PATH=${OPENMPI_DIR}/bin:${PATH}
make ptests TESTMPIRUN="${OPENMPI_DIR}/bin/mpiexec --oversubscribe"
# - name: Tarball
# run: |
# export PATH=${NETCDF_DIR}/bin:${PATH}
# python setup.py --version
# check-manifest --version
# check-manifest --verbose
# pip wheel . -w dist --no-deps
# twine check dist/*