From 77e61bb9a06ef271348c96d762935442c7439f0c Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 7 Aug 2013 18:33:48 -0400 Subject: Timers: Move all timer-related code into a new thorn Timers --- Carpet/CarpetLib/interface.ccl | 2 +- Carpet/CarpetLib/src/defs.cc | 2 -- Carpet/CarpetLib/src/dh.cc | 66 +++++++++++++++++++++--------------------- Carpet/CarpetLib/src/ggf.cc | 12 ++++---- Carpet/CarpetLib/src/gh.cc | 4 +-- 5 files changed, 42 insertions(+), 44 deletions(-) (limited to 'Carpet/CarpetLib') diff --git a/Carpet/CarpetLib/interface.ccl b/Carpet/CarpetLib/interface.ccl index f41402f90..d1054b0e4 100644 --- a/Carpet/CarpetLib/interface.ccl +++ b/Carpet/CarpetLib/interface.ccl @@ -38,7 +38,7 @@ includes header: operators.hh in operators.hh uses include header: nompi.h -uses include header: CarpetTimers.hh +uses include header: Timer.hh uses include header: cycleclock.h uses include header: loopcontrol.h uses include header: vectors.h diff --git a/Carpet/CarpetLib/src/defs.cc b/Carpet/CarpetLib/src/defs.cc index 7776a3ab8..02474b8b9 100644 --- a/Carpet/CarpetLib/src/defs.cc +++ b/Carpet/CarpetLib/src/defs.cc @@ -333,8 +333,6 @@ ostream& output (ostream& os, const vector& v) { #include "th.hh" #include "vect.hh" -#include "CarpetTimers.hh" - template int ipow (int x, int y); template CCTK_REAL ipow (CCTK_REAL x, int y); //template vect ipow (vect x, int y); diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc index 44a87c0fd..b66c80188 100644 --- a/Carpet/CarpetLib/src/dh.cc +++ b/Carpet/CarpetLib/src/dh.cc @@ -5,7 +5,7 @@ #include #include -#include "CarpetTimers.hh" +#include #include "mpi_string.hh" #include "bbox.hh" @@ -271,7 +271,7 @@ regrid (bool const do_init) { DECLARE_CCTK_PARAMETERS; - static Carpet::Timer timer ("CarpetLib::dh::regrid"); + static Timers::Timer timer ("CarpetLib::dh::regrid"); timer.start(); CHECKPOINT; @@ -323,7 +323,7 @@ regrid (bool const do_init) // Domain: - static Carpet::Timer timer_domain ("domain"); + static Timers::Timer timer_domain ("domain"); timer_domain.start(); ibbox const & domain_exterior = h.baseextent(ml,rl); @@ -348,7 +348,7 @@ regrid (bool const do_init) - static Carpet::Timer timer_region ("region"); + static Timers::Timer timer_region ("region"); timer_region.start(); for (int c = 0; c < h.components(rl); ++ c) { @@ -517,7 +517,7 @@ regrid (bool const do_init) // Conjunction of all buffer zones: - static Carpet::Timer timer_buffers ("buffers"); + static Timers::Timer timer_buffers ("buffers"); timer_buffers.start(); // Enlarge active part of domain @@ -656,7 +656,7 @@ regrid (bool const do_init) // Test constituency relations: - static Carpet::Timer timer_test ("test"); + static Timers::Timer timer_test ("test"); timer_test.start(); for (int c = 0; c < h.components(rl); ++ c) { @@ -697,14 +697,14 @@ regrid (bool const do_init) // Communication schedule: - static Carpet::Timer timer_comm ("comm"); + static Timers::Timer timer_comm ("comm"); timer_comm.start(); - static Carpet::Timer timer_comm_mgrest ("mgrest"); - static Carpet::Timer timer_comm_mgprol ("mgprol"); - static Carpet::Timer timer_comm_refprol ("refprol"); - static Carpet::Timer timer_comm_sync ("sync"); - static Carpet::Timer timer_comm_refbndprol ("refbndprol"); + static Timers::Timer timer_comm_mgrest ("mgrest"); + static Timers::Timer timer_comm_mgprol ("mgprol"); + static Timers::Timer timer_comm_refprol ("refprol"); + static Timers::Timer timer_comm_sync ("sync"); + static Timers::Timer timer_comm_refbndprol ("refbndprol"); timer_comm_mgrest.instantiate (); timer_comm_mgprol.instantiate (); timer_comm_refprol.instantiate (); @@ -1017,7 +1017,7 @@ regrid (bool const do_init) // Refinement restriction: - static Carpet::Timer timer_comm_refrest ("refrest"); + static Timers::Timer timer_comm_refrest ("refrest"); timer_comm_refrest.start(); if (rl > 0) { @@ -1120,7 +1120,7 @@ regrid (bool const do_init) // Refinement refluxing: - static Carpet::Timer timer_comm_reflux ("reflux"); + static Timers::Timer timer_comm_reflux ("reflux"); timer_comm_reflux.start(); // If there is no coarser level, do nothing @@ -1416,7 +1416,7 @@ regrid (bool const do_init) // Reduction mask: - static Carpet::Timer timer_mask ("mask"); + static Timers::Timer timer_mask ("mask"); timer_mask.start(); for (int lc=0; lc 0) { int const orl = rl - 1; fast_dboxes & fast_olevel = fast_boxes.AT(ml).AT(orl); - static Carpet::Timer timer_bcast_comm_ref_rest ("ref_rest"); + static Timers::Timer timer_bcast_comm_ref_rest ("ref_rest"); timer_bcast_comm_ref_rest.start(); broadcast_schedule (fast_level_otherprocs, fast_olevel, & fast_dboxes::fast_ref_rest_sendrecv); @@ -1944,7 +1944,7 @@ regrid (bool const do_init) if (rl > 0) { int const orl = rl - 1; fast_dboxes & fast_olevel = fast_boxes.AT(ml).AT(orl); - static Carpet::Timer timer_bcast_comm_ref_refl ("ref_refl"); + static Timers::Timer timer_bcast_comm_ref_refl ("ref_refl"); timer_bcast_comm_ref_refl.start(); for (int dir = 0; dir < dim; ++ dir) { for (int face = 0; face < 2; ++ face) { @@ -1957,7 +1957,7 @@ regrid (bool const do_init) timer_bcast_comm_ref_refl.stop(); } - static Carpet::Timer timer_bcast_comm_ref_refl_prol + static Timers::Timer timer_bcast_comm_ref_refl_prol ("ref_refl_prol"); timer_bcast_comm_ref_refl_prol.start(); for (int dir = 0; dir < dim; ++ dir) { @@ -1972,13 +1972,13 @@ regrid (bool const do_init) // TODO: Maybe broadcast old2new schedule only if do_init is // set - static Carpet::Timer timer_bcast_comm_old2new_sync ("old2new_sync"); + static Timers::Timer timer_bcast_comm_old2new_sync ("old2new_sync"); timer_bcast_comm_old2new_sync.start(); broadcast_schedule (fast_level_otherprocs, fast_level, & fast_dboxes::fast_old2new_sync_sendrecv); timer_bcast_comm_old2new_sync.stop(); - static Carpet::Timer timer_bcast_comm_old2new_ref_prol + static Timers::Timer timer_bcast_comm_old2new_ref_prol ("old2new_ref_prol"); timer_bcast_comm_old2new_ref_prol.start(); broadcast_schedule (fast_level_otherprocs, fast_level, @@ -2144,7 +2144,7 @@ broadcast_schedule (vector & fast_level_otherprocs, fast_dboxes & fast_level, srpvect fast_dboxes::* const schedule_item) { - static Carpet::Timer timer_bs1 ("CarpetLib::dh::bs1"); + static Timers::Timer timer_bs1 ("CarpetLib::dh::bs1"); timer_bs1.start(); vector send (dist::size()); for (int p=0; p & fast_level_otherprocs, } timer_bs1.stop(); - static Carpet::Timer timer_bs2 ("CarpetLib::dh::bs2"); + static Timers::Timer timer_bs2 ("CarpetLib::dh::bs2"); timer_bs2.start(); srpvect const recv = alltoallv1 (dist::comm(), send); timer_bs2.stop(); - static Carpet::Timer timer_bs3 ("CarpetLib::dh::bs3"); + static Timers::Timer timer_bs3 ("CarpetLib::dh::bs3"); timer_bs3.start(); (fast_level.*schedule_item).insert ((fast_level.*schedule_item).end(), recv.begin(), recv.end()); @@ -2197,7 +2197,7 @@ recompose (int const rl, bool const do_prolongate) assert (rl>=0 and rl::iterator f=gfs.begin(); f!=gfs.end(); ++f) { diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc index d9fde10df..934d895e8 100644 --- a/Carpet/CarpetLib/src/ggf.cc +++ b/Carpet/CarpetLib/src/ggf.cc @@ -7,7 +7,7 @@ #include #include -#include "CarpetTimers.hh" +#include #include "defs.hh" #include "dh.hh" @@ -121,7 +121,7 @@ void ggf::set_timelevels (const int ml, const int rl, const int new_timelevels) void ggf::recompose_crop () { // Free storage that will not be needed - static Carpet::Timer timer ("CarpetLib::ggf::recompose_crop"); + static Timers::Timer timer ("CarpetLib::ggf::recompose_crop"); timer.start (); for (int ml=0; ml #include -#include "CarpetTimers.hh" +#include #include "defs.hh" #include "dh.hh" @@ -91,7 +91,7 @@ regrid (rregs const & superregs, mregs const & regs, bool const do_init) { DECLARE_CCTK_PARAMETERS; - static Carpet::Timer timer ("CarpetLib::gh::regrid"); + static Timers::Timer timer ("CarpetLib::gh::regrid"); timer.start(); superregions = superregs; -- cgit v1.2.3