MALOC  0.1
vmpi.h
1 /*
2  * ***************************************************************************
3  * MALOC = < Minimal Abstraction Layer for Object-oriented C >
4  * Copyright (C) 1994--2006 Michael Holst
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation; either version 2 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  * rcsid="$Id: vmpi.h,v 1.18 2006/06/03 07:22:30 mholst Exp $"
21  * ***************************************************************************
22  */
23 
24 /*
25  * ***************************************************************************
26  * File: vmpi.h < vmpi.c >
27  *
28  * Purpose: Class Vmpi: a Virtual MPI communication layer object.
29  *
30  * Notes: Class Vmpi is a thin object-oriented Clean C layer on top of the
31  * MPI communication library. Vmpi provides access to the minimal
32  * set of ten MPI primitives required to implement the Bank-Holst
33  * parallel adaptive algorithm, using either the Bank-Holst Oracle
34  * library, or directly.
35  *
36  * Author: Michael Holst
37  * ***************************************************************************
38  */
39 
40 #ifndef _VMPI_H_
41 #define _VMPI_H_
42 
43 #include <maloc/maloc_base.h>
44 
45 #include <maloc/vsys.h>
46 
47 /*
48  * ***************************************************************************
49  * Class Vmpi: Parameters and datatypes
50  * ***************************************************************************
51  */
52 
53 /*
54  * ***************************************************************************
55  * Class Vmpi: Definition
56  * ***************************************************************************
57  */
58 
59 typedef struct Vmpi {
60  int mpi_rank; /* my process ID */
61  int mpi_size; /* number of processess in this execution */
62 } Vmpi;
63 
64 /*
65  * ***************************************************************************
66  * Class Vmpi: Inlineable methods (vmpi.c)
67  * ***************************************************************************
68  */
69 
70 #if !defined(VINLINE_MALOC)
71 #else /* if defined(VINLINE_MALOC) */
72 #endif /* if !defined(VINLINE_MALOC) */
73 
74 /*
75  * ***************************************************************************
76  * Class Vmpi: Non-inlineable methods (vmpi.c)
77  * ***************************************************************************
78  */
79 
80 int Vmpi_init(int *argc, char ***argv);
81 int Vmpi_finalize(void);
82 
83 Vmpi* Vmpi_ctor(void);
84 void Vmpi_dtor(Vmpi **thee);
85 
86 int Vmpi_rank(Vmpi *thee);
87 int Vmpi_size(Vmpi *thee);
88 int Vmpi_barr(Vmpi *thee);
89 
90 int Vmpi_send(Vmpi *thee, int des, char *buf, int bufsize);
91 int Vmpi_recv(Vmpi *thee, int src, char *buf, int bufsize);
92 
93 int Vmpi_bcast(Vmpi *thee, char *buf, int bufsize);
94 int Vmpi_reduce(Vmpi *thee, char *sbuf, char *rbuf, int bufsize);
95 int Vmpi_isend(Vmpi *thee, int des, char *buf, int bufsize);
96 
97 #endif /* _VMPI_H_ */
98 
Definition: vmpi.h:59