Skip to content

Commit 1b49285

Browse files
authored
[SPEC2017] Use correct input/output file paths for different benchmark types (#247)
These programs did not take into account the relationship between the benchmark type(rate vs. speed, test vs. train) and the input/output filenames. - 503.bwaves_r - 521.wrf_r - 554.roms_r - 603.bwaves_s - 621.wrf_s - 654.roms_s
1 parent 15f882d commit 1b49285

File tree

3 files changed

+37
-25
lines changed

3 files changed

+37
-25
lines changed

External/SPEC/CFP2017rate/503.bwaves_r/CMakeLists.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,19 @@ speccpu2017_run_test(
4848
RUN_TYPE ref
4949
)
5050

51-
speccpu2017_run_test(
52-
< "${RUN_ref_DIR_REL}/bwaves_3.in"
53-
STDOUT bwaves_3.out
54-
RUN_TYPE ref
55-
)
51+
if (BENCHMARK_SUITE_TYPE STREQUAL rate)
52+
speccpu2017_run_test(
53+
< "${RUN_ref_DIR_REL}/bwaves_3.in"
54+
STDOUT bwaves_3.out
55+
RUN_TYPE ref
56+
)
5657

57-
speccpu2017_run_test(
58-
< "${RUN_ref_DIR}/bwaves_4.in"
59-
STDOUT bwaves_4.out
60-
RUN_TYPE ref
61-
)
58+
speccpu2017_run_test(
59+
< "${RUN_ref_DIR}/bwaves_4.in"
60+
STDOUT bwaves_4.out
61+
RUN_TYPE ref
62+
)
63+
endif ()
6264

6365

6466
################################################################################

External/SPEC/CFP2017rate/521.wrf_r/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ speccpu2017_benchmark(RATE)
1717
# that will be processed by specpp and is common to ${PROG} and ${VALIDATOR}
1818
# wrf_netcdf an object library for the netcdf sources
1919

20-
# There is only one argument to the validator. Only the location
21-
# of the reference data changes. Tolerances and filenames are hard
22-
# coded.
23-
#
2420
# ${SPECDIFF_BIN} is used to check that all the test pass in
2521
# diffwrf_output_01.txt. We replace this with a call to `diff -b` so
2622
# that SPEC need not be installed. The `-b` is used to ignore
2723
# extraneous whitespace.
2824
macro(wrf_validator)
29-
cmake_parse_arguments(_carg "" "RUN_TYPE" "" ${ARGN})
25+
cmake_parse_arguments(_carg "" "RUN_TYPE;WRF_OUT_FILE" "" ${ARGN})
3026

3127
set(VALIDATOR wrf_validate-target_${BENCHMARK_SUITE_TYPE})
3228
if (NOT TARGET ${VALIDATOR})
@@ -41,7 +37,7 @@ macro(wrf_validator)
4137
llvm_test_verify(WORKDIR ${RUN_${_carg_RUN_TYPE}_DIR_REL}
4238
"%S/${VALIDATOR}"
4339
"${RUN_${_carg_RUN_TYPE}_DIR_REL}/compare/wrf_reference_01"
44-
wrfout_d01_2000-01-24_14_00_00 >
40+
${_carg_WRF_OUT_FILE} >
4541
"${RUN_${_carg_RUN_TYPE}_DIR_REL}/diffwrf_output_01.txt" &&
4642
diff -b "${RUN_${_carg_RUN_TYPE}_DIR_REL}/diffwrf_output_01.txt" "${RUN_${_carg_RUN_TYPE}_DIR_REL}/compare/diffwrf_output_01.txt"
4743
RUN_TYPE ${_carg_RUN_TYPE}
@@ -79,19 +75,24 @@ endif ()
7975

8076
speccpu2017_run_test(RUN_TYPE test)
8177

82-
wrf_validator(RUN_TYPE test)
78+
wrf_validator(RUN_TYPE test WRF_OUT_FILE wrfout_d01_2000-01-24_12_10_00)
8379

8480
## train #######################################################################
8581

8682
speccpu2017_run_test(RUN_TYPE train)
8783

88-
wrf_validator(RUN_TYPE train)
84+
wrf_validator(RUN_TYPE train WRF_OUT_FILE wrfout_d01_2000-01-24_14_00_00)
8985

9086
## ref #########################################################################
9187

9288
speccpu2017_run_test(RUN_TYPE ref)
9389

94-
wrf_validator(RUN_TYPE ref)
90+
if (BENCHMARK_SUITE_TYPE STREQUAL rate)
91+
wrf_validator(RUN_TYPE ref WRF_OUT_FILE wrfout_d01_2000-01-24_20_00_00)
92+
endif ()
93+
if (BENCHMARK_SUITE_TYPE STREQUAL speed)
94+
wrf_validator(RUN_TYPE ref WRF_OUT_FILE wrfout_d01_2000-01-24_15_00_00)
95+
endif ()
9596

9697
################################################################################
9798

External/SPEC/CFP2017rate/554.roms_r/CMakeLists.txt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,22 @@ speccpu2017_run_test(
3737
)
3838

3939
## ref #########################################################################
40-
41-
speccpu2017_run_test(
42-
< ocean_benchmark2.in.x
43-
STDOUT ocean_benchmark2.log
44-
STDERR ocean_benchmark2.err
45-
RUN_TYPE ref
40+
if (BENCHMARK_SUITE_TYPE STREQUAL rate)
41+
speccpu2017_run_test(
42+
< ocean_benchmark2.in.x
43+
STDOUT ocean_benchmark2.log
44+
STDERR ocean_benchmark2.err
45+
RUN_TYPE ref
4646
)
47+
endif ()
48+
if (BENCHMARK_SUITE_TYPE STREQUAL speed)
49+
speccpu2017_run_test(
50+
< ocean_benchmark3.in.x
51+
STDOUT ocean_benchmark3.log
52+
STDERR ocean_benchmark3.err
53+
RUN_TYPE ref
54+
)
55+
endif ()
4756

4857
################################################################################
4958

0 commit comments

Comments
 (0)