diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-09-17 17:08:50 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-09-17 17:08:50 +0000 |
commit | 437c0563cfac29f2d5ab88200f13066a3e57d094 (patch) | |
tree | 09a6c6f4d9801d199ca85fa2cbe560093b357a15 /src | |
parent | 25d2a4f6ea4d6f46271c523bab8a10a81e52e0fe (diff) |
Added subroutines for scheduling groups for storage and communication.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@943 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src')
-rw-r--r-- | src/main/ScheduleInterface.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c index c778793f..1270402e 100644 --- a/src/main/ScheduleInterface.c +++ b/src/main/ScheduleInterface.c @@ -96,6 +96,12 @@ static int CCTKi_ScheduleCallFunction(void *function, t_attribute *attribute, t_ static int indent_level = 0; +static int n_scheduled_comm_groups = 0; +static int *scheduled_comm_groups = NULL; + +static int n_scheduled_storage_groups = 0; +static int *scheduled_storage_groups = NULL; + /******************************************************************** ********************* External Routines ********************** @@ -208,7 +214,85 @@ int CCTK_ScheduleGroup(const char *name, } + /*@@ + @routine CCTK_ScheduleGroupStorage + @date Fri Sep 17 18:55:59 1999 + @author Tom Goodale + @desc + Schedules a group for storage when a GH is created. + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ +int CCTK_ScheduleGroupStorage(const char *group) +{ + int retcode; + int *temp; + + n_scheduled_storage_groups++; + temp = (int*)realloc(scheduled_storage_groups, n_scheduled_storage_groups*sizeof(int)); + + if(temp) + { + scheduled_storage_groups = temp; + + scheduled_storage_groups[n_scheduled_storage_groups-1] = CCTK_GroupIndex(group); + + retcode = scheduled_storage_groups[n_scheduled_storage_groups-1]; + } + else + { + retcode = -1; + n_scheduled_storage_groups--; + } + + return retcode; + +} + + /*@@ + @routine CCTK_ScheduleGroupComm + @date Fri Sep 17 18:55:59 1999 + @author Tom Goodale + @desc + Schedules a group for communication when a GH is created. + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ +int CCTK_ScheduleGroupComm(const char *group) +{ + int retcode; + int *temp; + + n_scheduled_comm_groups++; + temp = (int*)realloc(scheduled_comm_groups, n_scheduled_comm_groups*sizeof(int)); + + if(temp) + { + scheduled_comm_groups = temp; + + scheduled_comm_groups[n_scheduled_comm_groups-1] = CCTK_GroupIndex(group); + + retcode = scheduled_comm_groups[n_scheduled_comm_groups-1]; + } + else + { + retcode = -1; + n_scheduled_comm_groups--; + } + + return retcode; +} /******************************************************************** ********************* Local Routines ************************* |