Made g_protonate (partially) work.
[gromacs/rigid-bodies.git] / include / partdec.h
blob8ac73bce137862ba73514bc6666d8686ae12da7a
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 _partdec_h
37 #define _partdec_h
39 #include "vsite.h"
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
46 #define GMX_LEFT 0 /* channel to the left processor */
47 #define GMX_RIGHT 1 /* channel to the right processor */
49 /* These are the good old ring communication routines */
51 void gmx_tx(const t_commrec *cr,int dir,void *buf,int bufsize);
53 * Asynchronously sends bufsize bytes from the buffer pointed to by buf
54 * over the communication channel, identified by chan. The buffer becomes
55 * available after a successful call of gmx_tx_wait(dir).
58 void gmx_tx_wait(const t_commrec *cr, int dir);
60 * Waits until the asynchronous send operation associated with chan has
61 * succeeded. This makes the buffer of the send operation available to
62 * the sending process.
65 void gmx_rx(const t_commrec *cr,int dir,void *buf,int bufsize);
67 * Asynchronously receives bufsize bytes in the buffer pointed to by buf
68 * from communication channel identified by chan. The buffer becomes
69 * available after a successful call of gmx_rx_wait(chan).
72 void gmx_rx_wait(const t_commrec *cr, int dir);
74 * Waits until the asynchronous receive operation, associated with chan,
75 * has succeeded. This makes the buffer of the receive operation
76 * available to the receiving process.
79 void gmx_left_right(int nnodes,int nodeid,
80 int *left,int *right);
81 /* Get left and right proc id. */
83 void gmx_tx_rx(const t_commrec *cr,
84 int send_dir,void *send_buf,int send_bufsize,
85 int recv_dir,void *recv_buf,int recv_bufsize);
86 /* Communicate simultaneously left and right */
88 void gmx_tx_rx_real(const t_commrec *cr,
89 int send_dir,real *send_buf,int send_bufsize,
90 int recv_dir,real *recv_buf,int recv_bufsize);
91 /* Communicate simultaneously left and right, reals only */
93 void gmx_wait(const t_commrec *cr, int dir_send, int dir_recv);
94 /* Wait for communication to finish */
96 void pd_move_f(const t_commrec *cr,rvec f[],t_nrnb *nrnb);
97 /* Sum the forces over the nodes */
99 int *pd_cgindex(const t_commrec *cr);
101 int *pd_index(const t_commrec *cr);
103 int pd_shift(const t_commrec *cr);
105 int pd_bshift(const t_commrec *cr);
107 void pd_cg_range(const t_commrec *cr,int *cg0,int *cg1);
108 /* Get the range for the home charge groups */
110 void pd_at_range(const t_commrec *cr,int *at0,int *at1);
111 /* Get the range for the home particles */
113 gmx_localtop_t *split_system(FILE *log,
114 gmx_mtop_t *mtop,t_inputrec *inputrec,
115 t_commrec *cr);
116 /* Split the system over N processors. */
118 gmx_bool setup_parallel_vsites(t_idef *idef,t_commrec *cr,
119 t_comm_vsites *vsitecomm);
121 t_state *partdec_init_local_state(t_commrec *cr,t_state *state_global);
122 /* Generate a local state struct from the global one */
124 void
125 pd_get_constraint_range(gmx_partdec_p_t pd,int *start,int *natoms);
128 int *
129 pd_constraints_nlocalatoms(gmx_partdec_p_t pd);
131 /* Move x0 and also x1 if x1!=NULL */
132 void
133 pd_move_x_constraints(t_commrec * cr,
134 rvec * x0,
135 rvec * x1);
137 #ifdef __cplusplus
139 #endif
141 #endif