Skip to content

nwchem_apptainer_mpich #126

nwchem_apptainer_mpich

nwchem_apptainer_mpich #126

name: nwchem_apptainer_mpich
on:
schedule:
- cron: '0 0 * * SUN'
repository_dispatch:
types: [backend_automation]
workflow_dispatch:
workflow_call:
jobs:
build_image:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
folder:
- nwchem-dev.mpich3
mpich:
- 3.4.2
fc:
- gfortran
cc:
- gcc
branch:
- master
armci_network:
- MPI-PR
- MPI3
mpich_device:
- ch4:ofi
ofi:
- builtin
- 1.21.1
- 1.18.3
- 1.15.2
- 1.12.1
- 1.11.2
- 1.10.1
- git
include:
- mpich: aurora
mpich_device: ch4:ofi
armci_network: MPI-PR
branch: master
fc: gfortran
cc: gcc
ofi: builtin
folder: nwchem-dev.mpich3
- mpich: aurora
mpich_device: ch4:ofi
armci_network: MPI-PR
branch: master
fc: gfortran
cc: gcc
ofi: git
folder: nwchem-dev.mpich3
- mpich: aurora
mpich_device: ch4:ofi
armci_network: MPI-PR
branch: master
fc: ifx
cc: icx
ofi: git
folder: nwchem-dev.mpich3
- mpich: 4.2.2
mpich_device: ch4:ofi
armci_network: MPI-PR
branch: master
fc: gfortran
cc: gcc
ofi: builtin
folder: nwchem-dev.mpich3
- mpich: 3.4.2
mpich_device: ch4:ofi
armci_network: MPI-PR
branch: hotfix/release-7-2-0
fc: gfortran
cc: gcc
ofi: builtin
folder: nwchem-dev.mpich3
env:
FC: ${{ matrix.fc }}
CC: ${{ matrix.cc }}
MPICH: ${{ matrix.mpich }}
MPICH_DEVICE: ${{ matrix.mpich_device }}
steps:
- name: nwchem version tag
run: |
if [[ ${{ matrix.branch }} == master ]]; then
echo "nwversion=dev" >> $GITHUB_ENV
else
echo "nwversion=720" >> $GITHUB_ENV
fi
if [[ ${{ matrix.armci_network }} != MPI-PR ]]; then
net_tag=$(echo ${{ matrix.armci_network }} | tr '[:upper:]' '[:lower:]')
echo "armci_network="${net_tag}"." >> $GITHUB_ENV
fi
if [[ ${{ matrix.mpich_device }} != ch4:ofi ]]; then
dev_tag=$(echo ${{ matrix.mpich_device }} | sed 's/:/_/' )
echo "mpich_device="${dev_tag} >> $GITHUB_ENV
fi
if [[ ${{ matrix.ofi }} != builtin ]]; then
echo "ofi=.libfabric"${{ matrix.ofi }} >> $GITHUB_ENV
fi
- name: tag
run: |
if [[ ${{ matrix.fc }} == "gfortran" ]]; then
echo "tag=oras://ghcr.io/${{ github.repository }}/nwchem-${{ env.nwversion}}.${{ env.armci_network}}mpich${{ matrix.mpich }}${{ env.ofi }}" >> $GITHUB_ENV
else
echo "tag=oras://ghcr.io/${{ github.repository }}/nwchem-${{ env.nwversion}}.${{ env.armci_network}}mpich${{ matrix.mpich }}${{ env.ofi }}.${{ matrix.fc }}" >> $GITHUB_ENV
fi
- name: echo-tag
run: |
echo ' the apptainer tag is ' "${{ env.tag }}"
- name: Checkout nwchem-singularity source
uses: actions/checkout@v4
with:
repository: edoapra/nwchem-singularity
clean: false
# path: nwchem-singularity
- name: pkg cleanup
uses: edoapra/ubuntu-pkg-cleanup@main
- name: Setup cache
id: setup-cache
uses: actions/cache@v4
with:
path: |
~/cache
key: ${{ matrix.folder}}-${{ matrix.mpich}}${{ matrix.ofi}}${{ matrix.mpich_device}}-${{ env.nwversion}}-nwchemcache-${{ matrix.fc}}-v002
- name: fetch cache
if: steps.setup-cache.outputs.cache-hit == 'true'
run: |
ls -lart ~/cache
if [[ -f ~/cache/mpich/lib/libmpi.a ]]; then \
echo "mpich cache present" ; \
fi
if [[ -f ~/pmix/etc/pmix-mca-params.conf ]]; then
echo "pmix cache present" ; \
fi
if [[ -f ~/cache/libext/lib/libnwc_openblas.a ]]; then \
echo "libext cache present" ; \
fi
if [[ -f ~/cache/simint_install/lib/libnwc_simint.a ]]; then \
echo "simint cache present" ; \
fi
if [[ -f ~/cache/ubuntu_jammy.sif ]]; then \
cp ~/cache/ubuntu_jammy.sif ${{ matrix.folder }}/. ; \
fi
- name: Install apptainer
env:
APP_VER: 1.2.3
run: |
sudo apt-get install -y libfuse2 libseccomp2 zlib1g uidmap squashfs-tools squashfuse fuse2fs fuse-overlayfs fakeroot
wget -q https://github.com/apptainer/apptainer/releases/download/v${APP_VER}/apptainer_${APP_VER}_amd64.deb
sudo dpkg -i apptainer_${APP_VER}_amd64.deb
which apptainer
apptainer version
- name: create sif from docker
if: steps.setup-cache.outputs.cache-hit != 'true'
run: |
cd ${{ matrix.folder }}
apptainer pull docker://ubuntu:jammy
- name: Checkout nwchem source
uses: actions/checkout@v4
with:
repository: nwchemgit/nwchem
ref: ${{ matrix.branch}}
clean: false
fetch-depth: 0
path: nwchem
- name: build an apptainer container
run: |
cd ${{ matrix.folder }}
MPICH_DEVICE=${{ matrix.mpich_device }} MPICH=${{ matrix.mpich }} OFI=${{ matrix.ofi }} FC=${{ matrix.fc }} BRANCH=${{ matrix.branch}} ARMCI_NETWORK=${{ matrix.armci_network}} MPI_IMPL=mpich apptainer build --fakeroot ${{ matrix.folder }}.simg Singularity
- name: store cache
if: steps.setup-cache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache || true
cd ${{ matrix.folder }}
apptainer exec ${{ matrix.folder }}.simg cp -r /opt/mpich ~/cache
apptainer exec ${{ matrix.folder }}.simg cp -r /opt/pmix ~/cache/. || true
apptainer exec ${{ matrix.folder }}.simg cp -rv /nwchem/src/libext ~/cache/. ||true
apptainer exec ${{ matrix.folder }}.simg rsync -av --copy-links /nwchem/src/NWints/simint/libsimint_source/simint_install ~/cache/. ||true
cp ubuntu_jammy.sif ~/cache/.
echo "cache stored"
ls -l ~/cache
- name: builddate
id: build-date
run: |
echo "date=$(TZ=America/Los_Angeles date +%Y%m%d_%H%M%S)" >> $GITHUB_ENV
- name: push to ghcr.io
run: |
echo ${{ secrets.GITHUB_TOKEN }} | apptainer remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
apptainer remote list
apptainer push ${{ matrix.folder }}/${{ matrix.folder }}.simg ${{ env.tag }}:${{ env.date }}
apptainer push ${{ matrix.folder }}/${{ matrix.folder }}.simg ${{ env.tag }}:latest
- name: ldd check
run: |
pwd
ls -la
apptainer pull -F ${{ env.tag }}:${{ env.date }}
sudo apt-get install -y libmpich-dev mpich
which mpirun
ldd `which mpirun`
apptainer exec ${{ env.tag }}:latest ldd /opt/nwchem/bin/nwchem
- name: test image with apptainer
run: |
pwd
ls -la
apptainer pull -F ${{ env.tag }}:${{ env.date }}
cd nwchem/QA
export MPIRUN_NPOPT=" -np"
set -x
sudo apt-get install -y openmpi-bin libmpich-dev mpich
if [[ ${{ matrix.mpich }} == aurora ]]; then
export MPIRUN_PATH=`which mpirun.openmpi`
else
export MPIRUN_PATH=`which mpirun.mpich`
fi
echo "MPIRUN_PATH is" $MPIRUN_PATH
mpirun --version || true
ldd `which mpirun`
export NWCHEM_EXECUTABLE="apptainer exec ${{ env.tag }}:latest nwchem"
./runtests.mpi.unix procs 2 dft_he2+
./runtests.mpi.unix procs 2 h2o_opt
- name: Install Singularity CE
env:
SG_VER: 4.0.0
run: |
sudo apt-get purge -y apptainer
sudo apt-get update && sudo apt-get install -y \
squashfs-tools pkg-config cryptsetup-bin libseccomp2 runc libglib2.0-0 || true
wget -q https://github.com/sylabs/singularity/releases/download/v${SG_VER}/singularity-ce_${SG_VER}-focal_amd64.deb
sudo dpkg -i singularity-ce_${SG_VER}-focal_amd64.deb
which singularity
singularity version
- name: test image with singularity
run: |
singularity pull -F ${{ env.tag }}:${{ env.date }}
cd nwchem/QA
export PATH=/opt/mpich/bin:$PATH
export MPIRUN_NPOPT=" -np"
set -x
if [[ ${{ matrix.mpich }} == aurora ]]; then
export MPIRUN_PATH=`which mpirun.openmpi`
else
export MPIRUN_PATH=`which mpirun.mpich`
fi
echo "MPIRUN_PATH is" $MPIRUN_PATH
mpirun --version || true
export LD_LIBRARY_PATH=/opt/ompi/lib:$LD_LIBRARY_PATH
export NWCHEM_EXECUTABLE="singularity exec ${{ env.tag }}:latest nwchem"
./runtests.mpi.unix procs 2 dft_he2+
./runtests.mpi.unix procs 2 h2o_opt