diff options
author | swhite <swhite@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2006-02-13 13:13:53 +0000 |
---|---|---|
committer | swhite <swhite@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2006-02-13 13:13:53 +0000 |
commit | e34e562469d812a0c36bf8876b3bdee83db7f91d (patch) | |
tree | 2c23c1cec7e3c9d026861280904fbdded5bca362 /src/main | |
parent | f1616b9801380fecd8885f21cacae571a1c4a91c (diff) |
See Cactus Patches <patches@cactuscode.org>
Subject: CactusDefaultEvolve.c cleanup
Date: Fri, 23 Dec 2005 15:43:50 +0100
The code in CactusDefaultEvolve.c, was complicated by
1) a global variable, cactus_terminate, which is checked but
never set except in commented-out code, and
2) a lot of other commented-out code.
This patch only removes code that is never used, and is intended to make
the remaining code easier to follow and potentially safer.
I checked all arrangements available to me, including Carpet, for
cactus_terminate. It appears only in
CactusPUGH/PUGH/src/Evolve.c (where it is commented out)
AlphaThorns/Spawner/src/Evolve.c
This change removes
* live but useless code that references cactus_terminate
* commented-out TerminationStepper function
* commented-out code for cactus_terminate_global
* now-unused TERMINATION_RAISED_BRDCAST
* numerous commented out CCTK*Timer code
I checked to see that it compiles, and is a patch against the most recent
checkout. I then ran the standard testsuites with the modified code and
verified that their results were identical to those with the unmodified code.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4253 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/CactusDefaultEvolve.c | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/src/main/CactusDefaultEvolve.c b/src/main/CactusDefaultEvolve.c index ca30db2f..72bbeaa3 100644 --- a/src/main/CactusDefaultEvolve.c +++ b/src/main/CactusDefaultEvolve.c @@ -35,8 +35,6 @@ CCTK_FILEVERSION(main_CactusDefaultEvolve_c); /* Define some macros for convenience. */ -#define TERMINATION_RAISED_BRDCAST 4 - #define ForallConvLevels(iteration, conv_level) \ { \ int factor = 1; \ @@ -51,17 +49,6 @@ CCTK_FILEVERSION(main_CactusDefaultEvolve_c); } \ } -int cactus_terminate; - - -/******************************************************************** - ********************* Local Data ***************************** - ********************************************************************/ - -#if 0 -static int cactus_terminate_global = 0; -#endif - /******************************************************************** ********************* Local Routine Prototypes ********************* ********************************************************************/ @@ -112,11 +99,6 @@ int CactusDefaultEvolve (tFleshConfig *config) int var; unsigned int convergence_level, iteration; - -#if 0 - CactusStartTimer (config->timer[OUTPUT]); -#endif - /*** Call OUTPUT for this GH (this routine ***/ /*** checks if output is necessary) and makes ***/ /*** a Traverse with CCTK_ANALYSIS ***/ @@ -128,11 +110,6 @@ int CactusDefaultEvolve (tFleshConfig *config) } EndForallConvLevels; -#if 0 - CactusStopTimer (config->timer[OUTPUT]); - CactusStartTimer (config->timer[EVOLUTION]); -#endif - while (! DoneMainLoop (config->GH[0], config->GH[0]->cctk_time, iteration)) { if (iteration == 0) @@ -170,10 +147,6 @@ int CactusDefaultEvolve (tFleshConfig *config) } EndForallConvLevels; - /* Output perhaps */ -#if 0 - CactusStartTimer (config->timer[OUTPUT]); -#endif /*** Call OUTPUT for this GH (this routine ***/ /*** checks if output is necessary) and makes ***/ /*** an Traverse with CCTK_ANALYSIS ***/ @@ -184,27 +157,8 @@ int CactusDefaultEvolve (tFleshConfig *config) } EndForallConvLevels; -#if 0 - CactusStopTimer (config->timer[OUTPUT]); -#endif - -#if 0 - ConvergenceReport (config->GH, iteration); - TerminationStepper (config->GH[0]); -#endif - - /* Termination has been raised and broadcasted, exit loop*/ - if (cactus_terminate == TERMINATION_RAISED_BRDCAST) - { - break; - } - } /*** END OF MAIN ITERATION LOOP ***/ -#if 0 - CactusStopTimer (config->timer[EVOLUTION]); -#endif - return (0); } @@ -352,40 +306,3 @@ static void StepGH (cGH *GH) CCTK_Traverse (GH, "CCTK_POSTSTEP"); } - -#if 0 - /*@@ - @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 the scheduler - 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 CCTK_Traverse -@@*/ -static void TerminationStepper (cGH *GH) -{ - cactus_terminate_global = cactus_terminate; - -#ifdef CCTK_MPI - MPI_Allreduce (&cactus_terminate, &cactus_terminate_global, 1, MPI_INT, - MPI_LOR, MPI_COMM_WORLD); -#endif - if (cactus_terminate_global) - { - cactus_terminate = TERMINATION_RAISED_BRDCAST; - printf ("RECEIVED GLOBAL TERMINATION SIGNAL\n"); - } - - CCTK_Traverse (GH, "CCTK_TERMINATE"); -} -#endif |