Skip to content

Commit 5794525

Browse files
committed
PunctureTracker: make it work in real global mode
1 parent 4ee9c38 commit 5794525

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

PunctureTracker/src/puncture_tracker.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ namespace PunctureTracker {
1717

1818
static PunctureContainer *g_punctures = nullptr;
1919

20+
static double previous_time = 0.0;
21+
2022
const int max_num_tracked = 10;
2123

2224
extern "C" void PunctureTracker_Init(CCTK_ARGUMENTS) {
@@ -101,6 +103,13 @@ extern "C" void PunctureTracker_Track(CCTK_ARGUMENTS) {
101103
DECLARE_CCTK_ARGUMENTS_PunctureTracker_Track;
102104
DECLARE_CCTK_PARAMETERS;
103105

106+
// we can remove this segment when global mode works
107+
if (cctk_time <= previous_time) {
108+
return;
109+
}
110+
#pragma omp master
111+
{ previous_time = cctk_time; }
112+
104113
// Do not track while setting up initial data; time interpolation may fail
105114
if (cctk_iteration == 0) {
106115
return;

0 commit comments

Comments
 (0)