ESyS-Particle  2.3.4
mpisgvbuf.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.apache.org/licenses/LICENSE-2.0 //
10 // //
12 
13 #ifndef __MPISGVBUF_H
14 #define __MPISGVBUF_H
15 
16 #include "Parallel/mpisgbuf.h"
17 #include <string>
18 
28 {
29 private:
30  char* m_vbuffer;
33  int *m_position;
34  int *m_rpos;
35 
37  int *m_displ; //<! the diplacements of the slices in the buffer
38  int m_ndummy;
39 
40 
41  protected:
42  void grow();
43  void growTo(int);
44 
45  public:
46  CMPIVarSGBufferRoot(MPI_Comm,int isize=16);
47  virtual ~CMPIVarSGBufferRoot();
48 
49  virtual void clear();
50  virtual void gather();
51  virtual void scatter();
52  virtual void append(int,int);
53  virtual void append(double,int);
54  virtual void append(const char*,int);
55  virtual int pop_int(int);
56  virtual double pop_double(int);
57  virtual void pop_doubles(int,double *,int);
58 };
59 
69 {
70  private:
71  char* m_vbuffer;
73  int m_position;
75 
76  protected:
77  void grow();
78  void growTo(int);
79 
80  public:
81  CMPIVarSGBufferLeaf(MPI_Comm,int,int isize=16);
82  virtual ~CMPIVarSGBufferLeaf();
83 
84  virtual void clear();
85  virtual void send();
86  virtual void receive();
87  virtual void append(int);
88  virtual void append(double);
89  virtual void append(const char*);
90  virtual int pop_int();
91  virtual double pop_double();
92  virtual void pop_doubles(double *,int);
93  virtual std::string pop_string();
94 };
95 
96 
97 
98 #endif // __MPISGVBUF_H
AMPISGBufferLeaf::m_root
int m_root
rank of the root process
Definition: mpisgbuf.h:66
AMPISGBufferRoot::m_rank
int m_rank
the rank in this communicator
Definition: mpisgbuf.h:32
CMPIVarSGBufferLeaf::m_vbuffersize
int m_vbuffersize
the size of the buffer
Definition: mpisgvbuf.h:72
esys::lsm::bpu::len
int len(const boost::python::object &pyOb)
Definition: Util.h:30
CMPIVarSGBufferLeaf::grow
void grow()
Definition: mpisgvbuf.cpp:253
CMPIVarSGBufferRoot
class for variable size scatter/gather buffer, root component
Definition: mpisgvbuf.h:28
AMPIBuffer::m_comm
MPI_Comm m_comm
the MPI Communicator used for the send/recv operations
Definition: mpibuf.h:36
CMPIVarSGBufferLeaf::pop_string
virtual std::string pop_string()
Definition: mpisgvbuf.cpp:402
CMPIVarSGBufferLeaf::~CMPIVarSGBufferLeaf
virtual ~CMPIVarSGBufferLeaf()
Definition: mpisgvbuf.cpp:245
CMPIVarSGBufferLeaf::append
virtual void append(int)
Definition: mpisgvbuf.cpp:319
CMPIVarSGBufferRoot::pop_int
virtual int pop_int(int)
Definition: mpisgvbuf.cpp:201
CMPIVarSGBufferRoot::scatter
virtual void scatter()
Definition: mpisgvbuf.cpp:124
CMPIVarSGBufferRoot::grow
void grow()
Definition: mpisgvbuf.cpp:61
AMPISGBufferLeaf::m_int_increment
int m_int_increment
Definition: mpisgbuf.h:67
CMPIVarSGBufferRoot::m_dummy_vbuffer
char * m_dummy_vbuffer
dummy buffer sent by root to itself
Definition: mpisgvbuf.h:31
CMPIVarSGBufferRoot::gather
virtual void gather()
Definition: mpisgvbuf.cpp:100
CMPIVarSGBufferRoot::~CMPIVarSGBufferRoot
virtual ~CMPIVarSGBufferRoot()
Definition: mpisgvbuf.cpp:44
CMPIVarSGBufferRoot::m_vbuffersize
int m_vbuffersize
the size of the buffer per slice
Definition: mpisgvbuf.h:32
CMPIVarSGBufferLeaf
class for variable size scatter/gather buffer, leaf component
Definition: mpisgvbuf.h:69
CMPIVarSGBufferLeaf::m_data_size
int m_data_size
Definition: mpisgvbuf.h:74
AMPISGBufferRoot::m_comm
MPI_Comm m_comm
the MPI communicator used for the scatter/gather operations
Definition: mpisgbuf.h:31
CMPIVarSGBufferLeaf::CMPIVarSGBufferLeaf
CMPIVarSGBufferLeaf(MPI_Comm, int, int isize=16)
Definition: mpisgvbuf.cpp:238
CMPIVarSGBufferLeaf::m_vbuffer
char * m_vbuffer
Definition: mpisgvbuf.h:71
CMPIVarSGBufferRoot::pop_double
virtual double pop_double(int)
Definition: mpisgvbuf.cpp:216
NULL
#define NULL
Definition: t_list.h:17
CMPIVarSGBufferRoot::m_rpos
int * m_rpos
the number of bytes in the slice (i.e. m_position-m_displ)
Definition: mpisgvbuf.h:34
CMPIVarSGBufferLeaf::growTo
void growTo(int)
Definition: mpisgvbuf.cpp:268
CMPIVarSGBufferLeaf::pop_int
virtual int pop_int()
Definition: mpisgvbuf.cpp:364
CMPIVarSGBufferRoot::m_position
int * m_position
the current end of the content in each slice
Definition: mpisgvbuf.h:33
CMPIVarSGBufferLeaf::clear
virtual void clear()
Definition: mpisgvbuf.cpp:279
CMPIVarSGBufferRoot::m_ndummy
int m_ndummy
Definition: mpisgvbuf.h:38
CMPIVarSGBufferLeaf::pop_double
virtual double pop_double()
Definition: mpisgvbuf.cpp:379
CMPIVarSGBufferRoot::growTo
void growTo(int)
Definition: mpisgvbuf.cpp:75
AMPISGBufferLeaf::m_dbl_increment
int m_dbl_increment
the "packing size" of int/double
Definition: mpisgbuf.h:67
CMPIVarSGBufferRoot::pop_doubles
virtual void pop_doubles(int, double *, int)
Definition: mpisgvbuf.cpp:224
mpisgbuf.h
CMPIVarSGBufferLeaf::m_position
int m_position
the current end of the content
Definition: mpisgvbuf.h:73
CMPIVarSGBufferRoot::m_displ
int * m_displ
Definition: mpisgvbuf.h:37
CMPIVarSGBufferLeaf::receive
virtual void receive()
Definition: mpisgvbuf.cpp:299
AMPISGBufferRoot::m_int_increment
int m_int_increment
Definition: mpisgbuf.h:34
CMPIVarSGBufferRoot::append
virtual void append(int, int)
Definition: mpisgvbuf.cpp:147
CMPIVarSGBufferLeaf::pop_doubles
virtual void pop_doubles(double *, int)
Definition: mpisgvbuf.cpp:387
AMPISGBufferLeaf
Abstract base class for scatter/gather buffer, leaf component.
Definition: mpisgbuf.h:64
CMPIVarSGBufferRoot::m_recvcount
int * m_recvcount
the buffer for the transfer of the size of the vbuffer
Definition: mpisgvbuf.h:36
AMPISGBufferRoot::m_size
int m_size
size of the communicator
Definition: mpisgbuf.h:33
CMPIVarSGBufferRoot::CMPIVarSGBufferRoot
CMPIVarSGBufferRoot(MPI_Comm, int isize=16)
Definition: mpisgvbuf.cpp:25
CMPIVarSGBufferRoot::m_vbuffer
char * m_vbuffer
Definition: mpisgvbuf.h:30
mpisgvbuf.h
CMPIVarSGBufferRoot::clear
virtual void clear()
Definition: mpisgvbuf.cpp:91
CMPIVarSGBufferLeaf::send
virtual void send()
Definition: mpisgvbuf.cpp:287
AMPISGBufferRoot::m_dbl_increment
int m_dbl_increment
the "packing size" of int/double
Definition: mpisgbuf.h:34
AMPISGBufferRoot
Abstract base class for scatter/gather buffer, root component.
Definition: mpisgbuf.h:29