Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test flexible APIs only when PnetCDF-C >= 1.13.1 or mpi4py < 4.0.0 #24

Merged
merged 3 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/build_test_latest_c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Install python dependencies via pip
run: |
python -m pip install --upgrade pip
pip install numpy cython cftime pytest twine wheel check-manifest mpi4py==3.1.6
pip install numpy cython cftime pytest twine wheel check-manifest mpi4py

- name: Install pnetcdf
run: |
Expand Down
30 changes: 28 additions & 2 deletions examples/test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@
# Exit immediately if a command exits with a non-zero status.
set -e

MPI4PY_VERSION=`python -c "import mpi4py; print(mpi4py.__version__)"`
MPI4PY_VERSION_MAJOR=`echo ${MPI4PY_VERSION} | cut -d. -f1`
# echo "MPI4PY_VERSION=$MPI4PY_VERSION"
# echo "MPI4PY_VERSION_MAJOR=$MPI4PY_VERSION_MAJOR"

TEST_FLEXIBLE_API=no
if test "x$PNETCDF_DIR" != x ; then
PNETCDF_C_VERSION=`$PNETCDF_DIR/bin/pnetcdf-config --version | cut -d' ' -f2`
V_MAJOR=`echo ${PNETCDF_C_VERSION} | cut -d. -f1`
V_MINOR=`echo ${PNETCDF_C_VERSION} | cut -d. -f2`
V_SUB=`echo ${PNETCDF_C_VERSION} | cut -d. -f3`
VER_NUM=$((V_MAJOR*1000000 + V_MINOR*1000 + V_SUB))
if test $VER_NUM -gt 1013000 ; then
TEST_FLEXIBLE_API=yes
fi
fi

# test PnetCDF flexible APIs only when PnetCDF-C >= 1.13.1 or mpi4py < 4
if test $MPI4PY_VERSION_MAJOR -lt 4 ; then
TEST_FLEXIBLE_API=yes
fi

# Get the directory containing this script
if test "x$NPROC" = x ; then
NPROC=4
Expand All @@ -27,12 +49,11 @@ else
fi

echo ""
echo "---- Run programs wit $NPROC processes in folder 'examples' ---------------"
echo "---- Run programs with $NPROC processes in folder 'examples' --------------"

TETS_PROGS="collective_write.py
create_open.py
fill_mode.py
flexible_api.py
get_info.py
ghost_cell.py
global_attribute.py
Expand All @@ -45,6 +66,11 @@ TETS_PROGS="collective_write.py
put_vara.py
get_vara.py"

if test "x$TEST_FLEXIBLE_API" = xyes ; then
TETS_PROGS+=" flexible_api.py"
fi
# echo "TETS_PROGS=$TETS_PROGS"

for prog in $TETS_PROGS
do
# echo -n "---- Testing $prog with $NPROC MPI processes"
Expand Down
Loading