summaryrefslogtreecommitdiff
path: root/src/include/cctk_Schedule.h
blob: b9ce40e68bfbf4e054c5a11637f382177b546016 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
 /*@@
   @header  cctk_schedule.h
   @date    Thu Sep 16 19:05:27 1999
   @author  Tom Goodale
   @desc
            Routines for creating schedule stuff.
   @enddesc
   @version $Header$
 @@*/

#ifndef _CCTK_SCHEDULE_H_
#define _CCTK_SCHEDULE_H_

#include <stdio.h>

typedef enum {LangNone, LangC, LangFortran} cLanguage;

typedef enum {FunctionNoArgs, FunctionOneArg, FunctionStandard} cFunctionType;

typedef struct
{
  cLanguage language;

  int (*FortranCaller)(cGH *, void *);

  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;

  int loop_meta;
  int loop_global;
  int loop_level;
  int loop_singlemap;
  int loop_local;

  /* The last items should be considered volatile and may not stay here */

  int n_TriggerGroups;
  int *TriggerGroups;
  char *where;
  char *routine;
  char *thorn;

} cFunctionData;

#ifdef __cplusplus
extern "C"
{
#endif

int CCTK_CallFunction(void *function,
                      cFunctionData *fdata,
                      void *data);

int CCTK_ScheduleTraverse(const char *where,
                          void *GH,
                          int (*CallFunction)(void *, cFunctionData *, void *));

int CCTK_SchedulePrint(const char *where);
int CCTK_SchedulePrintTimes(const char *where);
int CCTK_SchedulePrintTimesToFile(const char *where, FILE *file);

cLanguage CCTK_TranslateLanguage(const char *sval);

#if 0
int CCTK_ScheduleFunction(void *function,
                          const char *name,
                          const char *thorn,
                          const char *implementation,
                          const char *description,
                          const char *where,
                          const char *language,
                          int n_mem_groups,
                          int n_comm_groups,
                          int n_trigger_groups,
                          int n_before,
                          int n_after,
                          int n_while,
                          int n_if,
                          ...);

int CCTK_ScheduleGroup(const char *name,
                       const char *thorn,
                       const char *implementation,
                       const char *description,
                       const char *where,
                       int n_mem_groups,
                       int n_comm_groups,
                       int n_trigger_groups,
                       int n_before,
                       int n_after,
                       int n_while,
                       int n_if,
                       ...);

int CCTK_ScheduleGroupStorage(const char *group);

int CCTK_ScheduleGroupComm(const char *group);

int CCTK_ScheduleTraverse(const char *where,
                          void *GH,
                          int (*calling_function)(void *, void *, void *));

int CCTK_ScheduleGHInit(void *GH);
#endif


#ifdef __cplusplus
}
#endif

#endif /*_CCTK_SCHEDULE_H_*/