Skip to content

Commit 7d05e3a

Browse files
committed
Add WRF-IO benchmark
1 parent a493589 commit 7d05e3a

File tree

7 files changed

+4015
-2
lines changed

7 files changed

+4015
-2
lines changed

benchmarks/Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#
77
# @configure_input@
88

9-
SUBDIRS = C
10-
DIST_SUBDIRS = C FLASH-IO
9+
SUBDIRS = C WRF-IO
10+
DIST_SUBDIRS = C FLASH-IO WRF-IO
1111

1212
if HAS_FORTRAN
1313
if HAVE_MPI_MOD

benchmarks/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ various of APIs as well as access patterns.
4141
+ This benchmark is algorithmically identical to its I/O kernel.
4242
+ This distribution contains only PnetCDF I/O method.
4343

44+
* WRF-IO
45+
+ WRF (Wether Research and Forecast Model) is a weather prediction computer
46+
simulation program, https://github.com/wrf-model/WRF, developed at NCAR.
47+
+ This benchmark is an extraction of the I/O kernel of WRF and can be used
48+
to evaluate the file write performance of WRF.
49+
+ It's data partitioning pattern is a 2D block-block checkerboard pattern,
50+
along the longitude and latitude.
51+
52+
FLASH is a reacting hydrodynamics code developed at University of Chicago.
53+
https://astro.uchicago.edu/research/flash.php
54+
+ This benchmark is algorithmically identical to its I/O kernel.
55+
+ This distribution contains only PnetCDF I/O method.
56+
4457
Copyright (C) 2012, Northwestern University and Argonne National Laboratory.
4558
See COPYRIGHT notice in top-level directory.
4659

benchmarks/WRF-IO/Makefile.am

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#
2+
# Copyright (C) 2025, Northwestern University and Argonne National Laboratory
3+
# See COPYRIGHT notice in top-level directory.
4+
#
5+
# @configure_input@
6+
7+
SUFFIXES = .o .c
8+
9+
AM_CPPFLAGS = -I$(top_builddir)/src/include
10+
LDADD = $(top_builddir)/src/libs/libpnetcdf.la
11+
LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@
12+
13+
check_PROGRAMS = wrf_io
14+
15+
# parallel runs only
16+
# TESTS = $(check_PROGRAMS)
17+
18+
TESTS_ENVIRONMENT = export SED="$(SED)";
19+
TESTS_ENVIRONMENT += export srcdir="$(srcdir)";
20+
TESTS_ENVIRONMENT += export TESTOUTDIR="$(FSTYPE_PREFIX)$(TESTOUTDIR)";
21+
TESTS_ENVIRONMENT += export TESTSEQRUN="$(TESTSEQRUN)";
22+
TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN)";
23+
TESTS_ENVIRONMENT += export PNETCDF_DEBUG="$(PNETCDF_DEBUG)";
24+
TESTS_ENVIRONMENT += export TESTPROGRAMS="$(TESTPROGRAMS)";
25+
TESTS_ENVIRONMENT += export check_PROGRAMS="$(check_PROGRAMS)";
26+
TESTS_ENVIRONMENT += export ENABLE_BURST_BUFFER="$(ENABLE_BURST_BUFFER)";
27+
TESTS_ENVIRONMENT += export ENABLE_NETCDF4="$(ENABLE_NETCDF4)";
28+
29+
NC_FILES = $(check_PROGRAMS:%=$(TESTOUTDIR)/%.nc) \
30+
$(check_PROGRAMS:%=$(TESTOUTDIR)/%.bb.nc)
31+
32+
CLEANFILES = core core.* *.gcda *.gcno *.gcov gmon.out \
33+
$(NC_FILES)
34+
35+
EXTRA_DIST = parallel_run.sh wrf_header.txt
36+
37+
ptest2: $(check_PROGRAMS)
38+
@echo "==========================================================="
39+
@echo " $(subdir): Parallel testing on 2 MPI processes"
40+
@echo "==========================================================="
41+
@$(TESTS_ENVIRONMENT) \
42+
$(srcdir)/parallel_run.sh 2 || exit 1
43+
44+
ptest ptest4: $(check_PROGRAMS)
45+
@echo "==========================================================="
46+
@echo " $(subdir): Parallel testing on 4 MPI processes"
47+
@echo "==========================================================="
48+
@$(TESTS_ENVIRONMENT) \
49+
$(srcdir)/parallel_run.sh 4 || exit 1
50+
51+
ptest6: $(check_PROGRAMS)
52+
@echo "==========================================================="
53+
@echo " $(subdir): Parallel testing on 6 MPI processes"
54+
@echo "==========================================================="
55+
@$(TESTS_ENVIRONMENT) \
56+
$(srcdir)/parallel_run.sh 6 || exit 1
57+
58+
ptest8: $(check_PROGRAMS)
59+
@echo "==========================================================="
60+
@echo " $(subdir): Parallel testing on 8 MPI processes"
61+
@echo "==========================================================="
62+
@$(TESTS_ENVIRONMENT) \
63+
$(srcdir)/parallel_run.sh 8 || exit 1
64+
65+
ptest10: $(check_PROGRAMS)
66+
@echo "==========================================================="
67+
@echo " $(subdir): Parallel testing on 10 MPI processes"
68+
@echo "==========================================================="
69+
@$(TESTS_ENVIRONMENT) \
70+
$(srcdir)/parallel_run.sh 10 || exit 1
71+
72+
ptest16: $(check_PROGRAMS)
73+
@echo "==========================================================="
74+
@echo " $(subdir): Parallel testing on 16 MPI processes"
75+
@echo "==========================================================="
76+
@$(TESTS_ENVIRONMENT) \
77+
$(srcdir)/parallel_run.sh 16 || exit 1
78+
79+
# build check targets but not invoke
80+
tests-local: all $(check_PROGRAMS)
81+
82+
.PHONY: ptest ptests ptest2 ptest4 ptest6 ptest8 ptest10 ptest16
83+

benchmarks/WRF-IO/parallel_run.sh

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (C) 2025, Northwestern University and Argonne National Laboratory
4+
# See COPYRIGHT notice in top-level directory.
5+
#
6+
7+
# Exit immediately if a command exits with a non-zero status.
8+
set -e
9+
10+
VALIDATOR=../../src/utils/ncvalidator/ncvalidator
11+
NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff
12+
13+
# remove file system type prefix if there is any
14+
OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-`
15+
16+
MPIRUN=`echo ${TESTMPIRUN} | ${SED} -e "s/NP/$1/g"`
17+
# echo "MPIRUN = ${MPIRUN}"
18+
# echo "check_PROGRAMS=${check_PROGRAMS}"
19+
20+
# echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}"
21+
if test ${PNETCDF_DEBUG} = 1 ; then
22+
safe_modes="0 1"
23+
else
24+
safe_modes="0"
25+
fi
26+
27+
# prevent user environment setting of PNETCDF_HINTS to interfere
28+
unset PNETCDF_HINTS
29+
30+
for i in ${check_PROGRAMS} ; do
31+
for j in ${safe_modes} ; do
32+
for intra_aggr in 0 1 ; do
33+
if test "$j" = 1 ; then # test only in safe mode
34+
export PNETCDF_HINTS="romio_no_indep_rw=true"
35+
else
36+
export PNETCDF_HINTS=
37+
fi
38+
if test "$intra_aggr" = 1 ; then
39+
export PNETCDF_HINTS="${PNETCDF_HINTS};nc_num_aggrs_per_node=2"
40+
fi
41+
export PNETCDF_SAFE_MODE=$j
42+
# echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}"
43+
44+
OPTS="-l 100 -w 100"
45+
echo "${MPIRUN} ./$i -q ${OPTS} ${TESTOUTDIR}/$i.nc"
46+
${MPIRUN} ./$i -q ${OPTS} ${TESTOUTDIR}/$i.nc
47+
if test $? = 0 ; then
48+
echo "PASS: C parallel run on $1 processes --------------- $i"
49+
fi
50+
51+
# echo "--- validating file ${TESTOUTDIR}/$i.nc"
52+
${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$i.nc
53+
# echo ""
54+
55+
if test "x${ENABLE_BURST_BUFFER}" = x1 ; then
56+
# echo "test burst buffering feature"
57+
saved_PNETCDF_HINTS=${PNETCDF_HINTS}
58+
export PNETCDF_HINTS="${PNETCDF_HINTS};nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable"
59+
${MPIRUN} ./$i -q ${OPTS} ${TESTOUTDIR}/$i.bb.nc
60+
if test $? = 0 ; then
61+
echo "PASS: C parallel run on $1 processes --------------- $i"
62+
fi
63+
export PNETCDF_HINTS=${saved_PNETCDF_HINTS}
64+
65+
# echo "--- validating file ${TESTOUTDIR}/$i.bb.nc"
66+
${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$i.bb.nc
67+
68+
# echo "--- ncmpidiff $i.nc $i.bb.nc ---"
69+
${MPIRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/$i.nc ${TESTOUTDIR}/$i.bb.nc
70+
fi
71+
72+
if test "x${ENABLE_NETCDF4}" = x1 ; then
73+
# echo "test netCDF-4 feature"
74+
${MPIRUN} ./$i -q ${OPTS} ${TESTOUTDIR}/$i.nc4 4
75+
# Validator does not support nc4
76+
fi
77+
done
78+
done
79+
rm -f ${OUTDIR}/$i.nc
80+
rm -f ${OUTDIR}/$i.bb.nc
81+
rm -f ${OUTDIR}/$i.nc4
82+
done
83+

0 commit comments

Comments
 (0)