4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-2001
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
34 * Good ROcking Metal Altar for Chronical Sinners
40 static char *SRCID_split_h = "$Id$";
46 #ident "@(#) split.h 1.20 12/16/92"
47 #endif /* HAVE_IDENT */
50 * Determine on which node a particle should reside and on which
51 * node is also should be available. The distribution algorithm
52 * should account for the actual ring architecture and how nodes
53 * are numbered. The typedef t_splitd has two separate structures that
54 * describe the distribution:
56 * The nodeinfo part describes which node containst which particles,
57 * while the nodeids part describes on which node(s) a particle can be
58 * found and what local particle number is assigned to it.
65 typedef enum {SPLIT_NONE,SPLIT_SORTX,SPLIT_REDUCE,SPLIT_NR} t_splitalg;
75 int nr; /* Length of the long list. */
76 int *lst; /* The actual list. */
81 t_nlist home; /* List of home particles. */
86 int nnodes; /* Number of nodes this splitinfo is for. */
87 t_nodeinfo *nodeinfo; /* Home and available particles for each node. */
88 int nnodeids; /* Number of particles this splitinfo is for. */
89 t_nodeids *nodeids; /* List of node id's for every particle, */
90 /* entry[nodeid] gives the local atom id (NO_ATID if*/
91 /* not available). Entry[MAXNODES] contains home */
95 extern void init_splitd(t_splitd *splitd,int nnodes,int nnodeids);
97 * Initialises the splitd data structure for the specified number of
98 * nodes (nnodes) and number of atoms (nnodeids).
101 extern void make_splitd(t_splitalg algorithm,int nnodes,t_topology *top,
102 rvec *x,t_splitd *splitd,char *loadfile);
104 * Initialises the splitd data structure for the specified number of
105 * nodes (nnodes) and number of atoms (top) and fills it using
106 * the specified algorithm (algorithm):
108 * SPLIT_NONE : Generate partial systems by dividing it into nnodes
109 * consecutive, equal, parts without any intelligence.
110 * SPLIT_SORTX : Like SPLIT_NONE but sort the coordinates before
111 * dividing the system into nnodes consecutive, equal,
113 * SPLIT_REDUCE : Like SPLIT_NONE but minimise the bond lengths, i.e
114 * invoke the reduce algorithm before dividing the
115 * system into nnodes consecutive, equal, parts.
117 * The topology (top) and the coordinates (x) are not modified. The
118 * calculations of bonded forces are assigned to the node with
119 * the highest id that has one of the needed particles as home particle.
122 extern long wr_split(FILE *fp,t_splitd *splitd);
124 * Writes the split descriptor (splitd) to the file specified by fp.
127 extern long rd_split(FILE *fp,t_splitd *splitd);
129 * Reads the split descriptor (splitd) from the file specified by fp.
132 extern void rm_splitd(t_splitd *splitd);
134 * Frees all allocated space for the splitd data structure.
137 extern void pr_splitd(FILE *fp,int indent,char *title,t_splitd *splitd);
139 * This routine prints out a (human) readable representation of
140 * the split descriptor to the file fp. Ident specifies the
141 * number of spaces the text should be indented. Title is used
142 * to print a header text.
145 extern void split_topology(t_splitalg algorithm,int nnodes,t_topology *top,
146 rvec x[],char *loadfile);
148 * Distributes the non-bonded forces defined in top over nnodes nodes
149 * using the algoritm specified by algorithm. The distribution is made
150 * by creating a split descriptor and then putting a bonded force on the
151 * highest home node number of the paricles involved.
155 #endif /* _split_h */