Warn when a value is unused
[gromacs.git] / include / split.h
blob3df648cbb71e4843c5fe81ceef7f6180cb9e2762
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 * Gromacs Runs On Most of All Computer Systems
36 #ifndef _split_h
37 #define _split_h
40 * Determine on which node a particle should reside and on which
41 * node is also should be available. The distribution algorithm
42 * should account for the actual ring architecture and how nodes
43 * are numbered. The typedef t_splitd has two separate structures that
44 * describe the distribution:
46 * The nodeinfo part describes which node containst which particles,
47 * while the nodeids part describes on which node(s) a particle can be
48 * found and what local particle number is assigned to it.
52 #include <stdio.h>
53 #include "typedefs.h"
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
59 typedef enum {SPLIT_NONE,SPLIT_SORTX,SPLIT_REDUCE,SPLIT_NR} t_splitalg;
61 typedef struct
63 int hid;
64 atom_id *nodeid;
65 } t_nodeids;
67 typedef struct
69 int nr; /* Length of the long list. */
70 int *lst; /* The actual list. */
71 } t_nlist;
73 typedef struct
75 t_nlist home; /* List of home particles. */
76 } t_nodeinfo;
78 typedef struct
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 */
86 /* node's id. */
87 } t_splitd;
89 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 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,
106 * parts.
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 long wr_split(FILE *fp,t_splitd *splitd);
118 * Writes the split descriptor (splitd) to the file specified by fp.
121 long rd_split(FILE *fp,t_splitd *splitd);
123 * Reads the split descriptor (splitd) from the file specified by fp.
126 void rm_splitd(t_splitd *splitd);
128 * Frees all allocated space for the splitd data structure.
131 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 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.
148 #ifdef __cplusplus
150 #endif
152 #endif /* _split_h */