OpenAtom  Version1.5a
pcMessages.h
1 #include "pcMessages.decl.h"
2 #include "ckcomplex.h"
3 
4 #ifndef PC_MESSAGES_H
5 #define PC_MESSAGES_H
6 
8 {
9  public:
10 #ifdef PC_USE_RDMA
11  struct infiDirectUserHandle rhandle;
12 #endif
13  int index;
14  int grain;
15  bool left;
16  bool symmetric;
17 #ifdef PC_USE_RDMA
18  void init(struct infiDirectUserHandle _rhandle, int _index, int _grain,bool _left, bool _symmetric)
19  {
20  rhandle=_rhandle;
21  index=_index;
22  grain=_grain;
23  left=_left;
24  symmetric=_symmetric;
25  }
26 #else
27  // who cares?
28 #endif
29  friend class CMessage_RDMAHandleMsg;
30 };
31 
32 
33 
35  public:
36  CkCallback cb;
37  CkGroupID mCastGrpId;
38  bool lbsync;
39  int orthoX;
40  int orthoY;
41  friend class CMessage_initGRedMsg;
42 };
43 
44 
45 
47  public:
48  int offset;
49  int dest;
50  CkGroupID mCastGrpId;
51  CkCallback synccb;
52  bool lbsync;
53  friend class CMessage_initGRedMsg;
54 };
55 
56 
57 
59  public:
60  bool otherdata;
61 };
62 
63 
64 
66  public:
67  bool flag_dp;
68 };
69 
70 
71 
72 class mySendMsg : public CMessage_mySendMsg {
73  public:
74  int N;
75  complex *data;
76  friend class CMessage_mySendMsg;
77 };
78 
79 
80 
82  public:
83  complex *result;
84  int N;
85  int myoffset;
86  CkIndex4D sndr;
87  void init(CkIndex4D _sndr, int _size, int _myoffset, complex *_points)
88  {
89  sndr = _sndr;
90  N=_size;
91  myoffset=_myoffset;
92  CmiMemcpy(result,_points,N*sizeof(complex));
93  }
94 
95  friend class CMessage_partialResultMsg;
96 
97 };
98 
99 
100 
102  public:
103  complex *result;
104  int N;
105  int priority;
106  CkCallback cb;
107 
108  friend class CMessage_priorSumMsg;
109 
110 };
111 
112 
113 
114 /** The new message for sending input data to the PairCalculator. Implements API as required by MessageDataCollator viz.
115  * the sender(), numDataUnits() and data() methods.
116  */
118 {
119  friend class CMessage_paircalcInputMsg;
120 
121  public:
122  /// Provide the API required by the MessageDataCollator
123  /// An incomplete constructor just for the collator
124  paircalcInputMsg(const int _sender, const int _nCols, const int _nRows=1)
125  : nCols(_nCols), nRows(_nRows), senderID(_sender), doPsiV(false) {}
126  /// The number of rows in the data array stored in this msg
127  inline int numRows() const { return nRows; }
128  /// The number of columns of data units in the data array stored in this msg
129  inline int numCols() const { return nCols; }
130  /// An integer representation of the sender's ID
131  inline int sender() const { return senderID; }
132  /// A pointer to the message data. No checks on pointer validity. Use with a pinch of salt
133  inline inputType* data() { return points; }
134  /// Constructor used to create actual GSpace to PC messages
135  paircalcInputMsg(int _size, int _sender, bool _fromRow, bool _flag_dp, inputType *_points , bool _doPsiV, int _blkSize, int _nRows=1)
136  {
137  nCols =_size;
138  nRows =_nRows;
139  senderID =_sender;
140  fromRow =_fromRow;
141  flag_dp =_flag_dp;
142  doPsiV =_doPsiV;
143  blkSize =_blkSize;
144  CmiMemcpy(points,_points,nRows*nCols*sizeof(inputType));
145  }
146  /// @todo: Message data, should slowly be hidden from the world. The sender and end user could become friends
148  bool fromRow, flag_dp, doPsiV;
149  int blkSize; ///< @todo: blkSize is used in paircalc only for dumping data files in the backward path. Also, it cannot be retreived when usng RDMA. Is there an alternative?
150 
151  private:
152  int senderID, nCols, nRows;
153 };
154 
155 
156 /*
157 class phantomMsg : public CMessage_phantomMsg {
158  public:
159  int size;
160  int numPoints;
161  double *points;
162  int blkSize;
163  int actionType;
164  void init(int _size, int _numPoints, bool _flag_dp, double *_points, int _blkSize, int _actionType)
165  {
166  CkPrintf("WARNING: WARNING: phantomMsg has been created\n");
167  size=_size;
168  numPoints=_numPoints;
169  blkSize=_blkSize;
170  CmiMemcpy(points,_points,size*sizeof(double));
171  actionType=_actionType;
172  }
173 
174 };
175 
176 */
177 
179  public:
180  internalType *matrix1;
181  internalType *matrix2;
182  int size;
183  int size2;
184  int orthoX;
185  int orthoY;
186  int actionType;
187  void init(int _size, int _size2, internalType *_points1, internalType *_points2, int _orthoX, int _orthoY, bool _actionType)
188  {
189  size=_size;
190  size2=_size2;
191  orthoX=_orthoX;
192  orthoY=_orthoY;
193  CmiMemcpy(matrix1,_points1,size*sizeof(internalType));
194  CmiMemcpy(matrix2,_points2,size2*sizeof(internalType));
195  actionType=_actionType;
196  }
197  void init1(int _size, internalType *_points1, int _orthoX, int _orthoY,int _actionType)
198  {
199  size=_size;
200  size2=0;
201  orthoX=_orthoX;
202  orthoY=_orthoY;
203  CmiMemcpy(matrix1,_points1,size*sizeof(internalType));
204  actionType=_actionType;
205  // this field does nothing in minimization
206  matrix2=NULL;
207  }
208  friend class CMessage_multiplyResultMsg;
209 };
210 
211 
212 
214  public:
215  double *matrix;
216  int size;
217  bool symmetric;
218  void init(int _size, double *_points, bool _symmetric)
219  {
220  size=_size;
221  symmetric=_symmetric;
222  CmiMemcpy(matrix,_points,size*sizeof(double));
223  }
224  friend class CMessage_entireResultMsg;
225 };
226 
227 
228 
230  public:
231  double *matrix1;
232  double *matrix2;
233  int size;
234  bool symmetric;
235  void init(int _size, double *_points1, double *_points2, bool _symmetric)
236  {
237  size=_size;
238  symmetric=_symmetric;
239  CmiMemcpy(matrix1,_points1,size*sizeof(double));
240  CmiMemcpy(matrix2,_points2,size*sizeof(double));
241  }
242  friend class CMessage_entireResultMsg2;
243 };
244 
245 #endif // PC_MESSAGES_H
246 
int sender() const
An integer representation of the sender's ID.
Definition: pcMessages.h:131
paircalcInputMsg(int _size, int _sender, bool _fromRow, bool _flag_dp, inputType *_points, bool _doPsiV, int _blkSize, int _nRows=1)
Constructor used to create actual GSpace to PC messages.
Definition: pcMessages.h:135
inputType * data()
A pointer to the message data. No checks on pointer validity. Use with a pinch of salt...
Definition: pcMessages.h:133
int numCols() const
The number of columns of data units in the data array stored in this msg.
Definition: pcMessages.h:129
int numRows() const
The number of rows in the data array stored in this msg.
Definition: pcMessages.h:127
paircalcInputMsg(const int _sender, const int _nCols, const int _nRows=1)
Provide the API required by the MessageDataCollator An incomplete constructor just for the collator...
Definition: pcMessages.h:124
inputType * points
Definition: pcMessages.h:147
The new message for sending input data to the PairCalculator.
Definition: pcMessages.h:117