Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions .github/workflows/pnetcdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: PnetCDF

on:
push:
branches: main
pull_request:
branches: main

env:
PNETCDF_VERSION: 1.12.3

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install automake autoconf libtool libtool-bin m4
# mpi
sudo apt-get install mpich
# zlib
sudo apt-get install zlib1g-dev
- name: Install PnetCDF
run: |
echo "---- Install PnetCDF library into ${GITHUB_WORKSPACE}/PnetCDF"
cd ${GITHUB_WORKSPACE}
rm -rf PnetCDF
mkdir PnetCDF
cd PnetCDF
wget -cq https://parallel-netcdf.github.io/Release/pnetcdf-${PNETCDF_VERSION}.tar.gz
tar -zxf pnetcdf-${PNETCDF_VERSION}.tar.gz
cd pnetcdf-${PNETCDF_VERSION}
./configure --prefix=${GITHUB_WORKSPACE}/PnetCDF \
--silent \
--enable-shared \
MPICC=mpicc \
MPICXX=mpicxx \
MPIF77=mpifort \
MPIF90=mpifort
make -s LIBTOOLFLAGS=--silent V=1 -j 8 install > qout 2>&1
rm -f qout
- name: configure darshan-runtime and darshan-util
if: ${{ success() }}
run: |
cd ${GITHUB_WORKSPACE}
mkdir -p darshan_install
# Darshan installation path
export DARSHAN_INSTALL_PATH=${GITHUB_WORKSPACE}/darshan_install
# Darshan log file path
export DARSHAN_LOGPATH=${GITHUB_WORKSPACE}/logs
mkdir -p $DARSHAN_LOGPATH
# clone autoperf module
git submodule update --init
./prepare.sh
mkdir -p build
cd build
../configure --prefix=$DARSHAN_INSTALL_PATH \
--with-log-path-by-env=DARSHAN_LOGPATH \
--with-jobid-env=NONE \
--enable-pnetcdf-mod \
--with-pnetcdf=${GITHUB_WORKSPACE}/PnetCDF \
RUNTIME_CC=mpicc
- name: Dump configure log files if configure failed
if: ${{ failure() }}
run: |
cd ${GITHUB_WORKSPACE}/build
echo "-------- config.log --------"
cat config.log
echo "-------- darshan-runtime/config.log --------"
cat darshan-runtime/config.log
echo "-------- darshan-util/config.log --------"
cat darshan-util/config.log
- name: Test make, make check, and make install
if: ${{ success() }}
run: |
echo "make darshan-runtime and darshan-util"
cd ${GITHUB_WORKSPACE}/build
# Darshan log file path
export DARSHAN_LOGPATH=${GITHUB_WORKSPACE}/logs
make -j 8
echo "-------- make check --------"
make check
echo "-------- make install --------"
make install
- name: Run PnetCDF make check
run: |
cd ${GITHUB_WORKSPACE}/PnetCDF/pnetcdf-${PNETCDF_VERSION}
make -s LIBTOOLFLAGS=--silent V=1 -j 8 tests > qout 2>&1
# Darshan log file path
export DARSHAN_LOGPATH=${GITHUB_WORKSPACE}/logs
export LD_PRELOAD=${GITHUB_WORKSPACE}/darshan_install/lib/libdarshan.so

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add simple logic here to test for existence of expected number of Darshan logs for these tests or something? You can see in the workflow output that no log files are created because we never set the DARSHAN_LOGPATH env variable. I think the least we could do is assert that the expected number of logs was generated (and that the log path is correctly set so Darshan can write them).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting DARSHAN_LOGPATH has been added.

How does Darshah check the number of log files?
Note the number of PnetCDF test programs can increase in new releases.

make check
unset LD_PRELOAD
- name: Print PnetCDF log files if make check failed
if: ${{ failure() }}
run: |
cd ${GITHUB_WORKSPACE}/PnetCDF/pnetcdf-${PNETCDF_VERSION}
cat src/utils/ncvalidator/*.log
cat test/*/*.log
- name: Run PnetCDF make ptest
run: |
cd ${GITHUB_WORKSPACE}/PnetCDF/pnetcdf-${PNETCDF_VERSION}
# Darshan log file path
export DARSHAN_LOGPATH=${GITHUB_WORKSPACE}/logs
export LD_PRELOAD=${GITHUB_WORKSPACE}/darshan_install/lib/libdarshan.so
make ptest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check log files are correctly generated here, too? Later on, we could add a script that checks more in-depth details as part of the workflow, but something simple is fine for now.

Copy link
Collaborator Author

@wkliao wkliao Dec 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does one check whether a Darshan log file is correct or not?

unset LD_PRELOAD
make -s distclean >> qout 2>&1
rm -f qout
- name: Run Darshan make distcheck
if: ${{ success() }}
run: |
echo "make distcheck"
cd ${GITHUB_WORKSPACE}/build
make distcheck DISTCHECK_CONFIGURE_FLAGS="--with-log-path-by-env=DARSHAN_LOGPATH --with-jobid-env=NONE --enable-pnetcdf-mod --with-pnetcdf=${GITHUB_WORKSPACE}/PnetCDF RUNTIME_CC=mpicc"
- name: make distclean
run: |
echo "make distclean"
cd ${GITHUB_WORKSPACE}/build
make distclean