Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

messmpi.h

00001 //
00002 // messmpi.h
00003 //
00004 // Copyright (C) 1996 Limit Point Systems, Inc.
00005 //
00006 // Author: Curtis Janssen <cljanss@limitpt.com>
00007 // Maintainer: LPS
00008 //
00009 // This file is part of the SC Toolkit.
00010 //
00011 // The SC Toolkit is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Library General Public License as published by
00013 // the Free Software Foundation; either version 2, or (at your option)
00014 // any later version.
00015 //
00016 // The SC Toolkit is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 // GNU Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Library General Public License
00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00024 //
00025 // The U.S. Government is granted a limited license as per AL 91-7.
00026 //
00027 
00028 #ifndef _util_group_messmpi_h
00029 #define _util_group_messmpi_h
00030 
00031 #include <util/group/message.h>
00032 
00035 class MPIMessageGrp: public MessageGrp {
00036   protected:
00037     void* buf;
00038     int bufsize;
00039 
00040     int rnode;
00041     int rtag;
00042     int rlen;
00043 
00044 #if HAVE_P4
00045     int nlocal;     // the number of processes on the master cluster
00046     int nremote;    // the number of remote clusters
00047     char *master;   // the name of the master cluster
00048     char * jobid;   // a unique job name selected by the user
00049 
00050     struct p4_cluster {
00051         char *hostname;  // name of the remote cluster
00052         int nslaves;     // the number of slaves on the remote cluster
00053     } *remote_clusters;
00054 
00055     struct p4_cluster * my_node_info(const char[], int&);
00056 #endif
00057     
00058     void init(int argc=-1, char **argv=0);
00059   public:
00060     MPIMessageGrp();
00061     MPIMessageGrp(const Ref<KeyVal>&);
00062     ~MPIMessageGrp();
00063 
00064     void raw_send(int target, void* data, int nbyte);
00065     void raw_recv(int sender, void* data, int nbyte);
00066     void raw_sendt(int target, int type, void* data, int nbyte);
00067     void raw_recvt(int type, void* data, int nbyte);
00068 
00069     int probet(int type);
00070 
00071     int last_source();
00072     int last_size();
00073     int last_type();
00074 
00075     void sync();
00076 
00077     void reduce(double*, int n, GrpReduce<double>&,
00078                 double*scratch = 0, int target = -1);
00079     void reduce(unsigned int*, int n, GrpReduce<unsigned int>&,
00080                 unsigned int*scratch = 0, int target = -1);
00081     void reduce(int*, int n, GrpReduce<int>&,
00082                 int*scratch = 0, int target = -1);
00083     void reduce(char*, int n, GrpReduce<char>&,
00084                 char*scratch = 0, int target = -1);
00085     void reduce(unsigned char*, int n, GrpReduce<unsigned char>&,
00086                 unsigned char*scratch = 0, int target = -1);
00087     void reduce(signed char*, int n, GrpReduce<signed char>&,
00088                 signed char*scratch = 0, int target = -1);
00089     void reduce(short*, int n, GrpReduce<short>&,
00090                 short*scratch = 0, int target = -1);
00091     void reduce(float*, int n, GrpReduce<float>&,
00092                 float*scratch = 0, int target = -1);
00093     void reduce(long*, int n, GrpReduce<long>&,
00094                 long*scratch = 0, int target = -1);
00095 
00096     void raw_bcast(void* data, int nbyte, int from);
00097 };
00098 
00099 #endif
00100 
00101 // Local Variables:
00102 // mode: c++
00103 // c-file-style: "CLJ"
00104 // End:

Generated at Thu Oct 4 18:08:46 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.