Skip to content

Commit

Permalink
Add WRF-IO benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
wkliao committed Feb 15, 2025
1 parent a493589 commit 7d05e3a
Show file tree
Hide file tree
Showing 7 changed files with 4,015 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benchmarks/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#
# @configure_input@

SUBDIRS = C
DIST_SUBDIRS = C FLASH-IO
SUBDIRS = C WRF-IO
DIST_SUBDIRS = C FLASH-IO WRF-IO

if HAS_FORTRAN
if HAVE_MPI_MOD
Expand Down
13 changes: 13 additions & 0 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ various of APIs as well as access patterns.
+ This benchmark is algorithmically identical to its I/O kernel.
+ This distribution contains only PnetCDF I/O method.

* WRF-IO
+ WRF (Wether Research and Forecast Model) is a weather prediction computer
simulation program, https://github.com/wrf-model/WRF, developed at NCAR.
+ This benchmark is an extraction of the I/O kernel of WRF and can be used
to evaluate the file write performance of WRF.
+ It's data partitioning pattern is a 2D block-block checkerboard pattern,
along the longitude and latitude.

FLASH is a reacting hydrodynamics code developed at University of Chicago.
https://astro.uchicago.edu/research/flash.php
+ This benchmark is algorithmically identical to its I/O kernel.
+ This distribution contains only PnetCDF I/O method.

Copyright (C) 2012, Northwestern University and Argonne National Laboratory.
See COPYRIGHT notice in top-level directory.

83 changes: 83 additions & 0 deletions benchmarks/WRF-IO/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#
# Copyright (C) 2025, Northwestern University and Argonne National Laboratory
# See COPYRIGHT notice in top-level directory.
#
# @configure_input@

SUFFIXES = .o .c

AM_CPPFLAGS = -I$(top_builddir)/src/include
LDADD = $(top_builddir)/src/libs/libpnetcdf.la
LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@

check_PROGRAMS = wrf_io

# parallel runs only
# TESTS = $(check_PROGRAMS)

TESTS_ENVIRONMENT = export SED="$(SED)";
TESTS_ENVIRONMENT += export srcdir="$(srcdir)";
TESTS_ENVIRONMENT += export TESTOUTDIR="$(FSTYPE_PREFIX)$(TESTOUTDIR)";
TESTS_ENVIRONMENT += export TESTSEQRUN="$(TESTSEQRUN)";
TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN)";
TESTS_ENVIRONMENT += export PNETCDF_DEBUG="$(PNETCDF_DEBUG)";
TESTS_ENVIRONMENT += export TESTPROGRAMS="$(TESTPROGRAMS)";
TESTS_ENVIRONMENT += export check_PROGRAMS="$(check_PROGRAMS)";
TESTS_ENVIRONMENT += export ENABLE_BURST_BUFFER="$(ENABLE_BURST_BUFFER)";
TESTS_ENVIRONMENT += export ENABLE_NETCDF4="$(ENABLE_NETCDF4)";

NC_FILES = $(check_PROGRAMS:%=$(TESTOUTDIR)/%.nc) \
$(check_PROGRAMS:%=$(TESTOUTDIR)/%.bb.nc)

CLEANFILES = core core.* *.gcda *.gcno *.gcov gmon.out \
$(NC_FILES)

EXTRA_DIST = parallel_run.sh wrf_header.txt

ptest2: $(check_PROGRAMS)
@echo "==========================================================="
@echo " $(subdir): Parallel testing on 2 MPI processes"
@echo "==========================================================="
@$(TESTS_ENVIRONMENT) \
$(srcdir)/parallel_run.sh 2 || exit 1

ptest ptest4: $(check_PROGRAMS)
@echo "==========================================================="
@echo " $(subdir): Parallel testing on 4 MPI processes"
@echo "==========================================================="
@$(TESTS_ENVIRONMENT) \
$(srcdir)/parallel_run.sh 4 || exit 1

ptest6: $(check_PROGRAMS)
@echo "==========================================================="
@echo " $(subdir): Parallel testing on 6 MPI processes"
@echo "==========================================================="
@$(TESTS_ENVIRONMENT) \
$(srcdir)/parallel_run.sh 6 || exit 1

ptest8: $(check_PROGRAMS)
@echo "==========================================================="
@echo " $(subdir): Parallel testing on 8 MPI processes"
@echo "==========================================================="
@$(TESTS_ENVIRONMENT) \
$(srcdir)/parallel_run.sh 8 || exit 1

ptest10: $(check_PROGRAMS)
@echo "==========================================================="
@echo " $(subdir): Parallel testing on 10 MPI processes"
@echo "==========================================================="
@$(TESTS_ENVIRONMENT) \
$(srcdir)/parallel_run.sh 10 || exit 1

ptest16: $(check_PROGRAMS)
@echo "==========================================================="
@echo " $(subdir): Parallel testing on 16 MPI processes"
@echo "==========================================================="
@$(TESTS_ENVIRONMENT) \
$(srcdir)/parallel_run.sh 16 || exit 1

# build check targets but not invoke
tests-local: all $(check_PROGRAMS)

.PHONY: ptest ptests ptest2 ptest4 ptest6 ptest8 ptest10 ptest16

83 changes: 83 additions & 0 deletions benchmarks/WRF-IO/parallel_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/bin/sh
#
# Copyright (C) 2025, Northwestern University and Argonne National Laboratory
# See COPYRIGHT notice in top-level directory.
#

# Exit immediately if a command exits with a non-zero status.
set -e

VALIDATOR=../../src/utils/ncvalidator/ncvalidator
NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff

# remove file system type prefix if there is any
OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-`

MPIRUN=`echo ${TESTMPIRUN} | ${SED} -e "s/NP/$1/g"`
# echo "MPIRUN = ${MPIRUN}"
# echo "check_PROGRAMS=${check_PROGRAMS}"

# echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}"
if test ${PNETCDF_DEBUG} = 1 ; then
safe_modes="0 1"
else
safe_modes="0"
fi

# prevent user environment setting of PNETCDF_HINTS to interfere
unset PNETCDF_HINTS

for i in ${check_PROGRAMS} ; do
for j in ${safe_modes} ; do
for intra_aggr in 0 1 ; do
if test "$j" = 1 ; then # test only in safe mode
export PNETCDF_HINTS="romio_no_indep_rw=true"
else
export PNETCDF_HINTS=
fi
if test "$intra_aggr" = 1 ; then
export PNETCDF_HINTS="${PNETCDF_HINTS};nc_num_aggrs_per_node=2"
fi
export PNETCDF_SAFE_MODE=$j
# echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}"

OPTS="-l 100 -w 100"
echo "${MPIRUN} ./$i -q ${OPTS} ${TESTOUTDIR}/$i.nc"
${MPIRUN} ./$i -q ${OPTS} ${TESTOUTDIR}/$i.nc
if test $? = 0 ; then
echo "PASS: C parallel run on $1 processes --------------- $i"
fi

# echo "--- validating file ${TESTOUTDIR}/$i.nc"
${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$i.nc
# echo ""

if test "x${ENABLE_BURST_BUFFER}" = x1 ; then
# echo "test burst buffering feature"
saved_PNETCDF_HINTS=${PNETCDF_HINTS}
export PNETCDF_HINTS="${PNETCDF_HINTS};nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable"
${MPIRUN} ./$i -q ${OPTS} ${TESTOUTDIR}/$i.bb.nc
if test $? = 0 ; then
echo "PASS: C parallel run on $1 processes --------------- $i"
fi
export PNETCDF_HINTS=${saved_PNETCDF_HINTS}

# echo "--- validating file ${TESTOUTDIR}/$i.bb.nc"
${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$i.bb.nc

# echo "--- ncmpidiff $i.nc $i.bb.nc ---"
${MPIRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/$i.nc ${TESTOUTDIR}/$i.bb.nc
fi

if test "x${ENABLE_NETCDF4}" = x1 ; then
# echo "test netCDF-4 feature"
${MPIRUN} ./$i -q ${OPTS} ${TESTOUTDIR}/$i.nc4 4
# Validator does not support nc4
fi
done
done
rm -f ${OUTDIR}/$i.nc
rm -f ${OUTDIR}/$i.bb.nc
rm -f ${OUTDIR}/$i.nc4
done

Loading

0 comments on commit 7d05e3a

Please sign in to comment.