8 #ifndef CO_VRMSController_H
9 #define CO_VRMSController_H
30 #include <util/coTypes.h>
34 #define CLUSTER_MARK() \
36 coVRMSController::msController->checkMark(__FILE__, __LINE__);
38 #define CLUSTER_MARK() ;
45 #define MAX_NUMBER_OF_SLAVES 256
104 static coVRMSController *instance();
105 coVRMSController(
int AmyID = -1,
const char *addr = NULL,
int port = 0);
107 coVRMSController(
const MPI_Comm *comm);
111 void checkMark(
const char *file,
int line);
112 void connectToMaster(
const char *addr,
int port);
123 return (numSlaves > 0);
125 int readMaster(
void *c,
int n,
bool mcastOverTCP);
126 int readMaster(
void *c,
int n);
127 int readMasterDraw(
void *c,
int n,
bool mcastOverTCP);
128 int readMasterDraw(
void *c,
int n);
129 void sendMaster(
const void *c,
int n);
130 void sendMasterDraw(
const void *c,
int n);
131 int readSlave(
int slaveNum,
void *data,
int num);
132 int readSlaves(SlaveData *c);
133 int readSlavesDraw(
void *c,
int n);
134 void sendSlave(
int i,
const void *c,
int n);
135 void sendSlaves(
const void *c,
int n);
136 void sendSlaves(
const SlaveData &c);
137 void sendSlavesDraw(
const void *c,
int n);
138 void sendSlaves(
const covise::Message *msg);
139 int readMaster(covise::Message *msg);
140 void sendMaster(
const covise::Message *msg);
141 void sendMaster(
const std::string &s);
142 void readSlave(
int i, std::string &s);
149 void syncApp(
int frameNum);
150 void syncInt(
int value);
151 void syncFloat(
float value);
152 void syncStringStop(std::string name);
155 int syncData(
void *data,
int size);
156 int syncMessage(covise::Message *msg);
159 bool reduceAnd(
bool);
160 bool allReduceOr(
bool);
161 bool allReduceAnd(
bool);
162 std::string syncString(
const std::string &s);
163 bool syncVRBMessages();
164 void waitForSlaves();
165 void waitForSlavesDraw();
166 void waitForMaster();
170 void waitForSerialGo();
171 void sendParallelGo();
172 void waitForParallelGo();
173 void waitForParallelJoin();
174 void loadFile(
const char *filename);
177 return numSlaves + 1;
182 return this->numSlaves;
185 void heartBeat(
const std::string &name =
"unnamed",
bool draw =
false);
187 bool drawStatistics()
const;
188 void setDrawStatistics(
bool enable);
191 MPI_Comm getAppCommunicator()
const
193 return this->appComm;
198 bool debugLevel(
int l)
const;
209 bool m_drawStatistics;
210 Rel_Mcast *multicast;
211 int multicastDebugLevel;
212 std::string multicastAddress;
214 std::string multicastInterface;
218 unsigned int multicastBufferSpace;
219 int multicastBlockSize;
220 int multicastNumParity;
221 unsigned int multicastTxCacheSize;
222 int multicastTxCacheMin;
223 int multicastTxCacheMax;
225 double multicastBackoffFactor;
226 int multicastSockBuffer;
227 int multicastClientTimeout;
228 int multicastServerTimeout;
229 int multicastRetryTimeout;
230 int multicastMaxLength;
234 covise::Socket *socket;
235 covise::Socket *socketDraw;
246 int heartBeatCounter, heartBeatCounterDraw;
247 static coVRMSController *s_singleton;
#define MAX_NUMBER_OF_SLAVES
Definition: coVRMSController.h:45
int getNumSlaves() const
Definition: coVRMSController.h:180
Definition: coVRMSController.h:52
bool isSlave() const
Definition: coVRMSController.h:117
bool isMaster() const
Definition: coVRMSController.h:113
Definition: coVRMSController.h:59
bool isCluster() const
Definition: coVRMSController.h:121
int getID()
Definition: coVRMSController.h:143
Definition: coVRMSController.h:74
Definition: coVRMSController.h:78
Definition: coVRMSController.h:61
Definition: coVRMSController.h:58
Definition: coVRMSController.h:60
int clusterSize()
Definition: coVRMSController.h:175
std::vector< void * > data
Definition: coVRMSController.h:89
int size() const
Definition: coVRMSController.h:92
Definition: coVRMSController.h:62
Definition: coVRMSController.h:63