aboutsummaryrefslogtreecommitdiff
path: root/src/include/pGH.h
blob: 450bc35143dbac0b0a75e72b238cece50fc429f5 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
 /*@@
   @header    pGH.h
   @date      Fri Feb 21 10:12:58 1997
   @author    
   @desc 
   The Pugh Grid Hierarchy structure. There isn't much point in having
   a GridHierarchy without GridFunctions, so you'd better see
   @seefile pGF.h also.
   @enddesc 
   @history
   @hauthor Gabrielle Allen
   @hdate Sep 10 @hdesc Added the iteration number on a GH
   @endhistory
   @history
   @hauthor Gabrielle Allen @hdate 26 Sep 1998
   @desc Changed IO parameter names, removed GH->out3D_mode, added t_iopars
        structure
   @hauthor Gabrielle Allen @hdate 17 Oct 1998
   @desc Added more IO parameters to IO structure
        structure
   @hauthor Gabrielle Allen @hdate 3 Nov 1998
   @desc Added forceSync
   @hauthor Thomas Radke @hdate 30 Mar 1999
   @desc Added sync_verbose and comm_time
   @endhistory
   @version $Id$
 @@*/

#include "pugh_constants.h"

typedef struct PGH 
{

#ifdef MPI
  MPI_Comm PUGH_COMM_WORLD;       /* A MPIcommunicator */
#endif

  /* pGH identifier */
  void     *callerid;

  int       dim;                /* The dimension of the GH */

  /* Size of the processor group */
  int       nprocs;		/* Number of processors */
  int       myproc;		/* My processor */
  int      *nproc;	        /* Processor topology */
  int       commmodel;          /* Comm model is PUGH_ALLOCATEDBUFFERS */ 
                                /* or PUGH_DERIVEDTYPES. Currently unused */
  
  /* Size of the problems */
  int       nvariables;		/* Number of Grid variables */
  void   ***variables;		/* Pointers to them */
  int      *nsize;		/* Physical size of the Problem */
  int      *nghostzones;	/* Width of ghost zone */

  /* What time level we're on */
  int       timelevel;

  /* Processor group layouts */
  CCTK_REAL maxskew;		/* Maximum point skew */
  int       periodic;		/* Is the system periodic? */
  int     **lb;			/* Lower bound (nprocs X 3) for each proc */
  int     **ub;			/* Upper bound (same sizes) */
  int      *lnsize;		/* Size on this processor */
  int       npoints;		/* LOCAL number of points on this proc. */
  int      *rnpoints;		/* Number of points on each proc */
  int     **rnsize;	        /* [#points on a proc][in each dir] */
  int     **neighbors;		/* Neighbours (proc num) on each side */
                                /* [nprocs x 2 * dim] */
  int       stagger;            /* Is staggering turned on? */

  int       forceSync;          /* force synchronisation of GFs with storage */

  /* Ghosts and overlaps. */
  int      *ownership[PUGH_NSTAGGER][2];	
                                /* The box owned in each direction. */
                                /* [stagger][min/max][dir] */
				
  int     **ghosts[PUGH_NSTAGGER][2];	
                                /* The ghost zones on each face. */
                                /* [stagger][min/max][face][dir] */
				
  int     **overlap[PUGH_NSTAGGER][2];	
                                /* The overlap region owned on each face. */
			        /* [stagger][min/max][face][ijk] */
				 

  /* Coordinate information */
  CCTK_REAL cx0, cy0, cz0;	/* Origin of our system */
  CCTK_REAL dx0, dy0, dz0, dt0;	/* Delta of our system */
  CCTK_REAL lx0, ly0, lz0;	/* Processor-Local coordinate origins */
  CCTK_REAL phys_time;          /* physical time */
  int       GHiteration;        /* iteration number on processor */

  
  

  /* Indentification for a pGH */
  int       level;              /* level in Berger-Oliger stack */
  int       mglevel;            /* level in multigrid stack */
  int       convlevel;          /* level in convergence stack */

  /* pGH flags */
  int       active;             /* 1 -> GH active */
                                /* 0 -> GH is skipped for conv.test */
                                /* is used in NanCheckGH.c */
  int       sync_verbose;       /* verbose output during synchronization */

  /* FIXME */
  double    comm_time;          /* time spent in communication */

#ifdef MPI
  /* the complex datatype defined in SetupPGH.c */
  MPI_Datatype pugh_mpi_complex;
  /* Derived data types for communication */
  MPI_Datatype send_char_dt [PUGH_NSTAGGER][6];
  MPI_Datatype recv_char_dt [PUGH_NSTAGGER][6];
  MPI_Datatype send_int_dt  [PUGH_NSTAGGER][6];
  MPI_Datatype recv_int_dt  [PUGH_NSTAGGER][6];
  MPI_Datatype send_real_dt [PUGH_NSTAGGER][6];
  MPI_Datatype recv_real_dt [PUGH_NSTAGGER][6];
  MPI_Datatype send_complex_dt [PUGH_NSTAGGER][6];
  MPI_Datatype recv_complex_dt [PUGH_NSTAGGER][6];
#endif

  pGExtras **GFExtras;
  pConnectivity **Connectivity;

  /* #include "pGH_Extensions.h" */

} pGH;

#define XDP   1
#define XDM   0
#define YDP   3
#define YDM   2
#define ZDP   5
#define ZDM   4