summaryrefslogtreecommitdiff
path: root/src/main/CactusDefaultShutdown.c
blob: ff2002a497130452d25fa1ee2eddd6deef857cc2 (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
 /*@@
   @file      CactusDefaultShutdown.c
   @date      Fri Feb 26 16:53:58 1999
   @author    Tom Goodale
   @desc 
   The default shutdown routines.
   @enddesc 
 @@*/

#include <stdio.h>

#include "cctk_Flesh.h"
#include "cctk_Comm.h"
#include "CactusMainDefaults.h"

static const char *rcsid = "$Header$";

CCTK_FILEVERSION(main_CactusDefaultShutdown_c);

 /*@@
   @routine    CactusDefaultShutdown
   @date       Tue Sep 29 12:45:04 1998
   @author     Tom Goodale 
   @desc 
   Default shutdown routine.
   @enddesc 
   @calls     
   @calledby   
   @history introducing CCTK_SHUTDOWN scheduling [03/00  Gerd Lanfermann]
 
   @endhistory 

@@*/
int CactusDefaultShutdown(tFleshConfig *config)
{
  unsigned int conv_level;

  /* Execute termination for all convergence levels */
  for(conv_level = 0 ; conv_level < config->nGHs;  conv_level++) 
  {    
    CCTK_Traverse(config->GH[conv_level], "CCTK_TERMINATE"); 
  }
 
  /* Execute shutdown for all convergence levels */
  for(conv_level = 0 ; conv_level < config->nGHs;  conv_level++) 
  {    
    CCTK_Traverse(config->GH[conv_level], "CCTK_SHUTDOWN"); 
  }

  return 0;
}