00001 /* 00002 * *************************************************************************** 00003 * MALOC = < Minimal Abstraction Layer for Object-oriented C > 00004 * Copyright (C) 1994--2006 Michael Holst 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the 00008 * Free Software Foundation; either version 2 of the License, or (at your 00009 * option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00014 * See the GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 675 Mass Ave, Cambridge, MA 02139, USA. 00019 * 00020 * rcsid="$Id: vmpi.h,v 1.18 2006/06/03 07:22:30 mholst Exp $" 00021 * *************************************************************************** 00022 */ 00023 00024 /* 00025 * *************************************************************************** 00026 * File: vmpi.h < vmpi.c > 00027 * 00028 * Purpose: Class Vmpi: a Virtual MPI communication layer object. 00029 * 00030 * Notes: Class Vmpi is a thin object-oriented Clean C layer on top of the 00031 * MPI communication library. Vmpi provides access to the minimal 00032 * set of ten MPI primitives required to implement the Bank-Holst 00033 * parallel adaptive algorithm, using either the Bank-Holst Oracle 00034 * library, or directly. 00035 * 00036 * Author: Michael Holst 00037 * *************************************************************************** 00038 */ 00039 00040 #ifndef _VMPI_H_ 00041 #define _VMPI_H_ 00042 00043 #include <maloc/maloc_base.h> 00044 00045 #include <maloc/vsys.h> 00046 00047 /* 00048 * *************************************************************************** 00049 * Class Vmpi: Parameters and datatypes 00050 * *************************************************************************** 00051 */ 00052 00053 /* 00054 * *************************************************************************** 00055 * Class Vmpi: Definition 00056 * *************************************************************************** 00057 */ 00058 00059 typedef struct Vmpi { 00060 int mpi_rank; /* my process ID */ 00061 int mpi_size; /* number of processess in this execution */ 00062 } Vmpi; 00063 00064 /* 00065 * *************************************************************************** 00066 * Class Vmpi: Inlineable methods (vmpi.c) 00067 * *************************************************************************** 00068 */ 00069 00070 #if !defined(VINLINE_MALOC) 00071 #else /* if defined(VINLINE_MALOC) */ 00072 #endif /* if !defined(VINLINE_MALOC) */ 00073 00074 /* 00075 * *************************************************************************** 00076 * Class Vmpi: Non-inlineable methods (vmpi.c) 00077 * *************************************************************************** 00078 */ 00079 00080 int Vmpi_init(int *argc, char ***argv); 00081 int Vmpi_finalize(void); 00082 00083 Vmpi* Vmpi_ctor(void); 00084 void Vmpi_dtor(Vmpi **thee); 00085 00086 int Vmpi_rank(Vmpi *thee); 00087 int Vmpi_size(Vmpi *thee); 00088 int Vmpi_barr(Vmpi *thee); 00089 00090 int Vmpi_send(Vmpi *thee, int des, char *buf, int bufsize); 00091 int Vmpi_recv(Vmpi *thee, int src, char *buf, int bufsize); 00092 00093 int Vmpi_bcast(Vmpi *thee, char *buf, int bufsize); 00094 int Vmpi_reduce(Vmpi *thee, char *sbuf, char *rbuf, int bufsize); 00095 int Vmpi_isend(Vmpi *thee, int des, char *buf, int bufsize); 00096 00097 #endif /* _VMPI_H_ */ 00098 00099