Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

Cluster.hh

Go to the documentation of this file.
00001 /*
00002 
00003     MPI class implementation for clustering
00004     Copyright (C) 2000-2001 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your 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.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 */
00021 
00022 
00023 #include <typeinfo>
00024 
00025 #include <mpi.h>
00026 
00027 
00028 #ifndef CLUSTER_HH
00029     #define CLUSTER_HH
00030 
00031 
00035     class clMPIProc
00036     {
00037             bool bInitialized;
00038             int iError;
00039         public:
00040             clMPIProc ();
00041             ~clMPIProc ();
00049             bool Initialize (int *, char ***);
00055             bool Finalize ();
00062             bool GetRank (int *);
00069             bool GetNodeCount (int *);
00075             int GetError () { return iError; }
00076     };
00077 
00078 
00082     class clMPIComm
00083     {
00084             int iTag;
00085             int iError;
00086             MPI_Status sStatus;
00087         public:
00088             clMPIComm ();
00089             clMPIComm (int);
00090             ~clMPIComm ();
00096             void SetTag (int);
00105             bool Send (int, char *, int);
00107             bool Send (int, unsigned char *, int);
00109             bool Send (int, short *, int);
00111             bool Send (int, unsigned short *, int);
00113             bool Send (int, int *, int);
00115             bool Send (int, unsigned int *, int);
00117             bool Send (int, long *, int);
00119             bool Send (int, unsigned long *, int);
00121             bool Send (int, float *, int);
00123             bool Send (int, double *, int);
00125             bool Send (int, long double *, int);
00127             bool Send (int, void *, int);
00136             bool Probe (int);
00138             bool ProbeAny (int);
00140             bool ProbeNB (int);
00142             bool ProbeAnyNB (int);
00151             bool Recv (int, char *, int);
00153             bool Recv (int, unsigned char *, int);
00155             bool Recv (int, short *, int);
00157             bool Recv (int, unsigned short *, int);
00159             bool Recv (int, int *, int);
00161             bool Recv (int, unsigned int *, int);
00163             bool Recv (int, long *, int);
00165             bool Recv (int, unsigned long *, int);
00167             bool Recv (int, float *, int);
00169             bool Recv (int, double *, int);
00171             bool Recv (int, long double *, int);
00173             bool Recv (int, void *, int);
00181             bool RecvAny (int, char *, int);
00183             bool RecvAny (int, unsigned char *, int);
00185             bool RecvAny (int, short *, int);
00187             bool RecvAny (int, unsigned short *, int);
00189             bool RecvAny (int, int *, int);
00191             bool RecvAny (int, unsigned int *, int);
00193             bool RecvAny (int, long *, int);
00195             bool RecvAny (int, unsigned long *, int);
00197             bool RecvAny (int, float *, int);
00199             bool RecvAny (int, double *, int);
00201             bool RecvAny (int, long double *, int);
00203             bool RecvAny (int, void *, int);
00214             bool GetCount (const std::type_info &, int *);
00220             int GetSenderRank () { return sStatus.MPI_SOURCE; }
00226             int GetSenderTag () { return sStatus.MPI_TAG; }
00232             int GetError () { return iError; }
00238             int GetError2 () { return sStatus.MPI_ERROR; }
00239     };
00240 
00241 #endif
00242 

Generated on Sun Oct 26 19:11:19 2003 for HASAS by doxygen 1.3.3