summaryrefslogtreecommitdiff
path: root/src/comm
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-01-15 13:45:17 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-01-15 13:45:17 +0000
commit98af5aae4a94d1fe40734593d036446689151d3f (patch)
tree51b459b6f4365fb4dffc588560d3504d44425d28 /src/comm
parentb9b225878a7a69f291f0860edfc475cdc1a70309 (diff)
Routines to hold GH extension data.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@56 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/comm')
-rw-r--r--src/comm/CactusDefaultComm.c68
-rw-r--r--src/comm/GHExtensions.c19
-rw-r--r--src/comm/RegisterCommFunction.c18
3 files changed, 66 insertions, 39 deletions
diff --git a/src/comm/CactusDefaultComm.c b/src/comm/CactusDefaultComm.c
index cd295f7f..9b4a7f8c 100644
--- a/src/comm/CactusDefaultComm.c
+++ b/src/comm/CactusDefaultComm.c
@@ -13,52 +13,70 @@
#include "flesh.h"
#include "CactusMainDefaults.h"
+#include "CactusCommDefaults.h"
+#include "GHExtensions.h"
static char *rcsid = "$Id$";
cGH *CactusDefaultSetupGH(tFleshConfig *config, int convergence_level)
{
+ cGH *retval;
cGH *thisGH;
-#ifdef 0
-
- cGFconfig *GF;
-
- cGF **tempGFs;
+ int n_variables;
+ int variable;
+
+ retval = NULL;
- cScala
/* Create a new Grid Hierarchy */
thisGH = (cGH *)malloc(sizeof(cGH));
if(thisGH)
{
- /* Traverse list of GH setup routines. */
- CactusSetupGHTraverse(config, convergence_level, thisGH);
+ thisGH->dim = CCTK_GetMaxDim();
+ thisGH->iteration = 0;
+ thisGH->local_shape = (int *)malloc(thisGH->dim*sizeof(int));
+ thisGH->lower_bound = (int *)malloc(thisGH->dim*sizeof(int));
+ thisGH->upper_bound = (int *)malloc(thisGH->dim*sizeof(int));
+ thisGH->bbox = (int *)malloc(2*thisGH->dim*sizeof(int));
+
+ thisGH->levfac = 1;
- /* Setup GFs */
- thisGH->GFs = NULL;
- thisGH->nGFs = 0;
- for(GF = config->GFs; GF; GF = GF->next)
+ n_variables = CCTK_GetNVariables();
+
+ thisGH->data = (void **)malloc(n_variables*sizeof(void *));
+
+ if(thisGH->data)
{
- thisGH->nGFs++;
- tempGFs = (cGF **)realloc(thisGH->GFs, thisGH->nGFs*sizeof(cGF *));
- if(tempGFs)
+ for(variable = 0; variable < n_variables; variable++)
{
- thisGH->GFs = tempGFs;
- thisGH->GFs[thisGH->nGFs-1] = SetupGF(GH, GF);
+ thisGH->data[variable] = NULL;
}
}
-#endif
- return thisGH;
-}
+ thisGH->extensions = NULL;
-cGF *CactusDefaultSetupGF(cGH *GH, cGF *configdata)
-{
+ thisGH->GroupData = (cGHGroupData *)malloc(CCTK_GetNGroups()*sizeof(cGHGroupData));
+
+ }
- printf("I'm at line %d of file %s\n", __LINE__, __FILE__);
+ if(thisGH &&
+ thisGH->local_shape &&
+ thisGH->lower_bound &&
+ thisGH->upper_bound &&
+ thisGH->bbox &&
+ thisGH->data &&
+ thisGH->GroupData)
+ {
+ /* Traverse list of GH setup routines. */
+ CCTK_TraverseGHExtensions(config, convergence_level, thisGH);
+
+ retval = thisGH;
+ }
+
+ return thisGH;
}
int CactusDefaultSyncAllFuncs(cGH *GH)
@@ -71,7 +89,7 @@ int CactusDefaultSyncGroupFuncs(cGH *GH, const char *group)
printf("I'm at line %d of file %s\n", __LINE__, __FILE__);
}
-int CactusDefaultSyncOneFunc(cGH *GH, cGF *GF)
+int CactusDefaultSyncOneFunc(cGH *GH, int GF)
{
printf("I'm at line %d of file %s\n", __LINE__, __FILE__);
}
@@ -86,7 +104,7 @@ int CactusDefaultParallelFinalise(tFleshConfig *config)
printf("I'm at line %d of file %s\n", __LINE__, __FILE__);
}
-int CactusDefaultReduce(cGH *GH, cGF *GF, int operation, void *result)
+int CactusDefaultReduce(cGH *GH, int GF, int operation, void *result)
{
printf("I'm at line %d of file %s\n", __LINE__, __FILE__);
}
diff --git a/src/comm/GHExtensions.c b/src/comm/GHExtensions.c
new file mode 100644
index 00000000..0e271d0a
--- /dev/null
+++ b/src/comm/GHExtensions.c
@@ -0,0 +1,19 @@
+ /*@@
+ @file GHExtensions.c
+ @date Fri Jan 15 13:22:47 1999
+ @author Tom Goodale
+ @desc
+ Functions to deal with GH extensions
+ @enddesc
+ @@*/
+
+#include "flesh.h"
+
+static char *rcsid = "$Id$";
+
+int CCTK_TraverseGHExtensions(tFleshConfig *config,
+ int convergence_level,
+ cGH *GH)
+{
+ return 0;
+}
diff --git a/src/comm/RegisterCommFunction.c b/src/comm/RegisterCommFunction.c
index e17d4be7..41129f5d 100644
--- a/src/comm/RegisterCommFunction.c
+++ b/src/comm/RegisterCommFunction.c
@@ -28,12 +28,12 @@ int (*SetupGF)(cGH *, cGF *);
int (*SyncAllFuncs)(cGH *);
int (*SyncGroupFuncs)(cGH *, const char *group);
-int (*SyncOneFunc)(cGH*, cGF *);
+int (*SyncOneFunc)(cGH*, int );
int (*ParallelInit)(tFleshConfig *);
int (*ParallelFinalise)(tFleshConfig *);
-int (*Reduce)(cGH *, cGF *, int operation, void *result);
+int (*Reduce)(cGH *, int , int operation, void *result);
/* Array of functions */
@@ -109,16 +109,6 @@ int SetupCommFunctions(void)
if(functions&&functions[0])
{
- SetupGF = (int (*)(cGH *, cGF *))functions[0];
- }
- else
- {
- SetupGF = CactusDefaultSetupGF;
- }
-
-
- if(functions&&functions[0])
- {
SyncAllFuncs = (int (*)(cGH *))functions[0];
}
else
@@ -137,7 +127,7 @@ int SetupCommFunctions(void)
if(functions&&functions[0])
{
- SyncOneFunc = (int (*)(cGH*, cGF *))functions[0];
+ SyncOneFunc = (int (*)(cGH*, int ))functions[0];
}
else
{
@@ -166,7 +156,7 @@ int SetupCommFunctions(void)
if(functions&&functions[0])
{
- Reduce = (int (*)(cGH *, cGF *, int operation, void *result))functions[0];
+ Reduce = (int (*)(cGH *, int , int operation, void *result))functions[0];
}
else
{