aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src
diff options
context:
space:
mode:
authorRoland Haas <rhaas@tapir.caltech.edu>2013-10-11 11:56:50 -0700
committerRoland Haas <rhaas@tapir.caltech.edu>2013-10-11 23:49:08 -0700
commitc83793e7f141d969bad07757ed970aa053a3ad57 (patch)
tree3e0b9aba462bd208648377041f2f4b805403809c /Carpet/Carpet/src
parentbe2bd96c56aa6dd5b1fb6654b130f3e44e049e8e (diff)
Carpet: skip CheckFence routine if electric_fence is off
enumerating the variables is expensive enough to show up in the timer output
Diffstat (limited to 'Carpet/Carpet/src')
-rw-r--r--Carpet/Carpet/src/CallFunction.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/Carpet/Carpet/src/CallFunction.cc b/Carpet/Carpet/src/CallFunction.cc
index 224a66346..494f2864c 100644
--- a/Carpet/Carpet/src/CallFunction.cc
+++ b/Carpet/Carpet/src/CallFunction.cc
@@ -473,7 +473,11 @@ namespace Carpet {
void CheckFence (cGH const * const cctkGH, cFunctionData * attribute)
{
+ DECLARE_CCTK_PARAMETERS;
+
if (is_meta_mode()) return; // meta mode has no accessible variables
+ // enumerating the grid variables is expensive
+ if (not electric_fence) return;
Timers::Timer timer("FenceCheck");
timer.start();