fixed incorrect PME load balancing limitation
[gromacs.git] / include / types / nblist.h
blobae5aea1853383ac0d009469cb3e8842694d8ea22
1 /*
2 *
3 * This source code is part of
4 *
5 * G R O M A C S
6 *
7 * GROningen MAchine for Chemical Simulations
8 *
9 * VERSION 3.2.0
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
32 * And Hey:
33 * GRoups of Organic Molecules in ACtion for Science
35 #ifndef _nblist_h
36 #define _nblist_h
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
42 /* Neighborlist type */
43 enum {
44 enlistATOM_ATOM,
45 enlistSPC_ATOM, enlistSPC_SPC,
46 enlistTIP4P_ATOM, enlistTIP4P_TIP4P,
47 enlistCG_CG,
48 enlistNR
51 typedef unsigned long t_excl;
53 /* The maximum charge group size because of minimum size of t_excl
54 * could be 32 bits.
56 #define MAX_CHARGEGROUP_SIZE 32
58 /* The maximum charge group size for CG-CG nblists.
59 * The excl entry in t_nblist uses blocks of this size.
61 #define MAX_CGCGSIZE 32
63 typedef struct
65 int enlist; /* The type of nblist, enum, see above */
66 int il_code; /* Innerloop index from nrnb.h, used */
67 /* for flop accounting. */
68 int icoul; /* Coulomb loop type index for kernels */
69 int ivdw; /* VdW loop type index for kernels */
70 int free_energy; /* Free energy setting for this list */
72 int nri,maxnri; /* Current/max number of i particles */
73 int nrj,maxnrj; /* Current/max number of j particles */
74 int maxlen; /* maxnr of j atoms for a single i atom */
75 int * iinr; /* The i-elements */
76 int * iinr_end; /* The end atom, only with enlistCG */
77 int * gid; /* Index in energy arrays */
78 int * shift; /* Shift vector index */
79 int * jindex; /* Index in jjnr */
80 int * jjnr; /* The j-atom list */
81 int * jjnr_end; /* The end atom, only with enltypeCG */
82 t_excl * excl; /* Exclusions, only with enltypeCG */
83 int count; /* counter to multithread the innerloops */
84 void * mtx; /* mutex to lock the counter */
85 } t_nblist;
88 /* For atom I = nblist->iinr[N] (0 <= N < nblist->nri) there can be
89 * several neighborlists (N's), for different energy groups (gid) and
90 * different shifts (shift).
91 * For corresponding J atoms for each list start at:
92 * nblist->jjnr[JI]
93 * with nblist->jindex[N] <= JI < nblist->jindex[N+1]
95 * enlist is of the form enlistUNIT1_UNIT2:
96 * UNIT ATOM: there is one atom: iinr[N] or jjnr[JI]
97 * UNIT SPC: there are 3 atoms: iinr[N],iinr[N]+1,iinr[N]+2, jjnr analog.
98 * UNIT TIP4P: there are 4 atoms: iinr[N],...,iinr[N]+3, jjnr analog.
99 * UNIT CG: there are N atoms: iinr[N],...,iinr_end[N]-1, jjnr analog.
101 * Clear?
104 #ifdef __cplusplus
106 #endif
108 #endif