PaCO++  0.05
Controlled.h
Go to the documentation of this file.
1 #ifndef _IDENTITY_H
2 #define _IDENTITY_H
3 
5 #include "ControlledIdl.h"
6 
7 #include "CommMatrix.h"
8 
9 using namespace std;
10 
14 
16 {
17 private:
19  // Client & Server side
20 
21  unsigned _config; // vector of bit describing which elements have been configured (cf .cc)
22 
23  PaCO::PacoTopology_t _sTopo; // topology of the source (sender) -- SET
24  PaCO::PacoTopology_t _dTopo; // topology of the destination (receiver) -- SET
25 
26  unsigned _nodeRank; // id of the node (either source or destination) -- SET
27  unsigned _unitsize; // #bytes of one element -- SET
28 
30  // Client Side
31  char* _clientBuffer; // pointer to the user data (set)
32  ControlledLib::ControlledDescr _clientDescr; // contains the descr exchange between sender & destination -- SET indirectly
33 
36 
37  unsigned _maxllen;
38 
40  // Server Side
41  unsigned _llen; // local vector size: in element -- internal
42  unsigned long _serverToReceived; // #of element yet to be received (during an invocation)
43  char* _serverBuffer; // Buffer where to receive the data
44 
45  ControlledLib::ControlledDescr* _serverDescr; // contains the descr exchange between sender & destination -- SET indirectly
46 
49 
50 public:
51  Controlled();
52  virtual ~Controlled();
53 
54  // Common
55  virtual void setSourceTopology(PaCO::PacoTopology_t topo);
56  virtual PaCO::PacoTopology_t getSourceTopology();
57  virtual void setDestTopology(PaCO::PacoTopology_t topo);
58  virtual PaCO::PacoTopology_t getDestTopology();
59  virtual void setNodeRank(long Rank);
60  virtual long getNodeRank();
61  virtual void setCommunicator(void * group) {}
62 
63  // Data description API
64  void setEltSize(unsigned long size);
65  void setMaxLocalLen(unsigned long elt_nb);
66 
67  void readFromFile(char *filename);
68  long getMaxLen();
69 
70  // Client Side
71  virtual PieceToSend* computePiecesToSend(unsigned& size);
72  virtual void setDataPtr(void* dataPtr);
73  virtual void* getClientData(void *pid, int server_node, long & size, long & length, bool & end);
74  virtual void* getDescr();
75  virtual void clientFree(); // true if com schedule to be freed
76 
77 
78  // Server Side
79  virtual bool insertData(void* rcptBuf, unsigned long element_nb);
80  virtual void setDescr(void * descr);
81 
82  virtual void* getServerData(long & length);
83  virtual void serverFree();
84 
85 protected:
86  void _setSourceTopology(unsigned long total);
87  void _setDestTopology(unsigned long total);
88  void _setLocalLen(unsigned long elt_nb);
89 
90 };
91 
95 
97 {
98 
99  public:
101  virtual ~Controlled_fab() {}
102 
104  {
105  return new Controlled();
106  }
107 
108 };
109 
110 #endif
char * _serverBuffer
Definition: Controlled.h:43
CommMatrix * _remaining_cm
Definition: Controlled.h:35
unsigned _nodeRank
Definition: Controlled.h:26
char * _clientBuffer
Definition: Controlled.h:31
PaCO::PacoTopology_t _sTopo
Definition: Controlled.h:23
unsigned _llen
Definition: Controlled.h:41
unsigned _config
Definition: Controlled.h:21
ControlledLib::ControlledDescr * _serverDescr
Definition: Controlled.h:45
virtual void setCommunicator(void *group)
Definition: Controlled.h:61
CommMatrix * _cm
Definition: Controlled.h:34
unsigned _maxllen
Definition: Controlled.h:37
DistributionLibrary * create()
Definition: Controlled.h:103
unsigned long _serverToReceived
Definition: Controlled.h:42
unsigned _unitsize
Definition: Controlled.h:27
PaCO::PacoTopology_t _dTopo
Definition: Controlled.h:24
ControlledLib::ControlledDescr _clientDescr
Definition: Controlled.h:32
virtual ~Controlled_fab()
Definition: Controlled.h:101