Fix malformed CUDA version macro check
[alexxy/gromacs.git] / include / domdec_network.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * This file is part of Gromacs        Copyright (c) 1991-2008
5  * David van der Spoel, Erik Lindahl, Berk Hess, University of Groningen.
6  * Copyright (c) 2012,2013, by the GROMACS development team, led by
7  * David van der Spoel, Berk Hess, Erik Lindahl, and including many
8  * others, as listed in the AUTHORS file in the top-level source
9  * directory and at http://www.gromacs.org.
10  *
11  * GROMACS is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public License
13  * as published by the Free Software Foundation; either version 2.1
14  * of the License, or (at your option) any later version.
15  *
16  * GROMACS is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with GROMACS; if not, see
23  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
25  *
26  * If you want to redistribute modifications to GROMACS, please
27  * consider that scientific software is very special. Version
28  * control is crucial - bugs must be traceable. We will be happy to
29  * consider code for inclusion in the official distribution, but
30  * derived work must not be called official GROMACS. Details are found
31  * in the README & COPYING files - if they are missing, get the
32  * official version at http://www.gromacs.org.
33  *
34  * To help us fund GROMACS development, we humbly ask that you cite
35  * the research papers on the package. Check out http://www.gromacs.org.
36  */
37
38 #ifndef _domdec_network_h
39 #define _domdec_network_h
40 #include "visibility.h"
41 #include "typedefs.h"
42 #include "types/commrec.h"
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48 enum {
49     dddirForward, dddirBackward
50 };
51
52 /* Move integers in the comm. region one cell along the domain decomposition
53  * in the dimension indexed by ddimind
54  * forward (direction=dddirFoward) or backward (direction=dddirBackward).
55  */
56 void
57 dd_sendrecv_int(const gmx_domdec_t *dd,
58                 int ddimind, int direction,
59                 int *buf_s, int n_s,
60                 int *buf_r, int n_r);
61
62 /* Move reals in the comm. region one cell along the domain decomposition
63  * in the dimension indexed by ddimind
64  * forward (direction=dddirFoward) or backward (direction=dddirBackward).
65  */
66 void
67 dd_sendrecv_real(const gmx_domdec_t *dd,
68                  int ddimind, int direction,
69                  real *buf_s, int n_s,
70                  real *buf_r, int n_r);
71
72 /* Move revc's in the comm. region one cell along the domain decomposition
73  * in dimension indexed by ddimind
74  * forward (direction=dddirFoward) or backward (direction=dddirBackward).
75  */
76 void
77 dd_sendrecv_rvec(const gmx_domdec_t *dd,
78                  int ddimind, int direction,
79                  rvec *buf_s, int n_s,
80                  rvec *buf_r, int n_r);
81
82
83 /* Move revc's in the comm. region one cell along the domain decomposition
84  * in dimension indexed by ddimind
85  * simultaneously in the forward and backward directions.
86  */
87 void
88 dd_sendrecv2_rvec(const gmx_domdec_t *dd,
89                   int ddimind,
90                   rvec *buf_s_fw, int n_s_fw,
91                   rvec *buf_r_fw, int n_r_fw,
92                   rvec *buf_s_bw, int n_s_bw,
93                   rvec *buf_r_bw, int n_r_bw);
94
95
96 /* The functions below perform the same operations as the MPI functions
97  * with the same name appendices, but over the domain decomposition
98  * nodes only.
99  * The DD master node is the master for these operations.
100  */
101
102 GMX_LIBMD_EXPORT
103 void
104 dd_bcast(gmx_domdec_t *dd, int nbytes, void *data);
105
106 /* Copies src to dest on the master node and then broadcasts */
107 void
108 dd_bcastc(gmx_domdec_t *dd, int nbytes, void *src, void *dest);
109
110 void
111 dd_scatter(gmx_domdec_t *dd, int nbytes, void *src, void *dest);
112
113 void
114 dd_gather(gmx_domdec_t *dd, int nbytes, void *src, void *dest);
115
116 /* If rcount==0, rbuf is allowed to be NULL */
117 void
118 dd_scatterv(gmx_domdec_t *dd,
119             int *scounts, int *disps, void *sbuf,
120             int rcount, void *rbuf);
121
122 /* If scount==0, sbuf is allowed to be NULL */
123 void
124 dd_gatherv(gmx_domdec_t *dd,
125            int scount, void *sbuf,
126            int *rcounts, int *disps, void *rbuf);
127
128 #ifdef __cplusplus
129 }
130 #endif
131
132 #endif  /* _domdec_network_h */