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

memmpi2.h

00001 //
00002 // memmpi2.h
00003 //
00004 // derived from code
00005 // Copyright (C) 1996 Limit Point Systems, Inc.
00006 //
00007 // Author: Curtis Janssen <cljanss@sandia.gov>
00008 // Maintainer: SNL
00009 //
00010 // This file is part of the SC Toolkit.
00011 //
00012 // The SC Toolkit is free software; you can redistribute it and/or modify
00013 // it under the terms of the GNU Library General Public License as published by
00014 // the Free Software Foundation; either version 2, or (at your option)
00015 // any later version.
00016 //
00017 // The SC Toolkit is distributed in the hope that it will be useful,
00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 // GNU Library General Public License for more details.
00021 //
00022 // You should have received a copy of the GNU Library General Public License
00023 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
00024 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00025 //
00026 // The U.S. Government is granted a limited license as per AL 91-7.
00027 //
00028 
00029 #ifdef __GNUC__
00030 #pragma interface
00031 #endif
00032 
00033 #ifndef _util_group_memmpi2_h
00034 #define _util_group_memmpi2_h
00035 
00036 #include <util/group/memamsg.h>
00037 
00038 #include <mpi.h>
00039 
00040 class MPI2MemoryGrp: public MsgMemoryGrp {
00041   private:
00042     MPI_Win rma_win_;
00043     void *data_;
00044     
00045     void retrieve_data(void *, int node, int offset, int size);
00046     void replace_data(void *, int node, int offset, int size);
00047     void sum_data(double *data, int node, int doffset, int dsize);
00048 
00049   public:
00050     MPI2MemoryGrp(const Ref<MessageGrp>& msg);
00051     MPI2MemoryGrp(const Ref<KeyVal>&);
00052     ~MPI2MemoryGrp();
00053 
00054     void activate();
00055     void deactivate();
00056 
00057     void *localdata();
00058     void set_localsize(int);
00059 
00060     void *obtain_writeonly(distsize_t offset, int size);
00061     void *obtain_readwrite(distsize_t offset, int size);
00062     void *obtain_readonly(distsize_t offset, int size);
00063     void release_readonly(void *data, distsize_t offset, int size);
00064     void release_writeonly(void *data, distsize_t offset, int size);
00065     void release_readwrite(void *data, distsize_t offset, int size);
00066     void sum_reduction(double *data, distsize_t doffset, int dsize);
00067     void sum_reduction_on_node(double *data, int doffset, int dsize,
00068                                int node = -1);
00069 
00070     void sync();
00071 };
00072 
00073 #endif
00074 
00075 // Local Variables:
00076 // mode: c++
00077 // c-file-style: "ETS"
00078 // End:

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