diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2009-09-03 16:19:15 -0500 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2011-12-14 16:42:31 +0000 |
commit | 11c4d98017cbb86d08e15fd1b549180184b58a26 (patch) | |
tree | 2546a154c6f7bc0bec87de7316125ae7d1453569 /Carpet/LoopControl | |
parent | f520477b1c14e02f1495cfa8d3e09f4e21ab34d0 (diff) |
Import Carpet
Ignore-this: 309b4dd613f4af2b84aa5d6743fdb6b3
Diffstat (limited to 'Carpet/LoopControl')
-rw-r--r-- | Carpet/LoopControl/README | 7 | ||||
-rw-r--r-- | Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.hill.par | 132 | ||||
-rw-r--r-- | Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.legacy.par | 132 | ||||
-rw-r--r-- | Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.par | 132 | ||||
-rw-r--r-- | Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.standard.par | 132 | ||||
-rw-r--r-- | Carpet/LoopControl/src/loopcontrol.h | 24 |
6 files changed, 554 insertions, 5 deletions
diff --git a/Carpet/LoopControl/README b/Carpet/LoopControl/README index 50e2eacb5..f3c5055b2 100644 --- a/Carpet/LoopControl/README +++ b/Carpet/LoopControl/README @@ -1,9 +1,10 @@ Cactus Code Thorn LoopControl -Thorn Author(s) : Erik Schnetter <schnetter@cct.lsu.edu> -Thorn Maintainer(s) : Erik Schnetter <schnetter@cct.lsu.edu> +Author(s) : Erik Schnetter <schnetter@cct.lsu.edu> +Maintainer(s): Erik Schnetter <schnetter@cct.lsu.edu> +Licence : GPLv2+ -------------------------------------------------------------------------- -Purpose of the thorn: +1. Purpose Iterate over multi-dimensional arrays in an efficient manner, using OpenMP (if available) and cach-aware loop tiling. diff --git a/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.hill.par b/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.hill.par new file mode 100644 index 000000000..c7cac7fdd --- /dev/null +++ b/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.hill.par @@ -0,0 +1,132 @@ +Cactus::cctk_run_title = "Benchmark of McLachlan using Carpet with one refinement level" +Cactus::cctk_timer_output = "full" + +Cactus::cctk_itlast = @ITERATIONS@ + + + +ActiveThorns = "Fortran" + + + +ActiveThorns = "LoopControl" + +#LoopControl::printstats = yes + +LoopControl::legacy_init = no +LoopControl::use_random_restart_hill_climbing = yes + + + +ActiveThorns = "IOUtil" + +#IO::print_timing_info = yes + + + +ActiveThorns = "InitBase" + + + +ActiveThorns = "Carpet CarpetLib CarpetReduce" + +Carpet::domain_from_coordbase = yes + +driver::ghost_size = 3 + +Carpet::init_fill_timelevels = yes + +CarpetLib::combine_recompose = yes + +#CarpetLib::print_timestats_every = 1 +CarpetLib::print_memstats_every = @ITERATIONS@ + + + +ActiveThorns = "Boundary CartGrid3D CoordBase SymBase" + +CoordBase::domainsize = "minmax" +CoordBase::xmin = 0.0 +CoordBase::ymin = 0.0 +CoordBase::zmin = 0.0 +CoordBase::xmax = 1.0 +CoordBase::ymax = 1.0 +CoordBase::zmax = 1.0 + +CoordBase::spacing = "numcells" +CoordBase::ncells_x = @NCELLSI@ +CoordBase::ncells_y = @NCELLSJ@ +CoordBase::ncells_z = @NCELLSK@ + +CartGrid3D::type = "coordbase" +CartGrid3D::domain = "octant" +CartGrid3D::avoid_originx = no +CartGrid3D::avoid_originy = no +CartGrid3D::avoid_originz = no + +CoordBase::boundary_size_x_lower = 3 +CoordBase::boundary_size_y_lower = 3 +CoordBase::boundary_size_z_lower = 3 +CoordBase::boundary_shiftout_x_lower = 1 +CoordBase::boundary_shiftout_y_lower = 1 +CoordBase::boundary_shiftout_z_lower = 1 + +CoordBase::boundary_size_x_upper = 3 +CoordBase::boundary_size_y_upper = 3 +CoordBase::boundary_size_z_upper = 3 + + + +ActiveThorns = "MoL NaNChecker Time" + +MoL::ODE_Method = "RK4" +MoL::MoL_Intermediate_Steps = 4 +MoL::MoL_Num_Scratch_Levels = 1 + +Time::dtfac = 0.4 + + + +ActiveThorns = "ADMBase ADMCoupling ADMMacros CoordGauge StaticConformal" + +ADMBase::initial_data = "Cartesian Minkowski" +ADMBase::initial_lapse = "one" +ADMBase::initial_shift = "zero" +ADMBase::initial_dtlapse = "zero" +ADMBase::initial_dtshift = "zero" + + + +ActiveThorns = "GenericFD ML_BSSN ML_BSSN_Helper TmunuBase" + +ADMBase::evolution_method = "ML_BSSN" +ADMBase::lapse_evolution_method = "ML_BSSN" +ADMBase::shift_evolution_method = "ML_BSSN" + +ML_BSSN::my_boundary_condition = "Minkowski" + +ML_BSSN::harmonicN = 1 # 1+log +ML_BSSN::harmonicF = 2.0 # 1+log +ML_BSSN::ShiftGammaCoeff = 0.75 +ML_BSSN::BetaDriver = 0.5 + + + +ActiveThorns = "CarpetIOBasic" + +IOBasic::outInfo_every = @ITERATIONS@ +#IOBasic::outInfo_vars = "ADMBase::alp" + + + +#ActiveThorns = "CarpetIOASCII" +# +#IOASCII::out0D_every = @ITERATIONS@ +#IOASCII::out0D_vars = "Carpet::timing" + + + +ActiveThorns = "TimerReport" + +TimerReport::output_all_timers = yes +TimerReport::all_timers_clock = "cycle" diff --git a/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.legacy.par b/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.legacy.par new file mode 100644 index 000000000..dc1bbbdcb --- /dev/null +++ b/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.legacy.par @@ -0,0 +1,132 @@ +Cactus::cctk_run_title = "Benchmark of McLachlan using Carpet with one refinement level" +Cactus::cctk_timer_output = "full" + +Cactus::cctk_itlast = @ITERATIONS@ + + + +ActiveThorns = "Fortran" + + + +ActiveThorns = "LoopControl" + +#LoopControl::printstats = yes + +LoopControl::legacy_init = yes +LoopControl::use_random_restart_hill_climbing = no + + + +ActiveThorns = "IOUtil" + +#IO::print_timing_info = yes + + + +ActiveThorns = "InitBase" + + + +ActiveThorns = "Carpet CarpetLib CarpetReduce" + +Carpet::domain_from_coordbase = yes + +driver::ghost_size = 3 + +Carpet::init_fill_timelevels = yes + +CarpetLib::combine_recompose = yes + +#CarpetLib::print_timestats_every = 1 +CarpetLib::print_memstats_every = @ITERATIONS@ + + + +ActiveThorns = "Boundary CartGrid3D CoordBase SymBase" + +CoordBase::domainsize = "minmax" +CoordBase::xmin = 0.0 +CoordBase::ymin = 0.0 +CoordBase::zmin = 0.0 +CoordBase::xmax = 1.0 +CoordBase::ymax = 1.0 +CoordBase::zmax = 1.0 + +CoordBase::spacing = "numcells" +CoordBase::ncells_x = @NCELLSI@ +CoordBase::ncells_y = @NCELLSJ@ +CoordBase::ncells_z = @NCELLSK@ + +CartGrid3D::type = "coordbase" +CartGrid3D::domain = "octant" +CartGrid3D::avoid_originx = no +CartGrid3D::avoid_originy = no +CartGrid3D::avoid_originz = no + +CoordBase::boundary_size_x_lower = 3 +CoordBase::boundary_size_y_lower = 3 +CoordBase::boundary_size_z_lower = 3 +CoordBase::boundary_shiftout_x_lower = 1 +CoordBase::boundary_shiftout_y_lower = 1 +CoordBase::boundary_shiftout_z_lower = 1 + +CoordBase::boundary_size_x_upper = 3 +CoordBase::boundary_size_y_upper = 3 +CoordBase::boundary_size_z_upper = 3 + + + +ActiveThorns = "MoL NaNChecker Time" + +MoL::ODE_Method = "RK4" +MoL::MoL_Intermediate_Steps = 4 +MoL::MoL_Num_Scratch_Levels = 1 + +Time::dtfac = 0.4 + + + +ActiveThorns = "ADMBase ADMCoupling ADMMacros CoordGauge StaticConformal" + +ADMBase::initial_data = "Cartesian Minkowski" +ADMBase::initial_lapse = "one" +ADMBase::initial_shift = "zero" +ADMBase::initial_dtlapse = "zero" +ADMBase::initial_dtshift = "zero" + + + +ActiveThorns = "GenericFD ML_BSSN ML_BSSN_Helper TmunuBase" + +ADMBase::evolution_method = "ML_BSSN" +ADMBase::lapse_evolution_method = "ML_BSSN" +ADMBase::shift_evolution_method = "ML_BSSN" + +ML_BSSN::my_boundary_condition = "Minkowski" + +ML_BSSN::harmonicN = 1 # 1+log +ML_BSSN::harmonicF = 2.0 # 1+log +ML_BSSN::ShiftGammaCoeff = 0.75 +ML_BSSN::BetaDriver = 0.5 + + + +ActiveThorns = "CarpetIOBasic" + +IOBasic::outInfo_every = @ITERATIONS@ +#IOBasic::outInfo_vars = "ADMBase::alp" + + + +#ActiveThorns = "CarpetIOASCII" +# +#IOASCII::out0D_every = @ITERATIONS@ +#IOASCII::out0D_vars = "Carpet::timing" + + + +ActiveThorns = "TimerReport" + +TimerReport::output_all_timers = yes +TimerReport::all_timers_clock = "cycle" diff --git a/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.par b/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.par new file mode 100644 index 000000000..ab607feca --- /dev/null +++ b/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.par @@ -0,0 +1,132 @@ +Cactus::cctk_run_title = "Benchmark of McLachlan using Carpet with one refinement level" +Cactus::cctk_timer_output = "full" + +Cactus::cctk_itlast = @ITERATIONS@ + + + +ActiveThorns = "Fortran" + + + +ActiveThorns = "LoopControl" + +#LoopControl::printstats = yes + +LoopControl::legacy_init = @LEGACY_INIT@ +LoopControl::use_random_restart_hill_climbing = @HILL_CLIMBING@ + + + +ActiveThorns = "IOUtil" + +#IO::print_timing_info = yes + + + +ActiveThorns = "InitBase" + + + +ActiveThorns = "Carpet CarpetLib CarpetReduce" + +Carpet::domain_from_coordbase = yes + +driver::ghost_size = 3 + +Carpet::init_fill_timelevels = yes + +CarpetLib::combine_recompose = yes + +#CarpetLib::print_timestats_every = 1 +CarpetLib::print_memstats_every = @ITERATIONS@ + + + +ActiveThorns = "Boundary CartGrid3D CoordBase SymBase" + +CoordBase::domainsize = "minmax" +CoordBase::xmin = 0.0 +CoordBase::ymin = 0.0 +CoordBase::zmin = 0.0 +CoordBase::xmax = 1.0 +CoordBase::ymax = 1.0 +CoordBase::zmax = 1.0 + +CoordBase::spacing = "numcells" +CoordBase::ncells_x = @NCELLSI@ +CoordBase::ncells_y = @NCELLSJ@ +CoordBase::ncells_z = @NCELLSK@ + +CartGrid3D::type = "coordbase" +CartGrid3D::domain = "octant" +CartGrid3D::avoid_originx = no +CartGrid3D::avoid_originy = no +CartGrid3D::avoid_originz = no + +CoordBase::boundary_size_x_lower = 3 +CoordBase::boundary_size_y_lower = 3 +CoordBase::boundary_size_z_lower = 3 +CoordBase::boundary_shiftout_x_lower = 1 +CoordBase::boundary_shiftout_y_lower = 1 +CoordBase::boundary_shiftout_z_lower = 1 + +CoordBase::boundary_size_x_upper = 3 +CoordBase::boundary_size_y_upper = 3 +CoordBase::boundary_size_z_upper = 3 + + + +ActiveThorns = "MoL NaNChecker Time" + +MoL::ODE_Method = "RK4" +MoL::MoL_Intermediate_Steps = 4 +MoL::MoL_Num_Scratch_Levels = 1 + +Time::dtfac = 0.4 + + + +ActiveThorns = "ADMBase ADMCoupling ADMMacros CoordGauge StaticConformal" + +ADMBase::initial_data = "Cartesian Minkowski" +ADMBase::initial_lapse = "one" +ADMBase::initial_shift = "zero" +ADMBase::initial_dtlapse = "zero" +ADMBase::initial_dtshift = "zero" + + + +ActiveThorns = "GenericFD ML_BSSN ML_BSSN_Helper TmunuBase" + +ADMBase::evolution_method = "ML_BSSN" +ADMBase::lapse_evolution_method = "ML_BSSN" +ADMBase::shift_evolution_method = "ML_BSSN" + +ML_BSSN::my_boundary_condition = "Minkowski" + +ML_BSSN::harmonicN = 1 # 1+log +ML_BSSN::harmonicF = 2.0 # 1+log +ML_BSSN::ShiftGammaCoeff = 0.75 +ML_BSSN::BetaDriver = 0.5 + + + +ActiveThorns = "CarpetIOBasic" + +IOBasic::outInfo_every = @ITERATIONS@ +#IOBasic::outInfo_vars = "ADMBase::alp" + + + +#ActiveThorns = "CarpetIOASCII" +# +#IOASCII::out0D_every = @ITERATIONS@ +#IOASCII::out0D_vars = "Carpet::timing" + + + +ActiveThorns = "TimerReport" + +TimerReport::output_all_timers = yes +TimerReport::all_timers_clock = "cycle" diff --git a/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.standard.par b/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.standard.par new file mode 100644 index 000000000..690b37c26 --- /dev/null +++ b/Carpet/LoopControl/par/Bench_McLachlan_Carpet_1lev.standard.par @@ -0,0 +1,132 @@ +Cactus::cctk_run_title = "Benchmark of McLachlan using Carpet with one refinement level" +Cactus::cctk_timer_output = "full" + +Cactus::cctk_itlast = @ITERATIONS@ + + + +ActiveThorns = "Fortran" + + + +ActiveThorns = "LoopControl" + +#LoopControl::printstats = yes + +LoopControl::legacy_init = no +LoopControl::use_random_restart_hill_climbing = no + + + +ActiveThorns = "IOUtil" + +#IO::print_timing_info = yes + + + +ActiveThorns = "InitBase" + + + +ActiveThorns = "Carpet CarpetLib CarpetReduce" + +Carpet::domain_from_coordbase = yes + +driver::ghost_size = 3 + +Carpet::init_fill_timelevels = yes + +CarpetLib::combine_recompose = yes + +#CarpetLib::print_timestats_every = 1 +CarpetLib::print_memstats_every = @ITERATIONS@ + + + +ActiveThorns = "Boundary CartGrid3D CoordBase SymBase" + +CoordBase::domainsize = "minmax" +CoordBase::xmin = 0.0 +CoordBase::ymin = 0.0 +CoordBase::zmin = 0.0 +CoordBase::xmax = 1.0 +CoordBase::ymax = 1.0 +CoordBase::zmax = 1.0 + +CoordBase::spacing = "numcells" +CoordBase::ncells_x = @NCELLSI@ +CoordBase::ncells_y = @NCELLSJ@ +CoordBase::ncells_z = @NCELLSK@ + +CartGrid3D::type = "coordbase" +CartGrid3D::domain = "octant" +CartGrid3D::avoid_originx = no +CartGrid3D::avoid_originy = no +CartGrid3D::avoid_originz = no + +CoordBase::boundary_size_x_lower = 3 +CoordBase::boundary_size_y_lower = 3 +CoordBase::boundary_size_z_lower = 3 +CoordBase::boundary_shiftout_x_lower = 1 +CoordBase::boundary_shiftout_y_lower = 1 +CoordBase::boundary_shiftout_z_lower = 1 + +CoordBase::boundary_size_x_upper = 3 +CoordBase::boundary_size_y_upper = 3 +CoordBase::boundary_size_z_upper = 3 + + + +ActiveThorns = "MoL NaNChecker Time" + +MoL::ODE_Method = "RK4" +MoL::MoL_Intermediate_Steps = 4 +MoL::MoL_Num_Scratch_Levels = 1 + +Time::dtfac = 0.4 + + + +ActiveThorns = "ADMBase ADMCoupling ADMMacros CoordGauge StaticConformal" + +ADMBase::initial_data = "Cartesian Minkowski" +ADMBase::initial_lapse = "one" +ADMBase::initial_shift = "zero" +ADMBase::initial_dtlapse = "zero" +ADMBase::initial_dtshift = "zero" + + + +ActiveThorns = "GenericFD ML_BSSN ML_BSSN_Helper TmunuBase" + +ADMBase::evolution_method = "ML_BSSN" +ADMBase::lapse_evolution_method = "ML_BSSN" +ADMBase::shift_evolution_method = "ML_BSSN" + +ML_BSSN::my_boundary_condition = "Minkowski" + +ML_BSSN::harmonicN = 1 # 1+log +ML_BSSN::harmonicF = 2.0 # 1+log +ML_BSSN::ShiftGammaCoeff = 0.75 +ML_BSSN::BetaDriver = 0.5 + + + +ActiveThorns = "CarpetIOBasic" + +IOBasic::outInfo_every = @ITERATIONS@ +#IOBasic::outInfo_vars = "ADMBase::alp" + + + +#ActiveThorns = "CarpetIOASCII" +# +#IOASCII::out0D_every = @ITERATIONS@ +#IOASCII::out0D_vars = "Carpet::timing" + + + +ActiveThorns = "TimerReport" + +TimerReport::output_all_timers = yes +TimerReport::all_timers_clock = "cycle" diff --git a/Carpet/LoopControl/src/loopcontrol.h b/Carpet/LoopControl/src/loopcontrol.h index dfe7dda60..7f882617c 100644 --- a/Carpet/LoopControl/src/loopcontrol.h +++ b/Carpet/LoopControl/src/loopcontrol.h @@ -162,6 +162,11 @@ static inline int lc_state_valid (lc_statset_t const * restrict const ls, lc_state_t const * restrict const state) + CCTK_ATTRIBUTE_PURE; +static inline +int +lc_state_valid (lc_statset_t const * restrict const ls, + lc_state_t const * restrict const state) { if (state->topology >= 0 && state->topology < ls->ntopologies) { int const * restrict const ntilings = @@ -177,6 +182,11 @@ static inline int lc_state_equal (lc_state_t const * restrict const state1, lc_state_t const * restrict const state2) + CCTK_ATTRIBUTE_PURE; +static inline +int +lc_state_equal (lc_state_t const * restrict const state1, + lc_state_t const * restrict const state2) { return (state1->topology == state2->topology && state1->tiling[0] == state2->tiling[0] && @@ -193,7 +203,8 @@ lc_stattime_init (lc_stattime_t * restrict const lt, lc_stattime_t * lc_stattime_find (lc_statset_t const * restrict const ls, - lc_state_t const * restrict const state); + lc_state_t const * restrict const state) + CCTK_ATTRIBUTE_PURE; lc_stattime_t * lc_stattime_find_create (lc_statset_t * restrict const ls, @@ -211,7 +222,8 @@ lc_statset_init (lc_statset_t * restrict const ls, lc_statset_t * lc_statset_find (lc_statmap_t const * restrict const lm, int const num_threads, - int const npoints[3]); + int const npoints[3]) + CCTK_ATTRIBUTE_PURE; lc_statset_t * lc_statset_find_create (lc_statmap_t * restrict const lm, @@ -253,6 +265,10 @@ typedef struct lc_control_t { static inline int lc_min (int const i, int const j) + CCTK_ATTRIBUTE_CONST; +static inline +int +lc_min (int const i, int const j) { return i < j ? i : j; } @@ -260,6 +276,10 @@ lc_min (int const i, int const j) static inline int lc_max (int const i, int const j) + CCTK_ATTRIBUTE_CONST; +static inline +int +lc_max (int const i, int const j) { return i > j ? i : j; } |