From 39bd27f227f08185ca33ebda83482dbcdd75a745 Mon Sep 17 00:00:00 2001
From: Markus Holzer <markus.holzer@fau.de>
Date: Wed, 22 May 2024 13:39:34 +0200
Subject: [PATCH] Added non Uniform case

---
 .../simulation_setup/benchmark_configs.py     | 21 +++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/apps/benchmarks/NonUniformGridGPU/simulation_setup/benchmark_configs.py b/apps/benchmarks/NonUniformGridGPU/simulation_setup/benchmark_configs.py
index c98290b3a..d17a69f56 100644
--- a/apps/benchmarks/NonUniformGridGPU/simulation_setup/benchmark_configs.py
+++ b/apps/benchmarks/NonUniformGridGPU/simulation_setup/benchmark_configs.py
@@ -134,28 +134,37 @@ def validation_run():
     scenarios.add(scenario)
 
 
-def scaling(num_proc, gpu_enabled_mpi=False):
+def scaling(num_proc, gpu_enabled_mpi=False, uniform=True):
     wlb.log_info_on_root("Running scaling benchmark...")
 
     if wlb.mpi.numProcesses() > 1:
         num_proc = wlb.mpi.numProcesses()
 
-    cells_per_block = (192, 192, 192)
-    domain_size = (cells_per_block[0] * 3, cells_per_block[1] * 3, cells_per_block[2] * 3 * num_proc)
+    if uniform:
+        factor = 3 * num_proc
+        name = "uniform"
+    else:
+        if num_proc % 4 != 0:
+            raise RuntimeError("Number of processes must be dividable by 4")
+        factor = int(num_proc // 4)
+        name = "nonuniform"
+
+    cells_per_block = (184, 184, 184)
+    domain_size = (cells_per_block[0] * 3, cells_per_block[1] * 3, cells_per_block[2] * factor)
 
     root_blocks = tuple([d // c for d, c in zip(domain_size, cells_per_block)])
 
     scenarios = wlb.ScenarioManager()
-    scenario = Scenario(blockforest_filestem=f"blockforest_{num_proc}",
+    scenario = Scenario(blockforest_filestem=f"blockforest_{name}_{num_proc}",
                         domain_size=domain_size,
                         root_blocks=root_blocks,
                         num_processes=4,
                         cells_per_block=cells_per_block,
-                        refinement_depth=0,
+                        refinement_depth=0 if uniform else 3,
                         timesteps=10,
                         gpu_enabled_mpi=gpu_enabled_mpi)
     scenarios.add(scenario)
 
 
 # validation_run()
-scaling(4, True)
+scaling(4, True, False)
-- 
GitLab