6363bbbc540268469e6fe25fd43729e7abbd20ba
[alexxy/gromacs.git] / include / mpiio.h
1 /*
2  * $Id$
3  * 
4  *       This source code is part of
5  * 
6  *        G   R   O   M   A   C   S
7  * 
8  * GROningen MAchine for Chemical Simulations
9  * 
10  *               VERSION 2.0
11  * 
12  * Copyright (c) 1991-1999
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * Please refer to:
17  * GROMACS: A message-passing parallel molecular dynamics implementation
18  * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19  * Comp. Phys. Comm. 91, 43-56 (1995)
20  * 
21  * Also check out our WWW page:
22  * http://md.chem.rug.nl/~gmx
23  * or e-mail to:
24  * gromacs@chem.rug.nl
25  * 
26  * And Hey:
27  * Good ROcking Metal Altar for Chronical Sinners
28  */
29
30 #ifndef _mpiio_h
31 #define _mpiio_h
32
33 static char *SRCID_mpiio_h = "$Id$";
34
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
38
39 #include <mpi.h>
40 #include "typedefs.h"
41
42 extern void mpiio_tx(int nodeid,void *buf,int bufsize);
43 extern void mpiio_tx_wait(int nodeid);
44 extern void mpiio_txs(int nodeid,void *buf,int bufsize);
45 extern void mpiio_rx(int nodeid,void *buf,int bufsize);
46 extern void mpiio_rx_wait(int nodeid);
47 extern void mpiio_rxs(int nodeid,void *buf,int bufsize);
48 extern int  mpiio_setup(int *argc,char *argv[],int *nnodes);
49 /* If this is the master, spawn some kids. Nnodes is set to the
50  * number of nodeessors.
51  * Return nodeid */
52  
53 extern int mpiio_rx_probe(int nodeid);
54 /* Check whether message arrived, if so message is read and return 0 */
55
56 extern void mpiio_stat(FILE *fp,char *msg);
57 extern int  mpinodenumber(void);
58 extern int  mpinodecount(void);
59 extern int  mpi_idle_send(void);
60 extern int  mpi_idle_rec(void);
61 extern void mpi_left_right(int nnodes,int nodeid,int *left,int *right);
62 extern void mpiio_tx_rx(int send_nodeid,void *send_buf,int send_bufsize,
63                         int rec_nodeid,void *rec_buf,int rec_bufsize);
64 extern void mpiio_wait(int left,int right);
65 extern void mpiio_sync_ring(int nodeid,int nnodes,int left,int right);
66 extern void mpi_reset_idle(void);
67 extern void mpi_abort(int nodeid,int nnodes,int errorno);
68
69 #define gmx_tx          mpiio_tx
70 #define gmx_tx_wait     mpiio_tx_wait
71 #define gmx_txs         mpiio_txs
72 #define gmx_rx          mpiio_rx
73 #define gmx_rx_wait     mpiio_rx_wait
74 #define gmx_rxs         mpiio_rxs
75 #define gmx_stat        mpiio_stat
76 #define gmx_wait        mpiio_wait
77 #define gmx_node_num    mpinodecount
78 #define gmx_node_id     mpinodenumber
79 #define gmx_left_right  mpi_left_right
80 #define gmx_idle_send   mpi_idle_send
81 #define gmx_idle_rec    mpi_idle_rec
82 #define gmx_reset_idle  mpi_reset_idle
83 #define gmx_abort       mpi_abort
84
85 #endif