Skip to content
Snippets Groups Projects
Commit ce3aeedc authored by Jonas Plewinski's avatar Jonas Plewinski
Browse files

Merge branch 'RayleighBernardConvection' of i10git.cs.fau.de:walberla/walberla...

Merge branch 'RayleighBernardConvection' of i10git.cs.fau.de:walberla/walberla into RayleighBernardConvection
parents 5e12bd49 8421c49f
Branches
Tags
No related merge requests found
...@@ -361,9 +361,14 @@ int main(int argc, char** argv) ...@@ -361,9 +361,14 @@ int main(int argc, char** argv)
for (uint_t i = 0; i < warmupSteps; ++i) for (uint_t i = 0; i < warmupSteps; ++i)
timeloop.singleStep(); timeloop.singleStep();
//std::string performanceStatsFilename = "performance_" + scaling_type + "_" + std::to_string(blocks->getRootBlockXSize()) + ".txt";
std::string performanceStatsFilename = "performance.txt";
WALBERLA_LOG_INFO_ON_ROOT("________________________________________________________________________") WALBERLA_LOG_INFO_ON_ROOT("________________________________________________________________________")
WALBERLA_LOG_INFO_ON_ROOT("------------------------------------------------------------------------") WALBERLA_LOG_INFO_ON_ROOT("------------------------------------------------------------------------")
WALBERLA_LOG_INFO_ON_ROOT("Start benchmarking!") WALBERLA_LOG_INFO_ON_ROOT("Start benchmarking!")
real_t meanMLUPS = real_c(0.0);
real_t timePerTimestep = real_c(0);
for (uint_t i = 0; i < benchmarkingIterations; ++i) for (uint_t i = 0; i < benchmarkingIterations; ++i)
{ {
timeloop.setCurrentTimeStepToZero(); timeloop.setCurrentTimeStepToZero();
...@@ -378,9 +383,17 @@ int main(int argc, char** argv) ...@@ -378,9 +383,17 @@ int main(int argc, char** argv)
auto nrOfCells = real_c(cellsPerBlock[0] * cellsPerBlock[1] * cellsPerBlock[2]); auto nrOfCells = real_c(cellsPerBlock[0] * cellsPerBlock[1] * cellsPerBlock[2]);
auto mlupsPerProcess = nrOfCells * real_c(timesteps) / time * 1e-6; auto mlupsPerProcess = nrOfCells * real_c(timesteps) / time * 1e-6;
meanMLUPS += mlupsPerProcess;
timePerTimestep = real_c(time / real_c(timesteps));
WALBERLA_LOG_RESULT_ON_ROOT("MLUPS per process " << mlupsPerProcess) WALBERLA_LOG_RESULT_ON_ROOT("MLUPS per process " << mlupsPerProcess)
WALBERLA_LOG_RESULT_ON_ROOT("Time per time step " << time / real_c(timesteps)) WALBERLA_LOG_RESULT_ON_ROOT("Time per time step " << time / real_c(timesteps))
} }
WALBERLA_ROOT_SECTION() {
meanMLUPS /= real_t(benchmarkingIterations);
std::ofstream performanceStatsToFile(performanceStatsFilename, std::ios::app);
performanceStatsToFile << scaling_type << "; " << nrOfProcesses << "; " << blocks->getRootBlockXSize() << "; " << meanMLUPS << "; " << timePerTimestep << "\n";
performanceStatsToFile.close();
}
WALBERLA_LOG_INFO_ON_ROOT("Benchmarking done!") WALBERLA_LOG_INFO_ON_ROOT("Benchmarking done!")
WALBERLA_LOG_INFO_ON_ROOT("————————————————————————————————————————————————————————————————————————") WALBERLA_LOG_INFO_ON_ROOT("————————————————————————————————————————————————————————————————————————")
WALBERLA_LOG_INFO_ON_ROOT("————————————————————————————————————————————————————————————————————————") WALBERLA_LOG_INFO_ON_ROOT("————————————————————————————————————————————————————————————————————————")
......
...@@ -4,7 +4,7 @@ import math ...@@ -4,7 +4,7 @@ import math
class Scenario: class Scenario:
def __init__(self, weak_scaling=False, scaling_type=None, cells=(32, 32, 32)): def __init__(self, weak_scaling=False, scaling_type=None, cells=(32, 32, 32), timesteps=100):
#> Domain Parameters #> Domain Parameters
self.domain_size = (180, 100, 180) self.domain_size = (180, 100, 180)
self.blocks = (9, 2, 4) self.blocks = (9, 2, 4)
...@@ -13,7 +13,7 @@ class Scenario: ...@@ -13,7 +13,7 @@ class Scenario:
self.cells = cells self.cells = cells
#print(f"self.cells = {self.cells}") #print(f"self.cells = {self.cells}")
#> Standard Parameters #> Standard Parameters
self.timesteps = 500 self.timesteps = timesteps
self.vtk_write_frequency = 200 self.vtk_write_frequency = 200
self.scenario = 1 self.scenario = 1
#> Physical Parameters #> Physical Parameters
...@@ -53,7 +53,7 @@ class Scenario: ...@@ -53,7 +53,7 @@ class Scenario:
self.weakScaling = weak_scaling # True self.weakScaling = weak_scaling # True
self.scalingType = scaling_type #"fluid", "thermal", "rbc" self.scalingType = scaling_type #"fluid", "thermal", "rbc"
self.benchmarkingIterations = 5 self.benchmarkingIterations = 5
self.warmupSteps = 100 self.warmupSteps = 10
#?self.viscosity_SI = 1.516e-5 #? look #?self.viscosity_SI = 1.516e-5 #? look
#?self.thermal_diffusivity_SI = 2.074e-5 #? look #?self.thermal_diffusivity_SI = 2.074e-5 #? look
...@@ -116,16 +116,17 @@ class Scenario: ...@@ -116,16 +116,17 @@ class Scenario:
def runSimulation(): def runSimulation():
scenarios = wlb.ScenarioManager() scenarios = wlb.ScenarioManager()
scenarios.add(Scenario()) scenarios.add(Scenario(timesteps=10000))
def weakScalingBenchmark(): def weakScalingBenchmark():
scenarios = wlb.ScenarioManager() scenarios = wlb.ScenarioManager()
block_sizes = [(i, i, i) for i in (8, 16, 32, 64, 128)] block_sizes = [(i, i, i) for i in (8, 16, 32, 64, 128)]
timestepsPerBlockSize = [1024, 512, 256, 128, 64]
for scaling_type in ['rbc', 'fluid', 'thermal']: for scaling_type in ['rbc', 'fluid', 'thermal']:
for block_size in block_sizes: for block_size, timesteps in [(block_sizes[i], timestepsPerBlockSize[i]) for i in range(len(timestepsPerBlockSize))]:
scenario = Scenario(weak_scaling=True, scaling_type=scaling_type, cells=block_size) scenario = Scenario(weak_scaling=True, scaling_type=scaling_type, cells=block_size, timesteps=timesteps)
scenarios.add(scenario) scenarios.add(scenario)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment