forked from devitocodes/devito
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4c863c
commit 09b2c14
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# Simple script to run single threaded benchmarks locally, | ||
# for simple sanity checks. | ||
|
||
# Don't use OpenMP | ||
unset DEVITO_LANGUAGE | ||
# Use the cray compiler, if available. | ||
export DEVITO_ARCH=cray | ||
# Enable debug logging. | ||
export DEVITO_LOGGING=DEBUG | ||
# Enable (tile size) autotuning | ||
# NB enabling it requires that no explicit tile size | ||
# is specified in the Operator constructor args. | ||
export DEVITO_AUTOTUNING=aggressive | ||
|
||
# Just extract the reported runtime from the whole output of the passed command | ||
get_runtime() { | ||
$@ |& grep 'Operator.*ran' | rev | cut -d ' ' -f2 | rev | ||
} | ||
|
||
# Iterate over benchmarks and cases, print simple CSV data to stdout | ||
# Copy-pastes nicely in Google Sheets | ||
echo bench_name,so,Devito,xDSL | ||
for bench in "wave2d_b.py -d 2048 2048 --nt 512" "wave3d_b.py -d 512 512 512 --nt 512" "diffusion_3D_wBCs.py -d 512 512 512 --nt 512" "diffusion_2D_wBCs.py -d 2048 2048 --nt 512" | ||
do | ||
# Get the benchmark file for printing | ||
bench_name=$(echo $bench | cut -d ' ' -f1) | ||
# Iterate over measured space orders | ||
for so in 2 4 8 | ||
do | ||
# Get the runtimes | ||
devito_time=$(get_runtime python $bench -so $so --devito 1) | ||
xdsl_time=$(get_runtime python $bench -so $so --xdsl 1) | ||
# print CSV line | ||
echo $bench_name,$so,$devito_time,$xdsl_time | ||
done | ||
done |