Commit 96b705f8 authored by lmeinen's avatar lmeinen
Browse files

allow tuning of num_runs per implementation

parent c00b9f09
......@@ -14,8 +14,6 @@ CONFIG_NAME = "compile_run_config.json"
# set placeholder to projname
RESULTS_NAME = "{0}(_r[0-9]+)?-result-[0-9]+.txt"
NUM_RUNS = 20
def compile_all(base_build_dir: str, kokkos_dir: str):
""" build all experiments """
......@@ -42,14 +40,17 @@ def run_all_single_node(base_build_dir: str):
# for config in config_data["size-configs"] if config['matrix-size'] < 4096])
for run_config in config_data["run-configs-single-node"]:
build_dir = os.path.join(base_build_dir, run_config["build-dir"])
num_runs = run_config["num-runs"]
print(
"======================== {} ========================".format(build_dir))
for num_threads in config_data["bench-configs-single-node"]:
print("Setting number of threads to {}".format(
num_threads), flush=True)
os.environ["OMP_NUM_THREADS"] = str(num_threads)
# resolve placeholders
run_cmd = run_config["run-cmd"].format(num_threads,
NUM_RUNS, size_configs)
num_runs, size_configs)
subprocess.call("cd {}; {}".format(build_dir, run_cmd), shell=True)
print("")
......@@ -62,6 +63,7 @@ def run_all_multi_node(base_build_dir: str):
for config in config_data["size-configs"]])
for run_config in config_data["run-configs-multi-node"]:
build_dir = os.path.join(base_build_dir, run_config["build-dir"])
num_runs = run_config["num-runs"]
print(
"======================== {} ========================".format(build_dir), flush=True)
for bench_config in config_data["bench-configs-multi-node"]:
......@@ -71,7 +73,7 @@ def run_all_multi_node(base_build_dir: str):
num_nodes, num_threads), flush=True)
# resolve placeholders
run_cmd = run_config["run-cmd"].format(num_nodes,
num_threads, NUM_RUNS, size_configs)
num_threads, num_runs, size_configs)
subprocess.call("cd {}; {}".format(build_dir, run_cmd), shell=True)
print("", flush=True)
......
......@@ -4,91 +4,83 @@
"build-dir": "lu_omp",
"build-cmd": "make -j4 lu_bench"
},
{
"build-dir": "polybench",
"build-cmd": "make -j4 lu_bench"
},
{
"build-dir": "lu_mpi_omp",
"build-cmd": "make -j4 lu_bench"
},
{
"build-dir": "lu_mpi_kokkos/build",
"build-cmd": "cmake ../. -DKOKKOS_DIR={0} -DCMAKE_BUILD_TYPE=Release -DKokkos_ENABLE_OPENMP=ON; make -j4"
"build-cmd": "cmake ../. -DKOKKOS_DIR={0} -DCMAKE_BUILD_TYPE=Release; make -j4"
},
{
"build-dir": "lu_kokkos/build",
"build-cmd": "cmake ../. -DKOKKOS_DIR={0} -DCMAKE_BUILD_TYPE=Release -DKokkos_ENABLE_OPENMP=ON; make -j4"
"build-cmd": "cmake ../. -DKOKKOS_DIR={0} -DCMAKE_BUILD_TYPE=Release; make -j4"
},
{
"build-dir": "lu_kokkos_dag/build",
"build-cmd": "cmake ../. -DKOKKOS_DIR={0} -DCMAKE_BUILD_TYPE=Release -DKokkos_ENABLE_OPENMP=ON; make -j4"
"build-cmd": "cmake ../. -DKOKKOS_DIR={0} -DCMAKE_BUILD_TYPE=Release; make -j4"
}
],
"run-configs-multi-node": [
{
"build-dir": "lu_mpi_omp",
"run-cmd": "mpirun -n {0} --map-by node:PE=1 ./lu_bench.o {1} {2} {3}"
"run-cmd": "mpirun -n {0} --map-by node:PE=1 ./lu_bench.o {1} {2} {3}",
"num-runs": 20
},
{
"build-dir": "lu_mpi_kokkos/build",
"run-cmd": "mpirun -n {0} --map-by node:PE=1 ./lu_bench.o {1} {2} {3}"
"run-cmd": "mpirun -n {0} --map-by node:PE=1 ./lu_bench.o {1} {2} {3}",
"num-runs": 20
}
],
"run-configs-single-node": [
{
"build-dir": "lu_omp",
"run-cmd": "./lu_bench.o {0} {1} {2}"
"run-cmd": "./lu_bench.o {0} {1} {2}",
"num-runs": 3
},
{
"build-dir": "lu_kokkos/build",
"run-cmd": "./lu_bench.o {0} {1} {2}"
"run-cmd": "./lu_bench.o {0} {1} {2}",
"num-runs": 3
},
{
"build-dir": "lu_kokkos_dag/build",
"run-cmd": "./lu_bench.o {0} {1} {2}"
"run-cmd": "./lu_bench.o {0} {1} {2}",
"num-runs": 3
},
{
"build-dir": "polybench",
"run-cmd": "./lu_bench.o {0} {1} {2}",
"num-runs": 3
}
],
"bench-configs-single-node": [
1,
2,
4,
8,
16
],
"bench-configs-multi-node": [
{
"num-nodes": 1,
"num-threads": 4
},
{
"num-nodes": 2,
"num-threads": 4
},
{
"num-nodes": 4,
"num-threads": 4
},
{
"num-nodes": 8,
"num-threads": 4
},
{
"num-nodes": 16,
"num-threads": 4
}
4
],
"bench-configs-multi-node": [],
"size-configs": [
{
"matrix-size": 256,
"block-size": 128
"matrix-size": 1024,
"block-size": 4
},
{
"matrix-size": 512,
"block-size": 128
"matrix-size": 2048,
"block-size": 4
},
{
"matrix-size": 1024,
"block-size": 128
"matrix-size": 4096,
"block-size": 4
},
{
"matrix-size": 4096,
"block-size": 128
"matrix-size": 6144,
"block-size": 4
}
]
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment