Dendro  5.01
Dendro in Greek language means tree. The Dendro library is a large scale (262K cores on ORNL's Titan) distributed memory adaptive octree framework. The main goal of Dendro is to perform large scale multiphysics simulations efficeiently in mordern supercomputers. Dendro consists of efficient parallel data structures and algorithms to perform variational ( finite element) methods and finite difference mthods on 2:1 balanced arbitary adaptive octrees which enables the users to perform simulations raning from black holes (binary black hole mergers) to blood flow in human body, where applications ranging from relativity, astrophysics to biomedical engineering.
asyncExchangeContex.h
1 //
2 // Created by milinda on 11/19/18.
3 //
4 
10 #ifndef DENDRO_5_0_UPDATECTX_H
11 #define DENDRO_5_0_UPDATECTX_H
12 
13 #include "mpi.h"
14 #include <vector>
15 
16 namespace ot {
17 
19 
20  private :
22  void* m_uiBuffer;
23 
25  void* m_uiSendBuf;
26 
28  void* m_uiRecvBuf;
29 
30  std::vector<MPI_Request*> m_uiRequests;
31 
32  public:
34  AsyncExchangeContex(const void* var)
35  {
36  m_uiBuffer=(void*)var;
37  m_uiSendBuf=NULL;
38  m_uiRecvBuf=NULL;
39  m_uiRequests.clear();
40  }
41 
43  inline void allocateSendBuffer(size_t bytes)
44  {
45  m_uiSendBuf=malloc(bytes);
46  }
47 
49  inline void allocateRecvBuffer(size_t bytes)
50  {
51  m_uiRecvBuf=malloc(bytes);
52  }
53 
55  inline void deAllocateSendBuffer()
56  {
57  free(m_uiSendBuf);
58  m_uiSendBuf=NULL;
59  }
60 
62  inline void deAllocateRecvBuffer()
63  {
64  free(m_uiRecvBuf);
65  m_uiRecvBuf=NULL;
66  }
67 
68  inline void* getSendBuffer() { return m_uiSendBuf;}
69  inline void* getRecvBuffer() { return m_uiRecvBuf;}
70 
71  inline const void* getBuffer() {return m_uiBuffer;}
72 
73  inline std::vector<MPI_Request*>& getRequestList(){ return m_uiRequests;}
74 
75  bool operator== (AsyncExchangeContex other) const{
76  return( m_uiBuffer == other.m_uiBuffer );
77  }
78 
80 
81  /* for(unsigned int i=0;i<m_uiRequests.size();i++)
82  {
83  delete m_uiRequests[i];
84  m_uiRequests[i]=NULL;
85  }
86 
87  m_uiRequests.clear();*/
88 
89  }
90 
91  };
92 
93 } //end namespace
94 
95 #endif //DENDRO_5_0_UPDATECTX_H
Simple class to manage async data transfer in the ODA class.
Definition: asyncExchangeContex.h:16
Definition: asyncExchangeContex.h:18
void deAllocateRecvBuffer()
allocates recv buffer for ghost exchange
Definition: asyncExchangeContex.h:62
void allocateRecvBuffer(size_t bytes)
allocates recv buffer for ghost exchange
Definition: asyncExchangeContex.h:49
AsyncExchangeContex(const void *var)
creates an async ghost exchange contex
Definition: asyncExchangeContex.h:34
void allocateSendBuffer(size_t bytes)
allocates send buffer for ghost exchange
Definition: asyncExchangeContex.h:43
void deAllocateSendBuffer()
allocates send buffer for ghost exchange
Definition: asyncExchangeContex.h:55