aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetInterp
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2008-08-03 22:06:07 -0500
committerErik Schnetter <schnetter@cct.lsu.edu>2008-08-03 22:11:36 -0500
commitb846cdbb6615e258bb5843c18a01c217045df8c2 (patch)
treeb094e32e5a2a1a0ff705e594b1153913cbc662e1 /Carpet/CarpetInterp
parent377a3ccb4bb67137aea853801f4a881607577784 (diff)
CarpetInterp: Avoid problem with Intel compilers
Do not use a static variable for the interpolation timer.
Diffstat (limited to 'Carpet/CarpetInterp')
-rw-r--r--Carpet/CarpetInterp/src/interp.cc20
1 files changed, 7 insertions, 13 deletions
diff --git a/Carpet/CarpetInterp/src/interp.cc b/Carpet/CarpetInterp/src/interp.cc
index 86bc650ff..c6f30d76c 100644
--- a/Carpet/CarpetInterp/src/interp.cc
+++ b/Carpet/CarpetInterp/src/interp.cc
@@ -187,16 +187,6 @@ namespace CarpetInterp {
- static void timer_CDI (bool const dostart)
- {
- static Timer timer_CDI ("CarpetInterp::Carpet_DriverInterpolate");
- if (dostart) {
- timer_CDI.start ();
- } else {
- timer_CDI.stop (0);
- }
- }
-
extern "C" CCTK_INT
Carpet_DriverInterpolate (CCTK_POINTER_TO_CONST const cctkGH_,
CCTK_INT const N_dims,
@@ -214,7 +204,11 @@ namespace CarpetInterp {
{
DECLARE_CCTK_PARAMETERS;
- timer_CDI (true);
+ static Timer * timer_CDI = NULL;
+ if (not timer_CDI) {
+ timer_CDI = new Timer ("CarpetInterp::Carpet_DriverInterpolate");
+ }
+ timer_CDI->start();
cGH const * const cctkGH = static_cast<cGH const *> (cctkGH_);
assert (cctkGH);
@@ -379,7 +373,7 @@ namespace CarpetInterp {
prolongation_order_time, current_time, delta_time,
source_map, operand_indices, time_deriv_order);
if (iret < 0) {
- timer_CDI (false);
+ timer_CDI->stop (0);
return iret;
}
}
@@ -901,7 +895,7 @@ namespace CarpetInterp {
// Done.
{
- timer_CDI (false);
+ timer_CDI->stop (0);
int const iret = per_proc_retvals[dist::rank()];
return iret;
}