2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team,
6 * check out http://www.gromacs.org for more information.
7 * Copyright (c) 2012, by the GROMACS development team, led by
8 * David van der Spoel, Berk Hess, Erik Lindahl, and including many
9 * others, as listed in the AUTHORS file in the top-level source
10 * directory and at http://www.gromacs.org.
12 * GROMACS is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public License
14 * as published by the Free Software Foundation; either version 2.1
15 * of the License, or (at your option) any later version.
17 * GROMACS is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with GROMACS; if not, see
24 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * If you want to redistribute modifications to GROMACS, please
28 * consider that scientific software is very special. Version
29 * control is crucial - bugs must be traceable. We will be happy to
30 * consider code for inclusion in the official distribution, but
31 * derived work must not be called official GROMACS. Details are found
32 * in the README & COPYING files - if they are missing, get the
33 * official version at http://www.gromacs.org.
35 * To help us fund GROMACS development, we humbly ask that you cite
36 * the research papers on the package. Check out http://www.gromacs.org.
43 * Determine on which node a particle should reside and on which
44 * node is also should be available. The distribution algorithm
45 * should account for the actual ring architecture and how nodes
46 * are numbered. The typedef t_splitd has two separate structures that
47 * describe the distribution:
49 * The nodeinfo part describes which node containst which particles,
50 * while the nodeids part describes on which node(s) a particle can be
51 * found and what local particle number is assigned to it.
62 typedef enum {SPLIT_NONE,SPLIT_SORTX,SPLIT_REDUCE,SPLIT_NR} t_splitalg;
72 int nr; /* Length of the long list. */
73 int *lst; /* The actual list. */
78 t_nlist home; /* List of home particles. */
83 int nnodes; /* Number of nodes this splitinfo is for. */
84 t_nodeinfo *nodeinfo; /* Home and available particles for each node. */
85 int nnodeids; /* Number of particles this splitinfo is for. */
86 t_nodeids *nodeids; /* List of node id's for every particle, */
87 /* entry[nodeid] gives the local atom id (NO_ATID if*/
88 /* not available). Entry[MAXNODES] contains home */
92 void init_splitd(t_splitd *splitd,int nnodes,int nnodeids);
94 * Initialises the splitd data structure for the specified number of
95 * nodes (nnodes) and number of atoms (nnodeids).
98 void make_splitd(t_splitalg algorithm,int nnodes,t_topology *top,
99 rvec *x,t_splitd *splitd,char *loadfile);
101 * Initialises the splitd data structure for the specified number of
102 * nodes (nnodes) and number of atoms (top) and fills it using
103 * the specified algorithm (algorithm):
105 * SPLIT_NONE : Generate partial systems by dividing it into nnodes
106 * consecutive, equal, parts without any intelligence.
107 * SPLIT_SORTX : Like SPLIT_NONE but sort the coordinates before
108 * dividing the system into nnodes consecutive, equal,
110 * SPLIT_REDUCE : Like SPLIT_NONE but minimise the bond lengths, i.e
111 * invoke the reduce algorithm before dividing the
112 * system into nnodes consecutive, equal, parts.
114 * The topology (top) and the coordinates (x) are not modified. The
115 * calculations of bonded forces are assigned to the node with
116 * the highest id that has one of the needed particles as home particle.
119 long wr_split(FILE *fp,t_splitd *splitd);
121 * Writes the split descriptor (splitd) to the file specified by fp.
124 long rd_split(FILE *fp,t_splitd *splitd);
126 * Reads the split descriptor (splitd) from the file specified by fp.
129 void rm_splitd(t_splitd *splitd);
131 * Frees all allocated space for the splitd data structure.
134 void pr_splitd(FILE *fp,int indent,char *title,t_splitd *splitd);
136 * This routine prints out a (human) readable representation of
137 * the split descriptor to the file fp. Ident specifies the
138 * number of spaces the text should be indented. Title is used
139 * to print a header text.
142 void split_topology(t_splitalg algorithm,int nnodes,t_topology *top,
143 rvec x[],char *loadfile);
145 * Distributes the non-bonded forces defined in top over nnodes nodes
146 * using the algoritm specified by algorithm. The distribution is made
147 * by creating a split descriptor and then putting a bonded force on the
148 * highest home node number of the paricles involved.
155 #endif /* _split_h */