blob: 3f6bb199114481c2d063a978ca0b143e439623e1 (
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
|
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "cctk.h"
#include "cctk_Parameters.h"
#include "Carpet/CarpetLib/src/dist.hh"
#include "carpet.hh"
extern "C" {
static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Shutdown.cc,v 1.8 2002/10/24 10:39:39 schnetter Exp $";
CCTK_FILEVERSION(Carpet_Carpet_Shutdown_cc);
}
namespace Carpet {
using namespace std;
int Shutdown (tFleshConfig* fc)
{
DECLARE_CCTK_PARAMETERS;
Waypoint ("starting Shutdown...");
const int convlev = 0;
cGH* cgh = fc->GH[convlev];
set_mglevel (cgh, 0);
Waypoint ("Current time is %g", cgh->cctk_time);
// Terminate
Waypoint ("%*sScheduling TERMINATE", 2*reflevel, "");
CCTK_ScheduleTraverse ("CCTK_TERMINATE", cgh, CallFunction);
// Shutdown
Waypoint ("%*sScheduling SHUTDOWN", 2*reflevel, "");
CCTK_ScheduleTraverse ("CCTK_SHUTDOWN", cgh, CallFunction);
set_mglevel (cgh, -1);
CCTK_PRINTSEPARATOR;
printf ("Done.\n");
// earlier checkpoint before calling finalising MPI
Waypoint ("done with Shutdown.");
dist::finalize();
return 0;
}
} // namespace Carpet
|