summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-02-01 11:54:53 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-02-01 11:54:53 +0000
commit77030a22f5f037e9e0e4f9efd0943f1d10fc3cc1 (patch)
treef6a339cd8575d3d31327ec3cb5a61944395f5209
parentd29b4a34079016d3a958bc292ec7b1d4a16007bf (diff)
Put in lots of calls to the rfr.
Added Groups.c which should contain the master functions for dealing with Groups. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@162 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--src/main/CactusDefaultEvolve.c191
-rw-r--r--src/main/CactusDefaultInitialise.c51
-rw-r--r--src/main/Groups.c32
-rw-r--r--src/main/ProcessCommandLine.c2
-rw-r--r--src/main/make.code.defn1
5 files changed, 257 insertions, 20 deletions
diff --git a/src/main/CactusDefaultEvolve.c b/src/main/CactusDefaultEvolve.c
index 8533e420..ad4f0db9 100644
--- a/src/main/CactusDefaultEvolve.c
+++ b/src/main/CactusDefaultEvolve.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include "flesh.h"
-#include "parameters.h"
+#include "rfr_constants.h"
static char *rcsid="$Id$";
@@ -33,11 +33,12 @@ static char *rcsid="$Id$";
/* Quick stuff for testing purposes. */
#define EVOLUTION 1
#define OUTPUT 2
-int itlast;
+static int itlast =0;
int cactus_terminate;
-#define CACTUS_CHECKPOINT 3
+static int cactus_terminate_global = 0;
#define TERMINATION_RAISED_BRDCAST 4
+
/*@@
@routine CactusDefaultEvolve
@date Thu Oct 8 17:30:15 1998
@@ -59,9 +60,9 @@ int CactusDefaultEvolve(tFleshConfig *config)
CactusStartTimer(config->timer[EVOLUTION]);
-#ifdef 0
- InfoHeader(config);
-#endif
+ /*
+ CCTK_InfoHeader(config);
+ */
while (iteration<itlast)
{
@@ -71,21 +72,19 @@ int CactusDefaultEvolve(tFleshConfig *config)
ForallConvLevels(iteration, convergence_level)
- {
-#ifdef 0
- StepGH(config->GH[convergence_level]);
- InfoOutput(config->GH[convergence_level], convergence_level);
-#endif
- }
+ {
+ CCTK_StepGH(config->GH[convergence_level]);
+ /*
+ CCTK_InfoOutput(config->GH[convergence_level], convergence_level);
+ */
+ }
EndForallConvLevels;
/* Dump out checkpoint data on all levels */
ForallConvLevels(iteration, convergence_level)
- {
-#ifdef 0
- rfrTraverse(config->GH[convergence_level],CACTUS_CHECKPOINT);
-#endif
- }
+ {
+ rfrTraverse(config->GH[convergence_level],CACTUS_CHECKPOINT);
+ }
EndForallConvLevels;
/* Output perhaps */
@@ -119,3 +118,161 @@ int CactusDefaultEvolve(tFleshConfig *config)
return 0;
}
+/************************************************************************/
+
+/* The following routines have been nicked from 3.0 for the moment. */
+
+
+
+
+
+ /*@@
+ @routine CStepper
+ @date Fri Aug 14 12:39:49 1998
+ @author Gerd Lanfermann
+ @desc
+ The full set of routines used to execute all rfr steps
+ int the main iteration loop. Makes calls to the individual
+ routines for each rfr step.
+ @enddesc
+ @calls PreStepper, EvolStepper, PostStepper, BoundStepper
+ @calledby main
+ @@*/
+
+int CCTK_StepGH(cGH *GH) {
+ void PreStepper(cGH *GH);
+ void EvolStepper(cGH *GH);
+ void PostStepper(cGH *GH);
+ void BoundStepper(cGH *GH);
+ PreStepper(GH);
+ EvolStepper(GH);
+ BoundStepper(GH);
+ PostStepper(GH);
+}
+
+ /*@@
+ @routine PreStepper
+ @date Fri Aug 14 12:43:20 1998
+ @author Gerd Lanfermann
+ @desc
+ calls RFR-PRESTEP
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+void PreStepper(cGH *GH) {
+ int Rstep;
+
+ /* Call the rfr with CACTUS_PRESTEP */
+ for (Rstep = CACTUS_PRESTEP;Rstep <= CACTUS_PRESTEP5; Rstep++)
+ rfrTraverse(GH, Rstep);
+}
+ /*@@
+ @routine EvolStepper
+ @date Fri Aug 14 12:44:00 1998
+ @author Gerd Lanfermann
+ @desc
+ calls RFR-EVOLUTION, checks for nans, increases physical time
+ @enddesc
+ @calls
+ @calledby
+ @history
+ @hauthor Gabrielle Allen
+ @hdate Sep 98 @hdesc Advance GHiteration
+ @endhistory
+@@*/
+
+void EvolStepper(cGH *GH) {
+ /* Call the rfr with Evolution */
+ rfrTraverse(GH, CACTUS_EVOL);
+ /* after Evolution check for NANs */
+
+#ifdef 0
+ /* Increment physical time now */
+ GH->phys_time = GH->phys_time + GH->dt0;
+#endif
+
+ GH->iteration++;
+
+
+}
+ /*@@
+ @routine BoundStepper
+ @date Fri Aug 14 12:44:58 1998
+ @author Gerd Lanfermann
+ @desc
+ calls RFR-CACTUS_BOUND applies boudnary conditions
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+void BoundStepper(cGH *GH) {
+ rfrTraverse(GH,CACTUS_BOUND);
+}
+
+ /*@@
+ @routine PostStepper
+ @date Fri Aug 14 12:45:39 1998
+ @author Gerd Lanfermann
+ @desc
+ calls the routines rgeistered as CACTUS_POSSTEPS
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+void PostStepper(cGH *GH) {
+ int Rstep;
+ /* Call the rfr with post step */
+ for (Rstep = CACTUS_POSTSTEP; Rstep <= CACTUS_POSTSTEP10; Rstep++)
+ rfrTraverse(GH, Rstep);
+}
+ /*@@
+ @routine TerminationStepper
+ @date Fri Aug 14 13:07:11 1998
+ @author Gerd Lanfermann
+ @desc
+ catctus_terminate is a global variable with these values:
+ TERMINATION_NOT_RAISED : not signaled yet (cactus_initial.c)
+ TERMINATION_RAISED_LOCAL : signaled on one PE, not reduced (MPI_LOR)
+ to all PEs yet (main.c)
+ TERMINATION_RAISED_BRDCAST: reduced -> can now be used to terminate
+ (chkpnt_terminate.c) by RFR
+ the raised termiantion signal is caught on 1 PE only and has to be recduced
+ on all PEs before a termination sequenced can be launched (I like that)
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+void TerminationStepper(cGH *GH) {
+ int cactus_terminate_global;
+
+ cactus_terminate_global=cactus_terminate;
+#ifdef MPI
+ MPI_Allreduce(&cactus_terminate,&cactus_terminate_global,1,
+ MPI_INT,MPI_LOR,GH->PUGH_COMM_WORLD);
+#endif
+ if (cactus_terminate_global) {
+ cactus_terminate=TERMINATION_RAISED_BRDCAST;
+ printf("RECEIVED GLOBAL TERMINATION SIGNAL \n");
+ }
+ rfrTraverse(GH,CACTUS_TERMINATE);
+}
diff --git a/src/main/CactusDefaultInitialise.c b/src/main/CactusDefaultInitialise.c
index e1cbaca7..baca41a3 100644
--- a/src/main/CactusDefaultInitialise.c
+++ b/src/main/CactusDefaultInitialise.c
@@ -15,6 +15,7 @@
#include "CactusMainDefaults.h"
#include "CactusCommFunctions.h"
#include "parameters.h"
+#include "rfr_constants.h"
static char *rcsid = "$Id$";
@@ -46,9 +47,9 @@ int CactusDefaultInitialise(tFleshConfig *config)
while((GH = SetupGH(config, convergence_level)))
{
CCTK_AddGH(config, convergence_level, GH);
-#ifdef 0
+
Cactus_InitialiseGH(GH);
-#endif
+
convergence_level++;
};
@@ -80,8 +81,54 @@ int CactusDefaultShutdown(tFleshConfig *config)
return 0;
}
+
+ /*@@
+ @routine Cactus_InitialiseGH
+ @date Mon Feb 1 12:13:09 1999
+ @author Tom Goodale
+ @desc
+ Responsible for initialising a GH.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
int Cactus_InitialiseGH(cGH *GH)
{
+
+ int Rstep;
+
+ /*
+ SetupFortranArrays(GH);
+ */
+
+ CCTK_TraverseGHExtensions(GH, "INITIALISE");
+
CCTK_BindingsScheduleRegister("RFRINIT", (void *)GH);
+
+ /* Do various rfr traversals. Will tidy up later. */
+
+ rfrTraverse(GH, CACTUS_BASEGRID);
+ rfrTraverse(GH,CACTUS_INITIAL0);
+
+ /* Loops like this should go eventually... */
+ for (Rstep = CACTUS_INITIAL; Rstep <= CACTUS_INITIAL9; Rstep++)
+ {
+ rfrTraverse(GH,Rstep);
+ }
+
+ /* Ignore checkpointing for now.
+ * rfrTraverse(GH,CACTUS_RECOVER);
+ * rfrTraverse(GH,CACTUS_CPINITIAL);
+ */
+
+ for (Rstep = CACTUS_POSTSTEP; Rstep <= CACTUS_POSTSTEP10; Rstep++)
+ {
+ rfrTraverse(GH,Rstep);
+ }
+
}
diff --git a/src/main/Groups.c b/src/main/Groups.c
new file mode 100644
index 00000000..e9695b3c
--- /dev/null
+++ b/src/main/Groups.c
@@ -0,0 +1,32 @@
+ /*@@
+ @file Groups.c
+ @date Mon Feb 1 12:16:28 1999
+ @author Tom Goodale
+ @desc
+ Routines to deal with groups.
+ @enddesc
+ @@*/
+
+#include"flesh.h"
+
+static char *rcsid = "$Id$";
+
+int CCTK_EnableGroupStorage(cGH *GH, const char *group)
+{
+ return 0;
+}
+
+int CCTK_DisableGroupStorage(cGH *GH, const char *group)
+{
+ return 0;
+}
+
+int CCTK_EnableGroupCommunication(cGH *GH, const char *group)
+{
+ return 0;
+}
+
+int CCTK_DisableGroupCommunication(cGH *GH, const char *group)
+{
+ return 0;
+}
diff --git a/src/main/ProcessCommandLine.c b/src/main/ProcessCommandLine.c
index a8a8f118..1b80fec9 100644
--- a/src/main/ProcessCommandLine.c
+++ b/src/main/ProcessCommandLine.c
@@ -44,7 +44,7 @@ int ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigData)
argv = *inargv;
- /* Process the command line */
+ /* Process the command line - needs some work !*/
if(argc>1)
{
diff --git a/src/main/make.code.defn b/src/main/make.code.defn
index 499d09d8..cc9ca931 100644
--- a/src/main/make.code.defn
+++ b/src/main/make.code.defn
@@ -15,4 +15,5 @@ SetParams.c\
ShutdownCactus.c\
StoreVariableData.c\
flesh.cc\
+Groups.c