vcom.h

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: vcom.h,v 1.26 2006/06/03 07:22:30 mholst Exp $"
00021  * ***************************************************************************
00022  */
00023 
00024 /*
00025  * ***************************************************************************
00026  * File:     vcom.h    < vcom.c >
00027  *
00028  * Purpose:  Class Vcom: virtual (currently just MPI) communications layer
00029  *
00030  * Author:   Nathan Baker and Michael Holst
00031  * ***************************************************************************
00032  */
00033 
00034 #ifndef _VCOM_H_
00035 #define _VCOM_H_
00036 
00037 #include <maloc/maloc_base.h>
00038 
00039 #include <maloc/vsys.h>
00040 
00041 /* A base value for MPI tags */
00042 #define VCOM_MPI_TAG 111
00043 
00044 /*
00045  * ***************************************************************************
00046  * Class Vcom: Parameters and datatypes
00047  * ***************************************************************************
00048  */
00049 
00050 /*
00051  * ***************************************************************************
00052  * Class Vcom: Definition
00053  * ***************************************************************************
00054  */
00055 
00056 typedef struct Vcom {
00057 
00058     int  mpi_rank;     /* Local PE rank from MPI                            */
00059     int  mpi_size;     /* Total number of PEs in this communicator from MPI */ 
00060 
00061     int  type;         /* Communications type                               */
00062                        /*   0 = not initialized                             */
00063                        /*   1 = Message Passing Interface 1.1               */
00064 
00065     int  error;        /* note if any error has occurred on this vcom device*/
00066 
00067     void *core;        /* Private MPI core                                  */
00068 
00069 } Vcom;
00070 
00071 /*
00072  * ***************************************************************************
00073  * Class Vcom: Inlineable methods (vcom.c)
00074  * ***************************************************************************
00075  */
00076 
00077 #if !defined(VINLINE_MALOC)
00078 #else /* if defined(VINLINE_MALOC) */
00079 #endif /* if !defined(VINLINE_MALOC) */
00080 
00081 /*
00082  * ***************************************************************************
00083  * Class Vcom: Non-Inlineable methods (vcom.c)
00084  * ***************************************************************************
00085  */
00086 
00087 int Vcom_init(int *argc, char ***argv);
00088 int Vcom_finalize(void);
00089 
00090 Vcom* Vcom_ctor(int commtype);
00091 int Vcom_ctor2(Vcom* thee, int commtype);
00092 void Vcom_dtor(Vcom **thee);
00093 void Vcom_dtor2(Vcom *thee);
00094 
00095 int Vcom_send(Vcom *thee, int des, void *buf, int len, int type, 
00096   int block);
00097 int Vcom_recv(Vcom *thee, int src, void *buf, int len, int type, 
00098   int block);
00099 int Vcom_getCount(Vcom *thee, int src, int *length, int type);
00100 int Vcom_reduce(Vcom *thee, void *sendbuf, void *recvbuf, int length, 
00101   int type, int op);
00102 int Vcom_size(Vcom *thee);
00103 int Vcom_resize(Vcom *thee, int newsize);
00104 int Vcom_rank(Vcom *thee);
00105 int Vcom_barr(Vcom *thee);
00106 
00107 #endif /* _VCOM_H_ */
00108 
00109 

Generated on Wed Jul 12 13:01:57 2006 for MALOC by  doxygen 1.4.7