Bumped version to 4.5-beta3
[gromacs.git] / include / partdec.h
blobb314474649db0f2de6cd859feebe2759e0b38e74
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 #ifdef HAVE_CONFIG_H
40 #include <config.h>
41 #endif
43 #include "vsite.h"
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
50 #define GMX_LEFT 0 /* channel to the left processor */
51 #define GMX_RIGHT 1 /* channel to the right processor */
53 /* These are the good old ring communication routines */
55 extern void gmx_tx(const t_commrec *cr,int dir,void *buf,int bufsize);
57 * Asynchronously sends bufsize bytes from the buffer pointed to by buf
58 * over the communication channel, identified by chan. The buffer becomes
59 * available after a successful call of gmx_tx_wait(dir).
62 extern void gmx_tx_wait(const t_commrec *cr, int dir);
64 * Waits until the asynchronous send operation associated with chan has
65 * succeeded. This makes the buffer of the send operation available to
66 * the sending process.
69 extern void gmx_rx(const t_commrec *cr,int dir,void *buf,int bufsize);
71 * Asynchronously receives bufsize bytes in the buffer pointed to by buf
72 * from communication channel identified by chan. The buffer becomes
73 * available after a successful call of gmx_rx_wait(chan).
76 extern void gmx_rx_wait(const t_commrec *cr, int dir);
78 * Waits until the asynchronous receive operation, associated with chan,
79 * has succeeded. This makes the buffer of the receive operation
80 * available to the receiving process.
83 extern void gmx_left_right(int nnodes,int nodeid,
84 int *left,int *right);
85 /* Get left and right proc id. */
87 extern void gmx_tx_rx(const t_commrec *cr,
88 int send_dir,void *send_buf,int send_bufsize,
89 int recv_dir,void *recv_buf,int recv_bufsize);
90 /* Communicate simultaneously left and right */
92 extern void gmx_tx_rx_real(const t_commrec *cr,
93 int send_dir,real *send_buf,int send_bufsize,
94 int recv_dir,real *recv_buf,int recv_bufsize);
95 /* Communicate simultaneously left and right, reals only */
97 extern void gmx_wait(const t_commrec *cr, int dir_send, int dir_recv);
98 /* Wait for communication to finish */
100 extern void pd_move_f(const t_commrec *cr,rvec f[],t_nrnb *nrnb);
101 /* Sum the forces over the nodes */
103 extern int *pd_cgindex(const t_commrec *cr);
105 extern int *pd_index(const t_commrec *cr);
107 extern int pd_shift(const t_commrec *cr);
109 extern int pd_bshift(const t_commrec *cr);
111 extern void pd_cg_range(const t_commrec *cr,int *cg0,int *cg1);
112 /* Get the range for the home charge groups */
114 extern void pd_at_range(const t_commrec *cr,int *at0,int *at1);
115 /* Get the range for the home particles */
117 extern gmx_localtop_t *split_system(FILE *log,
118 gmx_mtop_t *mtop,t_inputrec *inputrec,
119 t_commrec *cr);
120 /* Split the system over N processors. */
122 extern bool setup_parallel_vsites(t_idef *idef,t_commrec *cr,
123 t_comm_vsites *vsitecomm);
125 extern t_state *partdec_init_local_state(t_commrec *cr,t_state *state_global);
126 /* Generate a local state struct from the global one */
128 void
129 pd_get_constraint_range(gmx_partdec_p_t pd,int *start,int *natoms);
132 int *
133 pd_constraints_nlocalatoms(gmx_partdec_p_t pd);
135 /* Move x0 and also x1 if x1!=NULL */
136 void
137 pd_move_x_constraints(t_commrec * cr,
138 rvec * x0,
139 rvec * x1);
141 #ifdef __cplusplus
143 #endif
145 #endif