diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-05-25 16:36:03 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-05-25 16:36:03 +0000 |
commit | 305996fd427742551c60d214db0551d495383247 (patch) | |
tree | 068d19ba2abc356ebaef2e03ad76f5a99e647f91 | |
parent | 1c8bfdb31bcdb2b5cd30cd14a3fd8d95030703ea (diff) |
Correct a severe error in handling sync statements in scheduling
groups.
Whether the synchronisation was done by CCTK_CallFunction or not was
stored in the "synchronised" flag of a t_sched_data object. This
object exists only once for the simulation, and not once for each
recursive call of the scheduler when it traverses groups. Thus the
information was correct only for the innermost schedule item, namely
functions, and incorrect for schedule groups.
Because PUGH does not overload CCTK_CallFunction, and thus this flag
always stays false, I assume that this error does not occur with PUGH
simulations. It does occur with Carpet simulations.
As a quick solution, I moved the "synchronised" flag from the
t_sched_data structure into the t_attribute structure. This does not
work for recursive calls.
It may be that the t_attribute structure is meant for unchanging
information. In that case, it is necessary to construct a stack of
t_sched_data objects.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4060 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | src/main/ScheduleInterface.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c index 48081b80..fd1ba4c7 100644 --- a/src/main/ScheduleInterface.c +++ b/src/main/ScheduleInterface.c @@ -72,6 +72,7 @@ typedef struct int *StorageOnEntry; int done_entry; + int synchronised; } t_attribute; @@ -83,7 +84,6 @@ typedef struct cTimerData *info; cTimerData *total_time; int print_headers; - int synchronised; /* Stuff passed in in user calls */ @@ -2209,6 +2209,9 @@ static int CCTKi_ScheduleCallEntry(t_attribute *attribute, } } + /* Initialise the synchronised flag. */ + attribute->synchronised = 0; + /* Remember if we have switched on storage and comm or not. */ attribute->done_entry = go; } @@ -2217,9 +2220,6 @@ static int CCTKi_ScheduleCallEntry(t_attribute *attribute, go = 1; } - /* Initialise then synchronised flag. */ - data->synchronised = 0; - return go; } @@ -2260,12 +2260,12 @@ static int CCTKi_ScheduleCallExit(t_attribute *attribute, { /* Synchronise variable groups associated with this schedule group. */ - if(attribute->FunctionData.n_SyncGroups > 0 && ! data->synchronised) + if(attribute->FunctionData.n_SyncGroups > 0 && ! attribute->synchronised) { CCTK_SyncGroupsI(data->GH, attribute->FunctionData.n_SyncGroups, attribute->FunctionData.SyncGroups); - data->synchronised = 0; + attribute->synchronised = 0; } if(data->schedpoint == schedpoint_analysis) @@ -2420,7 +2420,7 @@ static int CCTKi_ScheduleCallFunction(void *function, /* Use whatever has been chosen as the calling function for this * function. */ - data->synchronised = data->CallFunction(function, &(attribute->FunctionData), data->GH); + attribute->synchronised = data->CallFunction(function, &(attribute->FunctionData), data->GH); if (attribute->timer_handle >= 0) { |