Skip to content
Snippets Groups Projects
Commit 51adeb53 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

added min max refinement

parent 6ff6a318
No related merge requests found
GranularGas GranularGas
{ {
simulationCorner < 0, 0, 0 >; simulationCorner < 0, 0, 0 >;
simulationDomain < 80, 80, 80 >; simulationDomain < 40, 40, 40 >;
blocks < 1,1,1 >; blocks < 1,1,1 >;
isPeriodic < 0, 0, 0 >; isPeriodic < 0, 0, 0 >;
initialRefinementLevel 3; initialRefinementLevel 1;
sorting linear; sorting linear;
LBAlgorithm Morton; LBAlgorithm Morton;
baseWeight 1; baseWeight 1;
recalculateBlockLevelsInRefresh 1;
reevaluateMinTargetLevelsAfterForcedRefinement 1;
allowRefreshChangingDepth 1;
regridMin 2000;
regridMax 100;
normal <1,1,1>; normal <1,1,1>;
radius 0.6; radius 0.6;
spacing 1.0; spacing 1.0;
......
...@@ -136,8 +136,8 @@ int main( int argc, char ** argv ) ...@@ -136,8 +136,8 @@ int main( int argc, char ** argv )
auto ic = make_shared<pe::InfoCollection>(); auto ic = make_shared<pe::InfoCollection>();
// pe::amr::MinMaxLevelDetermination regrid(ic, regridMin, regridMax); pe::amr::MinMaxLevelDetermination regrid(ic, params.regridMin, params.regridMax);
// forest->setRefreshMinTargetLevelDeterminationFunction( regrid ); forest->setRefreshMinTargetLevelDeterminationFunction( regrid );
bool bRebalance = true; bool bRebalance = true;
if (params.LBAlgorithm == "None") if (params.LBAlgorithm == "None")
...@@ -259,6 +259,7 @@ int main( int argc, char ** argv ) ...@@ -259,6 +259,7 @@ int main( int argc, char ** argv )
WcTimingPool tpImbalanced; WcTimingPool tpImbalanced;
WcTimingPool tpBalanced; WcTimingPool tpBalanced;
WcTimer timerLoadBalancing;
WALBERLA_LOG_INFO_ON_ROOT("*** RUNNING UNBALANCED SIMULATION ***"); WALBERLA_LOG_INFO_ON_ROOT("*** RUNNING UNBALANCED SIMULATION ***");
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
...@@ -372,7 +373,10 @@ int main( int argc, char ** argv ) ...@@ -372,7 +373,10 @@ int main( int argc, char ** argv )
auto maxLinkedCells = walberla::mpi::reduce(lc->cells_.size(), walberla::mpi::MAX); auto maxLinkedCells = walberla::mpi::reduce(lc->cells_.size(), walberla::mpi::MAX);
WALBERLA_LOG_DEVEL_ON_ROOT( "linked cells: " << minLinkedCells << " / " << maxLinkedCells ); WALBERLA_LOG_DEVEL_ON_ROOT( "linked cells: " << minLinkedCells << " / " << maxLinkedCells );
vtkDomainOutput->write( );
vtkWriter->write();
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
timerLoadBalancing.start();
if (bRebalance) if (bRebalance)
{ {
WALBERLA_LOG_INFO_ON_ROOT("*** RUNNING LOAD BALANCING ***"); WALBERLA_LOG_INFO_ON_ROOT("*** RUNNING LOAD BALANCING ***");
...@@ -396,6 +400,9 @@ int main( int argc, char ** argv ) ...@@ -396,6 +400,9 @@ int main( int argc, char ** argv )
SNN(*ps, forest, domain); SNN(*ps, forest, domain);
sortParticleStorage(*ps, params.sorting, lc->domain_, uint_c(lc->numCellsPerDim_[0])); sortParticleStorage(*ps, params.sorting, lc->domain_, uint_c(lc->numCellsPerDim_[0]));
} }
timerLoadBalancing.end();
vtkDomainOutput->write( );
vtkWriter->write();
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
WALBERLA_LOG_INFO_ON_ROOT("*** RUNNING BALANCED SIMULATION ***"); WALBERLA_LOG_INFO_ON_ROOT("*** RUNNING BALANCED SIMULATION ***");
...@@ -527,6 +534,8 @@ int main( int argc, char ** argv ) ...@@ -527,6 +534,8 @@ int main( int argc, char ** argv )
auto tpBalancedReduced = tpBalanced.getReduced(); auto tpBalancedReduced = tpBalanced.getReduced();
WALBERLA_LOG_INFO_ON_ROOT(*tpBalancedReduced); WALBERLA_LOG_INFO_ON_ROOT(*tpBalancedReduced);
auto timerLoadBalancingReduced = walberla::timing::getReduced(timerLoadBalancing, REDUCE_TOTAL, 0);
numParticles = 0; numParticles = 0;
int64_t numGhostParticles = 0; int64_t numGhostParticles = 0;
ps->forEachParticle(false, ps->forEachParticle(false,
...@@ -582,6 +591,10 @@ int main( int argc, char ** argv ) ...@@ -582,6 +591,10 @@ int main( int argc, char ** argv )
integerProperties["balancedContactsChecked"] = balancedContactsChecked; integerProperties["balancedContactsChecked"] = balancedContactsChecked;
integerProperties["balancedContactsDetected"] = balancedContactsDetected; integerProperties["balancedContactsDetected"] = balancedContactsDetected;
integerProperties["balancedContactsTreated"] = balancedContactsTreated; integerProperties["balancedContactsTreated"] = balancedContactsTreated;
realProperties["loadbalancing_timer_min"] = timerLoadBalancingReduced->min();
realProperties["loadbalancing_timer_max"] = timerLoadBalancingReduced->max();
realProperties["loadbalancing_timer_average"] = timerLoadBalancingReduced->average();
realProperties["loadbalancing_timer_total"] = timerLoadBalancingReduced->total();
integerProperties["local_aabbs"] = int64_c(local_aabbs); integerProperties["local_aabbs"] = int64_c(local_aabbs);
integerProperties["neighbor_subdomains"] = int64_c(neighbor_subdomains); integerProperties["neighbor_subdomains"] = int64_c(neighbor_subdomains);
integerProperties["neighbor_processes"] = int64_c(neighbor_processes); integerProperties["neighbor_processes"] = int64_c(neighbor_processes);
......
...@@ -132,8 +132,8 @@ int main( int argc, char ** argv ) ...@@ -132,8 +132,8 @@ int main( int argc, char ** argv )
auto ic = make_shared<pe::InfoCollection>(); auto ic = make_shared<pe::InfoCollection>();
// pe::amr::MinMaxLevelDetermination regrid(ic, regridMin, regridMax); pe::amr::MinMaxLevelDetermination regrid(ic, params.regridMin, params.regridMax);
// forest->setRefreshMinTargetLevelDeterminationFunction( regrid ); forest->setRefreshMinTargetLevelDeterminationFunction( regrid );
bool bRebalance = true; bool bRebalance = true;
if (params.LBAlgorithm == "None") if (params.LBAlgorithm == "None")
...@@ -226,7 +226,6 @@ int main( int argc, char ** argv ) ...@@ -226,7 +226,6 @@ int main( int argc, char ** argv )
auto vtkWriter = walberla::vtk::createVTKOutput_PointData(vtkOutput, "Bodies", 1, params.vtk_out, "simulation_step", false, false); auto vtkWriter = walberla::vtk::createVTKOutput_PointData(vtkOutput, "Bodies", 1, params.vtk_out, "simulation_step", false, false);
vtkOutput->addOutput<SelectRank>("rank"); vtkOutput->addOutput<SelectRank>("rank");
vtkOutput->addOutput<data::SelectParticleOwner>("owner"); vtkOutput->addOutput<data::SelectParticleOwner>("owner");
vtkDomainOutput->write();
WALBERLA_LOG_INFO_ON_ROOT("*** SIMULATION - START ***"); WALBERLA_LOG_INFO_ON_ROOT("*** SIMULATION - START ***");
// Init kernels // Init kernels
...@@ -331,6 +330,8 @@ int main( int argc, char ** argv ) ...@@ -331,6 +330,8 @@ int main( int argc, char ** argv )
} }
timerImbalanced.end(); timerImbalanced.end();
vtkDomainOutput->write( );
vtkWriter->write();
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
timerLoadBalancing.start(); timerLoadBalancing.start();
if (bRebalance) if (bRebalance)
...@@ -357,6 +358,8 @@ int main( int argc, char ** argv ) ...@@ -357,6 +358,8 @@ int main( int argc, char ** argv )
sortParticleStorage(*ps, params.sorting, lc->domain_, uint_c(lc->numCellsPerDim_[0])); sortParticleStorage(*ps, params.sorting, lc->domain_, uint_c(lc->numCellsPerDim_[0]));
} }
timerLoadBalancing.end(); timerLoadBalancing.end();
vtkDomainOutput->write( );
vtkWriter->write();
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
WALBERLA_LOG_DEVEL_ON_ROOT("running balanced simulation"); WALBERLA_LOG_DEVEL_ON_ROOT("running balanced simulation");
......
...@@ -132,8 +132,8 @@ int main( int argc, char ** argv ) ...@@ -132,8 +132,8 @@ int main( int argc, char ** argv )
auto ic = make_shared<pe::InfoCollection>(); auto ic = make_shared<pe::InfoCollection>();
// pe::amr::MinMaxLevelDetermination regrid(ic, regridMin, regridMax); pe::amr::MinMaxLevelDetermination regrid(ic, params.regridMin, params.regridMax);
// forest->setRefreshMinTargetLevelDeterminationFunction( regrid ); forest->setRefreshMinTargetLevelDeterminationFunction( regrid );
bool bRebalance = true; bool bRebalance = true;
if (params.LBAlgorithm == "None") if (params.LBAlgorithm == "None")
...@@ -313,16 +313,18 @@ int main( int argc, char ** argv ) ...@@ -313,16 +313,18 @@ int main( int argc, char ** argv )
syncCallWithoutTT(); syncCallWithoutTT();
tpImbalanced["Sync"].end(); tpImbalanced["Sync"].end();
//if( i % visSpacing == 0 ) // if( i % params.visSpacing == 0 )
//{ // {
// vtkDomainOutput->write( ); // vtkDomainOutput->write( );
// vtkSphereOutput->write( ); // vtkSphereOutput->write( );
//} // }
} }
timerImbalanced.end(); timerImbalanced.end();
if (bRebalance) if (bRebalance)
{ {
vtkDomainOutput->write( );
vtkSphereOutput->write( );
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
timerLoadBalancing.start(); timerLoadBalancing.start();
WALBERLA_LOG_INFO_ON_ROOT("*** Rebalance ***"); WALBERLA_LOG_INFO_ON_ROOT("*** Rebalance ***");
...@@ -337,6 +339,8 @@ int main( int argc, char ** argv ) ...@@ -337,6 +339,8 @@ int main( int argc, char ** argv )
ccd->reloadBodies(); ccd->reloadBodies();
} }
timerLoadBalancing.end(); timerLoadBalancing.end();
vtkDomainOutput->write( );
vtkSphereOutput->write( );
} }
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
...@@ -355,11 +359,11 @@ int main( int argc, char ** argv ) ...@@ -355,11 +359,11 @@ int main( int argc, char ** argv )
syncCallWithoutTT(); syncCallWithoutTT();
tpBalanced["Sync"].end(); tpBalanced["Sync"].end();
//if( i % visSpacing == 0 ) // if( i % params.visSpacing == 0 )
//{ // {
// vtkDomainOutput->write( ); // vtkDomainOutput->write( );
// vtkSphereOutput->write( ); // vtkSphereOutput->write( );
//} // }
} }
timerBalanced.end(); timerBalanced.end();
......
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