e886f4a9e6cec86251d3ef0c2264eb2681dbd744
[alexxy/gromacs.git] / include / types / nsborder.h
1 /*
2  * $Id$
3  * 
4  *       This source code is part of
5  * 
6  *        G   R   O   M   A   C   S
7  * 
8  * GROningen MAchine for Chemical Simulations
9  * 
10  *               VERSION 2.0
11  * 
12  * Copyright (c) 1991-1999
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * Please refer to:
17  * GROMACS: A message-passing parallel molecular dynamics implementation
18  * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19  * Comp. Phys. Comm. 91, 43-56 (1995)
20  * 
21  * Also check out our WWW page:
22  * http://md.chem.rug.nl/~gmx
23  * or e-mail to:
24  * gromacs@chem.rug.nl
25  * 
26  * And Hey:
27  * Green Red Orange Magenta Azure Cyan Skyblue
28  */
29
30 #ifdef HAVE_CONFIG_H
31 #include <config.h>
32 #endif
33
34 typedef struct {
35   int  nodeid;                  /* Node id                              */
36   int  nnodes;                  /* The number of nodes                  */
37   int  cgtotal;                 /* Total number of charge groups        */
38   int  natoms;                  /* Total number of atoms                */
39   int  nstDlb;                  /* Every how many steps must we do load */
40                                 /* balancing                            */
41   int  shift,bshift;            /* Coordinates are shifted left for     */
42                                 /* 'shift' systolic pulses, and right   */
43                                 /* for 'bshift' pulses. Forces are      */
44                                 /* shifted right for 'shift' pulses     */
45                                 /* and left for 'bshift' pulses         */
46                                 /* This way is not necessary to shift   */
47                                 /* the coordinates over the entire ring */
48   int  homenr[MAXNODES];        /* The number of home particles         */
49   int  index[MAXNODES];         /* The starting of the home atoms       */
50   int  cgload[MAXNODES];        /* Division of charge groups over CPUS  */
51                                 /* This is static, i.e. it does not     */
52                                 /* change during the simulation         */
53   int  workload[MAXNODES];      /* This is the load for neighbor-       */
54                                 /* searching, this is initially the same*/
55                                 /* as cgload, but may change due to     */
56                                 /* dynamic load balancing               */
57 } t_nsborder;
58
59 #define START(nsb)  ((nsb)->index[(nsb)->nodeid])
60 #define HOMENR(nsb) ((nsb)->homenr[(nsb)->nodeid])
61 #define CG0(nsb)    (((nsb)->nodeid == 0) ? 0 : (nsb)->cgload[(nsb)->nodeid-1])
62 #define CG1(nsb)    ((nsb)->cgload[(nsb)->nodeid])