summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2009-12-05 04:09:12 +0000
committerschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2009-12-05 04:09:12 +0000
commite1d64c86a158f57ef5c65e85051fb786a0df63be (patch)
tree19ede291f9371ff7c733e895eb9c63ae7aa9bd28 /src
parent44ab1cbc5d0982f4a16ffd664d67a4a7df4ff218 (diff)
Add new schedule modes meta_early, meta_late, global_early, and
global_late. These modes can then be used in Carpet, where they will simplify traversing the schedule tree when local, level, and global mode routines are mixed. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4589 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src')
-rw-r--r--src/include/cctk_Schedule.h5
-rw-r--r--src/main/ScheduleInterface.c82
2 files changed, 84 insertions, 3 deletions
diff --git a/src/include/cctk_Schedule.h b/src/include/cctk_Schedule.h
index ed6bcb2a..b9ce40e6 100644
--- a/src/include/cctk_Schedule.h
+++ b/src/include/cctk_Schedule.h
@@ -26,13 +26,16 @@ typedef struct
cFunctionType type;
int n_SyncGroups;
-
int *SyncGroups;
/* Option Flags */
int meta;
+ int meta_early;
+ int meta_late;
int global;
+ int global_early;
+ int global_late;
int level;
int singlemap;
int local;
diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c
index f6da4c47..c6074775 100644
--- a/src/main/ScheduleInterface.c
+++ b/src/main/ScheduleInterface.c
@@ -1373,7 +1373,6 @@ static t_attribute *CreateAttribute(const char *where,
const int *timelevels,
va_list *ap)
{
- char *timername;
t_attribute *this;
int i;
@@ -1707,7 +1706,11 @@ static int ParseOptionList(int n_items,
static int InitialiseOptionList(t_attribute *attribute)
{
attribute->FunctionData.meta = 0;
+ attribute->FunctionData.meta_early = 0;
+ attribute->FunctionData.meta_late = 0;
attribute->FunctionData.global = 0;
+ attribute->FunctionData.global_early = 0;
+ attribute->FunctionData.global_late = 0;
attribute->FunctionData.level = 0;
attribute->FunctionData.singlemap = 0;
attribute->FunctionData.local = 0;
@@ -1753,10 +1756,26 @@ static int ParseOption(t_attribute *attribute,
{
attribute->FunctionData.meta = 1;
}
+ else if(CCTK_Equals(option, "META-EARLY"))
+ {
+ attribute->FunctionData.meta_early = 1;
+ }
+ else if(CCTK_Equals(option, "META-LATE"))
+ {
+ attribute->FunctionData.meta_late = 1;
+ }
else if(CCTK_Equals(option, "GLOBAL"))
{
attribute->FunctionData.global = 1;
}
+ else if(CCTK_Equals(option, "GLOBAL-EARLY"))
+ {
+ attribute->FunctionData.global_early = 1;
+ }
+ else if(CCTK_Equals(option, "GLOBAL-LATE"))
+ {
+ attribute->FunctionData.global_late = 1;
+ }
else if(CCTK_Equals(option, "LEVEL"))
{
attribute->FunctionData.level = 1;
@@ -2307,15 +2326,74 @@ static int CCTKi_SchedulePrintFunction(void *function,
t_attribute *attribute,
t_sched_data *data)
{
+ const char* mode;
+ const char* loop_mode;
/* prevent compiler warnings about unused parameters */
function = function;
data = data;
+ if (attribute->FunctionData.meta ||
+ attribute->FunctionData.meta_early ||
+ attribute->FunctionData.meta_late)
+ {
+ mode = "[meta] ";
+ }
+ else if (attribute->FunctionData.global ||
+ attribute->FunctionData.global_early ||
+ attribute->FunctionData.global_late)
+ {
+ mode = "[global] ";
+ }
+ else if (attribute->FunctionData.level)
+ {
+ mode = "[level] ";
+ }
+ else if (attribute->FunctionData.singlemap)
+ {
+ mode = "[singlemap] ";
+ }
+ else if (attribute->FunctionData.local)
+ {
+ mode = "[local] ";
+ }
+ else
+ {
+ mode = "";
+ }
+
+ if (attribute->FunctionData.loop_meta)
+ {
+ loop_mode = "[loop-meta] ";
+ }
+ else if (attribute->FunctionData.loop_global)
+ {
+ loop_mode = "[loop-global] ";
+ }
+ else if (attribute->FunctionData.loop_level)
+ {
+ loop_mode = "[loop-level] ";
+ }
+ else if (attribute->FunctionData.loop_singlemap)
+ {
+ loop_mode = "[loop-singlemap] ";
+ }
+ else if (attribute->FunctionData.loop_local)
+ {
+ loop_mode = "[loop-local] ";
+ }
+ else
+ {
+ loop_mode = "";
+ }
+
if (indent_level > 0)
{
printf ("%*s", indent_level, " ");
}
- printf("%s: %s\n", attribute->FunctionData.thorn, attribute->description);
+ printf("%s::%s: %s%s%s\n",
+ attribute->FunctionData.thorn, attribute->FunctionData.routine,
+ mode, loop_mode,
+ attribute->description);
return 1;
}