Skip to content

Commit 7f526bb

Browse files
committed
Setup reproducibility repository
1 parent 49569aa commit 7f526bb

File tree

72 files changed

+5442
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+5442
-6
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
This repository documents the software stack and the experimental setup
2+
of the manuscript: Automatic Code Generation for High-Performance
3+
Discontinuous Galerkin Methods on Modern Architectures.
4+
5+
It provides the technical details of how the results of the manuscript were
6+
achieved, but reproduction might require adapting its scripts and configuration
7+
files to your computing environment.
8+
9+
In general the procedure is:
10+
* Clone this repository recursively
11+
* Run ./patch.sh
12+
* Run ./build_{haswell,skylake}.sh
13+
* Go into the individual subfolders of build/dune-codegen-paper and apply this procedure to produce a plot:
14+
* Run the execution script (like `donkey.sbatch` or `skylake.sh`)
15+
(watch out for requirements on the working directory...)
16+
* If there, run `process.sh` to distill the data
17+
* Copy the resulting `csv` files into the source and commit them through `git-lfs`
18+
* Run `plot.py` in a suitable env (say through `run-in-dune-env`) to generate pdfs.
19+

build_haswell.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ml gcc/6.4.0
2+
ml benchmark/1.4.0
3+
ml python/3.6.3
4+
ml openmpi
5+
ml cmake
6+
ml openblas
7+
ml metis
8+
ml suite-sparse
9+
ml superlu
10+
ml parmetis
11+
12+
SuiteSparse_ROOT=$SUITESPARSE_DIR
13+
MAKE_FLAGS=-j40 ./dune-common/bin/dunecontrol --module=dune-codegen-paper --builddir=$(pwd)/build --opts=./opts/haswell.opts all
14+
15+
pushd build/dune-codegen-paper
16+
make -j40 haswell_poisson
17+
make -j40 haswell_stokes
18+
make -j40 costmodel_verification_poisson
19+
make -j40 costmodel_verification_poisson_skeleton
20+
popd

build_skylake.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
MAKE_FLAGS=-j40 ./dune-common/bin/dunecontrol --opts=skylake.opts --builddir=$(pwd)/build --module=dune-codegen-paper all
2+
3+
# Spin up the autotune build server that runs exclusively on socket 0 and have code generation happen exclusively
4+
# on socket 1. Communication between the two is realized through the file system, see the server implementation
5+
hwloc-bind socket:0 ./dune-codegen-paper/autotune-scripts/autotune_build_server.py mpirun --bind-to core -np 20 &
6+
sleep 0.2
7+
8+
AUTOTUNE_MAKE="hwloc-bind socket:1 make -j20"
9+
10+
pushd build/dune-codegen-paper
11+
$AUTOTUNE_MAKE skylake_poisson
12+
$AUTOTUNE_MAKE skylake_stokes
13+
popd
14+
15+
echo "exit" >> tasks.txt

dune-codegen

Submodule dune-codegen updated from ff379a1 to e713c62

dune-codegen-paper/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ dune_project()
2222

2323
dune_enable_all_packages()
2424

25-
add_subdirectory(src)
26-
add_subdirectory(dune)
27-
add_subdirectory(doc)
28-
add_subdirectory(cmake/modules)
25+
add_subdirectory(costmodel-verification)
26+
add_subdirectory(haswell-poisson)
27+
add_subdirectory(haswell-stokes)
28+
add_subdirectory(skylake-poisson)
29+
add_subdirectory(skylake-stokes)
2930

3031
# finalize the dune project, e.g. generating config.h etc.
3132
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
This is a small server-like application that can run commands that were written
5+
to a file. This is necessary to separate the code generation process from the
6+
autotune run environment, using the file system for synchronization.
7+
"""
8+
9+
import filelock
10+
import os
11+
import subprocess
12+
import sys
13+
import time
14+
15+
filename = "tasks.txt"
16+
open(filename, "w").close()
17+
lock = "{}.lock".format(filename)
18+
arg_prefix = sys.argv[1:]
19+
20+
keep_running = True
21+
while keep_running:
22+
with filelock.FileLock(lock):
23+
with open(filename, "r") as f:
24+
lines = f.readlines()
25+
26+
command = None
27+
if lines:
28+
command = lines[0].strip("\n")
29+
30+
if command == "exit":
31+
keep_running = False
32+
command = None
33+
34+
if command is not None:
35+
subprocess.call(arg_prefix + command.split())
36+
37+
with filelock.FileLock(lock):
38+
with open(filename, "r") as f:
39+
lines = f.readlines()
40+
41+
with open(filename, "w") as f:
42+
for line in lines[1:]:
43+
f.write(line)
44+
45+
time.sleep(0.1)
46+
47+
os.remove(filename)
48+
os.remove(lock)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python
2+
3+
import filelock
4+
import sys
5+
import time
6+
7+
filename = "/home/dkempf/dune-codegen-paper-software/tasks.txt"
8+
lock = "{}.lock".format(filename)
9+
command = " ".join(sys.argv[1:])
10+
11+
# Submit the command into the queue
12+
with filelock.FileLock(lock):
13+
with open(filename, "a") as f:
14+
f.write("{}\n".format(command))
15+
16+
# Poll the queue for our command still being in
17+
while True:
18+
found = False
19+
for line in open(filename, "r"):
20+
if command in line:
21+
found = True
22+
23+
if not found:
24+
sys.exit(0)
25+
26+
time.sleep(0.1)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
add_subdirectory(poisson_skeleton)
2+
add_subdirectory(poisson_volume)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dune_add_formcompiler_system_test(UFLFILE poisson_dg_tensor_skeleton.ufl
2+
BASENAME costmodel_verification_poisson_skeleton
3+
INIFILE costmodel_verification_poisson_skeleton.mini
4+
NO_TESTS
5+
)
Binary file not shown.

0 commit comments

Comments
 (0)