4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
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)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Green Red Orange Magenta Azure Cyan Skyblue
33 static char *SRCID_split_h = "$Id$";
40 #ident "@(#) split.h 1.20 12/16/92"
41 #endif /* HAVE_IDENT */
44 * Determine on which node a particle should reside and on which
45 * node is also should be available. The distribution algorithm
46 * should account for the actual ring architecture and how nodes
47 * are numbered. The typedef t_splitd has two separate structures that
48 * describe the distribution:
50 * The nodeinfo part describes which node containst which particles,
51 * while the nodeids part describes on which node(s) a particle can be
52 * found and what local particle number is assigned to it.
59 typedef enum {SPLIT_NONE,SPLIT_SORTX,SPLIT_REDUCE,SPLIT_NR} t_splitalg;
69 int nr; /* Length of the long list. */
70 int *lst; /* The actual list. */
75 t_nlist home; /* List of home particles. */
80 int nnodes; /* Number of nodes this splitinfo is for. */
81 t_nodeinfo *nodeinfo; /* Home and available particles for each node. */
82 int nnodeids; /* Number of particles this splitinfo is for. */
83 t_nodeids *nodeids; /* List of node id's for every particle, */
84 /* entry[nodeid] gives the local atom id (NO_ATID if*/
85 /* not available). Entry[MAXNODES] contains home */
89 extern void init_splitd(t_splitd *splitd,int nnodes,int nnodeids);
91 * Initialises the splitd data structure for the specified number of
92 * nodes (nnodes) and number of atoms (nnodeids).
95 extern void make_splitd(t_splitalg algorithm,int nnodes,t_topology *top,
96 rvec *x,t_splitd *splitd,char *loadfile);
98 * Initialises the splitd data structure for the specified number of
99 * nodes (nnodes) and number of atoms (top) and fills it using
100 * the specified algorithm (algorithm):
102 * SPLIT_NONE : Generate partial systems by dividing it into nnodes
103 * consecutive, equal, parts without any intelligence.
104 * SPLIT_SORTX : Like SPLIT_NONE but sort the coordinates before
105 * dividing the system into nnodes consecutive, equal,
107 * SPLIT_REDUCE : Like SPLIT_NONE but minimise the bond lengths, i.e
108 * invoke the reduce algorithm before dividing the
109 * system into nnodes consecutive, equal, parts.
111 * The topology (top) and the coordinates (x) are not modified. The
112 * calculations of bonded forces are assigned to the node with
113 * the highest id that has one of the needed particles as home particle.
116 extern long wr_split(FILE *fp,t_splitd *splitd);
118 * Writes the split descriptor (splitd) to the file specified by fp.
121 extern long rd_split(FILE *fp,t_splitd *splitd);
123 * Reads the split descriptor (splitd) from the file specified by fp.
126 extern void rm_splitd(t_splitd *splitd);
128 * Frees all allocated space for the splitd data structure.
131 extern void pr_splitd(FILE *fp,int indent,char *title,t_splitd *splitd);
133 * This routine prints out a (human) readable representation of
134 * the split descriptor to the file fp. Ident specifies the
135 * number of spaces the text should be indented. Title is used
136 * to print a header text.
139 extern void split_topology(t_splitalg algorithm,int nnodes,t_topology *top,
140 rvec x[],char *loadfile);
142 * Distributes the non-bonded forces defined in top over nnodes nodes
143 * using the algoritm specified by algorithm. The distribution is made
144 * by creating a split descriptor and then putting a bonded force on the
145 * highest home node number of the paricles involved.
149 #endif /* _split_h */