aboutsummaryrefslogtreecommitdiff
path: root/src/include/pGH.h
blob: 5bc3b5dff319746930a113f032dc5e365b704263 (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
 /*@@
   @header    pGH.h
   @date      Fri Feb 21 10:12:58 1997
   @author    Tom Goodale, Paul Walker
   @desc 
   The Pugh Grid Hierarchy structure. 
   @enddesc 
   @version $Header$
 @@*/

#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       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 */

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

  int      *perme;              /* Periodic in each direction? */
  int       periodic;           /* Is the system periodic? */

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


  /* Coordinate information */
  CCTK_REAL dx0, dy0, dz0, dt0; /* Delta of our system */
  CCTK_REAL lx0, ly0, lz0;      /* Processor-Local coordinate origins */
  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 */

  /* 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

  /* Used for all grid functions */
  pGExtras **GFExtras;          /* [dim] stagger ? */
  pConnectivity **Connectivity; /* [dim] */

  /* FIXME :  should be a dynamically allocated string.
   * If you change this, please change the line in pugh_SetupGH.
   */
  char identity_string[20];
} pGH;

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