aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-02-13 18:41:13 -0600
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 16:45:28 +0000
commit4f068a75d29ed337759fb61732361223fe32d973 (patch)
treee961a78657301c576322e3e5dabd61b4c28aac17 /Carpet
parent06238e6cf8c1fd51ee4baab9604aa75d58d7437d (diff)
CarpetLib: New parameter use_ipm_timing_regions
Use IPM's timing regions in CarpetLib's timers (if built with IPM).
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetLib/param.ccl4
-rw-r--r--Carpet/CarpetLib/src/timestat.cc6
2 files changed, 10 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/param.ccl b/Carpet/CarpetLib/param.ccl
index 0dd901181..689553c93 100644
--- a/Carpet/CarpetLib/param.ccl
+++ b/Carpet/CarpetLib/param.ccl
@@ -90,6 +90,10 @@ STRING timestat_file "File name in which timestat output is collected (because s
"^.+$" :: "file name"
} "carpetlib-timing-statistics"
+BOOLEAN use_ipm_timing_regions "Call IPM (via MPI_Pcontrol) to define regions" STEERABLE=always
+{
+} no
+
INT print_memstats_every "Report periodically how much memory is used per process" STEERABLE=always
diff --git a/Carpet/CarpetLib/src/timestat.cc b/Carpet/CarpetLib/src/timestat.cc
index 1115a6663..b6ef287f3 100644
--- a/Carpet/CarpetLib/src/timestat.cc
+++ b/Carpet/CarpetLib/src/timestat.cc
@@ -211,6 +211,9 @@ namespace CarpetLib {
DECLARE_CCTK_PARAMETERS;
assert (not running);
running = true;
+ if (use_ipm_timing_regions) {
+ MPI_Pcontrol (+1, timername.c_str());
+ }
starttime = call_timer ();
}
@@ -224,6 +227,9 @@ namespace CarpetLib {
assert (running);
running = false;
ticks const endtime = call_timer ();
+ if (use_ipm_timing_regions) {
+ MPI_Pcontrol (-1, timername.c_str());
+ }
addstat (elapsed (endtime, starttime), b);
}