aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
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);
}