Changeset 2523 for XIOS3/trunk
- Timestamp:
- 06/23/23 14:46:51 (12 months ago)
- Location:
- XIOS3/trunk/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk/src/client.cpp
r2458 r2523 188 188 189 189 CXios::launchDaemonsManager(false) ; 190 poolRessource_ = new CPoolRessource(clientComm, codeId, false) ; 190 shared_ptr<CEventScheduler> eventScheduler ; 191 poolRessource_ = new CPoolRessource(clientComm, eventScheduler, codeId, false) ; 191 192 192 193 ///////////////////////////////////////// … … 196 197 MPI_Request req ; 197 198 MPI_Status status ; 198 MPI_Ibarrier( xiosGlobalComm,&req) ; // be sure that all services are created now, could be remove later if more asynchronisity199 MPI_Ibarrier(CXios::getXiosComm(),&req) ; // be sure that all services are created now, could be remove later if more asynchronisity 199 200 int ok=false ; 200 201 while (!ok) … … 443 444 MPI_Comm_rank(contextComm,&commRank) ; 444 445 MPI_Comm_size(contextComm,&commSize) ; 445 446 getPoolRessource()->createService(contextComm, id, 0, CServicesManager::CLIENT, 1) ; 447 getPoolRessource()->createService(contextComm, id+"_"+CXios::defaultWriterId, 0, CServicesManager::WRITER, 1) ; 448 getPoolRessource()->createService(contextComm, id+"_"+CXios::defaultReaderId, 0, CServicesManager::READER, 1) ; 446 447 shared_ptr<CEventScheduler> eventScheduler ; 448 449 getPoolRessource()->createService(contextComm, eventScheduler, id, 0, CServicesManager::CLIENT, 1) ; 450 // getPoolRessource()->createService(contextComm, eventScheduler, id+"_"+CXios::defaultWriterId, 0, CServicesManager::WRITER, 1) ; 451 getPoolRessource()->createNewServiceOnto(id+"_"+CXios::defaultWriterId, CServicesManager::WRITER, id) ; 452 // getPoolRessource()->createService(contextComm, eventScheduler, id+"_"+CXios::defaultReaderId, 0, CServicesManager::READER, 1) ; 453 getPoolRessource()->createNewServiceOnto(id+"_"+CXios::defaultReaderId, CServicesManager::READER, id) ; 449 454 450 455 if (commRank==0) while (!CXios::getServicesManager()->hasService(getPoolRessource()->getId(), id, 0)) { CXios::getDaemonsManager()->eventLoop();} -
XIOS3/trunk/src/manager/contexts_manager.hpp
r2260 r2523 75 75 MPI_Comm xiosComm_ ; 76 76 77 int notifyType_ ;77 int notifyType_ = NOTIFY_NOTHING ; 78 78 tuple<std::string, std::string, int, std::string> notifyCreateContext_ ; 79 79 tuple<std::string, std::string, int, std::string, int, std::string> notifyCreateIntercomm_ ; -
XIOS3/trunk/src/manager/pool_ressource.cpp
r2517 r2523 7 7 #include "cxios.hpp" 8 8 #include "timer.hpp" 9 #include "event_scheduler.hpp" 9 10 10 11 namespace xios 11 12 { 12 CPoolRessource::CPoolRessource(MPI_Comm poolComm, const std::string& Id, bool isServer) : Id_(Id), finalizeSignal_(false)13 CPoolRessource::CPoolRessource(MPI_Comm poolComm, shared_ptr<CEventScheduler> eventScheduler, const std::string& Id, bool isServer) : Id_(Id), finalizeSignal_(false) 13 14 { 14 15 int commRank, commSize ; … … 29 30 winNotify_->updateToExclusiveWindow(commRank, this, &CPoolRessource::notificationsDumpOut) ; 30 31 MPI_Barrier(poolComm_) ; 32 if (eventScheduler) eventScheduler_=eventScheduler ; 33 else eventScheduler_= make_shared<CEventScheduler>(poolComm) ; 34 freeRessourceEventScheduler_ = eventScheduler_ ; 31 35 } 32 36 … … 36 40 37 41 auto it=occupancy_.begin() ; 42 43 // ym obsolete, service cannot overlap, only created on separate ressource or matching excatly existing service 44 // occupancy management must not be used anymore => simplification 45 // for now raise a message error when no ressources are availables 46 38 47 int commSize ; 39 48 MPI_Comm_size(poolComm_, &commSize) ; … … 43 52 for(int i=0; i<size; i++) 44 53 { 54 if (it->first != 0) ERROR("void CPoolRessource::createService(const std::string& serviceId, int type, int size, int nbPartitions)", 55 << "No enough free ressources on pool id="<<getId()<<" to launch service id="<<serviceId); 45 56 procs_in[it->second]=true ; 46 57 procs_update.push_back(std::pair<int,int>(it->first+1,it->second)) ; 47 58 ++it ; 48 59 } 49 60 61 50 62 occupancy_.erase(occupancy_.begin(),it) ; 51 63 occupancy_.insert(procs_update.begin(),procs_update.end()) ; … … 247 259 { 248 260 249 info(40)<<"CPoolRessource::createNewService : receive createService notification ; serviceId : "<<serviceId<<endl ; 250 MPI_Comm serviceComm, newServiceComm ; 251 int commRank ; 252 MPI_Comm_rank(poolComm_,&commRank) ; 253 MPI_Comm_split(poolComm_, in, commRank, &serviceComm) ; 254 if (in) 255 { 256 int serviceCommSize ; 257 int serviceCommRank ; 258 MPI_Comm_size(serviceComm,&serviceCommSize) ; 259 MPI_Comm_rank(serviceComm,&serviceCommRank) ; 260 261 info(10)<<"Service "<<serviceId<<" created "<<" service size : "<<serviceCommSize<< " service rank : "<<serviceCommRank 262 <<" on rank pool "<<commRank<<endl ; 261 info(40)<<"CPoolRessource::createNewService : receive createService notification ; serviceId : "<<serviceId<<endl ; 262 MPI_Comm serviceComm, newServiceComm, freeComm ; 263 int commRank ; 264 265 int color; 266 if (!services_.empty()) color = 0 ; 267 else color=1 ; 268 MPI_Comm_rank(poolComm_,&commRank) ; 269 MPI_Comm_split(poolComm_, color, commRank, &freeComm) ; // workaround 270 271 if (services_.empty()) 272 { 273 MPI_Comm_rank(freeComm,&commRank) ; 274 MPI_Comm_split(freeComm, in, commRank, &serviceComm) ; 275 276 // temporary for event scheduler, we must using hierarchical split of free ressources communicator. 277 // we hope for now that spliting using occupancy make this match 278 279 if (in) 280 { 281 int serviceCommSize ; 282 int serviceCommRank ; 283 MPI_Comm_size(serviceComm,&serviceCommSize) ; 284 MPI_Comm_rank(serviceComm,&serviceCommRank) ; 285 286 info(10)<<"Service "<<serviceId<<" created "<<" service size : "<<serviceCommSize<< " service rank : "<<serviceCommRank 287 <<" on rank pool "<<commRank<<endl ; 263 288 264 int partitionId ; 265 if ( serviceCommRank >= (serviceCommSize/nbPartitions+1)*(serviceCommSize%nbPartitions) ) 266 { 267 int rank = serviceCommRank - (serviceCommSize/nbPartitions+1)*(serviceCommSize%nbPartitions) ; 268 partitionId = serviceCommSize%nbPartitions + rank / (serviceCommSize/nbPartitions) ; 269 } 270 else partitionId = serviceCommRank / (serviceCommSize/nbPartitions + 1) ; 271 272 MPI_Comm_split(serviceComm, partitionId, commRank, &newServiceComm) ; 289 int partitionId ; 290 if ( serviceCommRank >= (serviceCommSize/nbPartitions+1)*(serviceCommSize%nbPartitions) ) 291 { 292 int rank = serviceCommRank - (serviceCommSize/nbPartitions+1)*(serviceCommSize%nbPartitions) ; 293 partitionId = serviceCommSize%nbPartitions + rank / (serviceCommSize/nbPartitions) ; 294 } 295 else partitionId = serviceCommRank / (serviceCommSize/nbPartitions + 1) ; 296 297 MPI_Comm_split(serviceComm, partitionId, commRank, &newServiceComm) ; 298 299 MPI_Comm_size(newServiceComm,&serviceCommSize) ; 300 MPI_Comm_rank(newServiceComm,&serviceCommRank) ; 301 info(10)<<"Service "<<serviceId<<" created "<<" partition : " <<partitionId<<" service size : "<<serviceCommSize 302 << " service rank : "<<serviceCommRank <<" on rank pool "<<commRank<<endl ; 303 304 shared_ptr<CEventScheduler> parentScheduler, childScheduler ; 305 freeRessourceEventScheduler_->splitScheduler(newServiceComm, parentScheduler, childScheduler) ; 306 if (isFirstSplit_) eventScheduler_ = parentScheduler ; 307 isFirstSplit_=false ; 308 309 services_[std::make_tuple(serviceId,partitionId)] = new CService(newServiceComm, childScheduler, Id_, serviceId, partitionId, type, nbPartitions) ; 273 310 274 MPI_Comm_size(newServiceComm,&serviceCommSize) ; 275 MPI_Comm_rank(newServiceComm,&serviceCommRank) ; 276 info(10)<<"Service "<<serviceId<<" created "<<" partition : " <<partitionId<<" service size : "<<serviceCommSize 277 << " service rank : "<<serviceCommRank <<" on rank pool "<<commRank<<endl ; 278 279 services_[std::make_tuple(serviceId,partitionId)] = new CService(newServiceComm, Id_, serviceId, partitionId, type, nbPartitions) ; 280 281 MPI_Comm_free(&newServiceComm) ; 282 } 283 MPI_Comm_free(&serviceComm) ; 311 MPI_Comm_free(&newServiceComm) ; 312 } 313 else 314 { 315 shared_ptr<CEventScheduler> parentScheduler, childScheduler ; 316 freeRessourceEventScheduler_->splitScheduler(serviceComm, parentScheduler, childScheduler) ; 317 if (isFirstSplit_) eventScheduler_ = parentScheduler ; 318 freeRessourceEventScheduler_ = childScheduler ; 319 isFirstSplit_=false ; 320 } 321 MPI_Comm_free(&serviceComm) ; 322 } 323 MPI_Comm_free(&freeComm) ; 284 324 } 285 325 … … 300 340 shared_ptr<CEventScheduler> eventScheduler = service.second->getEventScheduler() ; 301 341 info(40)<<"CPoolRessource::createNewServiceOnto ; found onServiceId : "<<onServiceId<<endl ; 302 services_[std::make_tuple(serviceId,partitionId)] = new CService(newServiceComm, Id_, serviceId, partitionId, type,303 nbPartitions , eventScheduler) ;304 } 305 } 306 307 } 308 309 void CPoolRessource::createService(MPI_Comm serviceComm, const std::string& serviceId, int partitionId, int type, int nbPartitions) // for clients & attached310 { 311 services_[std::make_tuple(serviceId,partitionId)] = new CService(serviceComm, Id_, serviceId, partitionId, type, nbPartitions) ;342 services_[std::make_tuple(serviceId,partitionId)] = new CService(newServiceComm, eventScheduler, Id_, serviceId, partitionId, type, 343 nbPartitions) ; 344 } 345 } 346 347 } 348 349 void CPoolRessource::createService(MPI_Comm serviceComm, shared_ptr<CEventScheduler> eventScheduler, const std::string& serviceId, int partitionId, int type, int nbPartitions) // for clients & attached 350 { 351 services_[std::make_tuple(serviceId,partitionId)] = new CService(serviceComm, eventScheduler, Id_, serviceId, partitionId, type, nbPartitions) ; 312 352 } 313 353 -
XIOS3/trunk/src/manager/pool_ressource.hpp
r2458 r2523 5 5 #include "window_manager.hpp" 6 6 #include "services_manager.hpp" 7 #include "event_scheduler.hpp" 7 8 8 9 … … 27 28 28 29 public: 29 CPoolRessource(MPI_Comm poolComm, const std::string& Id, bool isServer) ;30 CPoolRessource(MPI_Comm poolComm, shared_ptr<CEventScheduler> eventScheduler, const std::string& Id, bool isServer) ; 30 31 ~CPoolRessource() ; 31 32 32 33 void createService(const std::string& serviceId, int type, int size, int nbPartition) ; 33 void createService(MPI_Comm serviceComm, const std::string& serviceId, int partitionId, int type, int nbPartitions) ;34 void createService(MPI_Comm serviceComm, shared_ptr<CEventScheduler> eventScheduler, const std::string& serviceId, int partitionId, int type, int nbPartitions) ; 34 35 void createServiceOnto(const std::string& serviceId, int type, const std::string& OnServiceId) ; 35 36 bool eventLoop(bool serviceOnly=false) ; 37 bool hasService(const std::string serviceId, int partitionId) {return services_.count(make_tuple(serviceId,partitionId))>0 ;} 36 38 CService* getService(const std::string serviceId, int partitionId) { return services_[make_tuple(serviceId,partitionId)]; } 37 39 void finalizeSignal(void) ; 38 40 string getId(void) { return Id_; } 41 const MPI_Comm& getCommunicator(void) { return poolComm_ ;} 39 42 40 43 private: … … 53 56 // void checkCreateServiceNotification(void) ; 54 57 void createNewService(const std::string& serviceId, int type, int size, int nbPartitions, bool in) ; 58 public: 55 59 void createNewServiceOnto(const std::string& serviceId, int type, const string& onServiceId) ; 56 60 … … 73 77 const double eventLoopLatency_=0; 74 78 double lastEventLoop_=0. ; 79 80 private: 81 shared_ptr<CEventScheduler> eventScheduler_ ; 82 shared_ptr<CEventScheduler> freeRessourceEventScheduler_ ; 83 bool isFirstSplit_=true ; 84 public: 85 shared_ptr<CEventScheduler> getEventScheduler(void) { return eventScheduler_ ;} 86 75 87 }; 76 88 -
XIOS3/trunk/src/manager/ressources_manager.hpp
r2458 r2523 72 72 MPI_Comm xiosComm_ ; 73 73 74 int notifyType_ ;74 int notifyType_ = NOTIFY_NOTHING; 75 75 tuple<std::string, int> notifyCreatePool_ ; 76 76 -
XIOS3/trunk/src/manager/servers_ressource.cpp
r2517 r2523 3 3 #include "ressources_manager.hpp" 4 4 #include "pool_ressource.hpp" 5 #include "event_scheduler.hpp" 5 6 #include "cxios.hpp" 6 7 #include "mpi.hpp" … … 8 9 #include <vector> 9 10 #include <string> 11 10 12 11 13 … … 39 41 40 42 MPI_Comm_dup(serverComm_, &freeRessourcesComm_) ; 41 43 eventScheduler_ = make_shared<CEventScheduler>(freeRessourcesComm_) ; 44 freeRessourceEventScheduler_ = eventScheduler_ ; 42 45 } 43 46 … … 160 163 MPI_Comm_split(freeRessourcesComm_, isPartOf, commRank, &poolComm) ; 161 164 165 shared_ptr<CEventScheduler> parentScheduler, childScheduler ; 166 freeRessourceEventScheduler_->splitScheduler(poolComm, parentScheduler, childScheduler) ; 167 168 if (isFirstSplit_) eventScheduler_ = parentScheduler ; 169 isFirstSplit_ = false ; 170 162 171 if (isPartOf) 163 172 { 164 poolRessource_ = new CPoolRessource(poolComm, poolId, true) ;173 poolRessource_ = new CPoolRessource(poolComm, childScheduler, poolId, true) ; 165 174 MPI_Comm_free(&poolComm) ; 166 175 } 167 176 else 168 177 { 178 freeRessourceEventScheduler_ = childScheduler ; 169 179 MPI_Comm_free(&freeRessourcesComm_) ; 170 180 freeRessourcesComm_=poolComm ; -
XIOS3/trunk/src/manager/servers_ressource.hpp
r2274 r2523 3 3 4 4 #include "window_manager.hpp" 5 #include "event_scheduler.hpp" 5 6 #include "mpi.hpp" 6 7 #include <vector> … … 33 34 void checkNotifications(void) ; 34 35 CPoolRessource* getPoolRessource(void) { return poolRessource_; } 36 const MPI_Comm& getCommunicator(void) { return serverComm_ ;} 35 37 bool isServerLeader(void) ; 36 38 void finalize(void) ; … … 54 56 double lastEventLoop_=0. ; 55 57 58 private: 59 shared_ptr<CEventScheduler> eventScheduler_ ; 60 shared_ptr<CEventScheduler> freeRessourceEventScheduler_ ; 61 bool isFirstSplit_=true ; 62 public: 63 shared_ptr<CEventScheduler> getEventScheduler(void) { return eventScheduler_ ;} 56 64 friend class CWindowManager ; 57 65 } ; -
XIOS3/trunk/src/manager/services.cpp
r2517 r2523 9 9 namespace xios 10 10 { 11 CService::CService(MPI_Comm serviceComm, const std::string& poolId, const std::string& serviceId, const int& partitionId,12 int type, int nbPartitions , shared_ptr<CEventScheduler> eventScheduler)11 CService::CService(MPI_Comm serviceComm, shared_ptr<CEventScheduler> eventScheduler, const std::string& poolId, const std::string& serviceId, const int& partitionId, 12 int type, int nbPartitions) 13 13 : finalizeSignal_(false), eventScheduler_(nullptr), poolId_(poolId), serviceId_(serviceId), 14 14 partitionId_(partitionId), type_(type), nbPartitions_(nbPartitions), hasNotification_(false) … … 191 191 size_t hashId = hashString(name_) ; 192 192 size_t currentTimeLine=0 ; 193 info(40)<<"CService::checkNotifications(void) : receive notification => event scheduler "<<endl ;193 info(40)<<"CService::checkNotifications(void) : receive notification => event scheduler : timeLine : "<<currentTimeLine<<" hashId : "<<hashId<<endl ; 194 194 eventScheduler_->registerEvent(currentTimeLine,hashId); 195 195 } … … 203 203 size_t hashId = hashString(name_) ; 204 204 size_t currentTimeLine=0 ; 205 info(40)<<"CService::checkNotifications(void) : receive notification => event scheduler : eventIsReceived ?"<<endl ;205 // info(40)<<"CService::checkNotifications(void) : receive notification => event scheduler : eventIsReceived ?"<<endl ; 206 206 if (eventScheduler_->queryEvent(currentTimeLine,hashId)) 207 207 { -
XIOS3/trunk/src/manager/services.hpp
r2404 r2523 19 19 const int NOTIFY_CREATE_CONTEXT=1 ; 20 20 21 CService(MPI_Comm serviceComm, const std::string& poolId, const std::string& serviceId, const int& partitionId,22 int type, int nbPartitions , shared_ptr<CEventScheduler> = nullptr) ;21 CService(MPI_Comm serviceComm, shared_ptr<CEventScheduler>, const std::string& poolId, const std::string& serviceId, const int& partitionId, 22 int type, int nbPartitions) ; 23 23 ~CService() ; 24 24 -
XIOS3/trunk/src/manager/services_manager.cpp
r2517 r2523 304 304 } 305 305 306 void CServicesManager::waitServiceRegistration(const std::string& poolId, const std::string& serviceId) 307 { 308 int nbPartition ; 309 getServiceNbPartitions(poolId,serviceId,0,nbPartition, true) ; 310 for(int n=1;n<nbPartition;n++) waitServiceRegistration(poolId, serviceId, n) ; 311 312 } 306 313 } -
XIOS3/trunk/src/manager/services_manager.hpp
r2458 r2523 49 49 bool hasService(const std::string& poolId, const std::string& serviceId, const int& partitionId) ; 50 50 void waitServiceRegistration(const std::string& poolId, const std::string& serviceId, const int& partitionId); 51 void waitServiceRegistration(const std::string& poolId, const std::string& serviceId); 51 52 void servicesDumpOut(CBufferOut& buffer) ; 52 53 void servicesDumpIn(CBufferIn& buffer) ; … … 74 75 MPI_Comm xiosComm_ ; 75 76 76 int notifyType_ ;77 int notifyType_ = NOTIFY_NOTHING ; 77 78 tuple<std::string, int, int, int> notifyCreateService_ ; 78 79 tuple<std::string, int, std::string> notifyCreateServiceOnto_ ; -
XIOS3/trunk/src/server.cpp
r2458 r2523 202 202 ressourcesManager->waitPoolRegistration(CXios::defaultPoolId) ; 203 203 servicesManager->createServices(CXios::defaultPoolId, CXios::defaultWriterId, CServicesManager::WRITER,nbRessources,1) ; 204 servicesManager->waitServiceRegistration(CXios::defaultPoolId, CXios::defaultWriterId) ; 204 205 servicesManager->createServicesOnto(CXios::defaultPoolId, CXios::defaultReaderId, CServicesManager::READER, CXios::defaultWriterId) ; 206 servicesManager->waitServiceRegistration(CXios::defaultPoolId, CXios::defaultReaderId) ; 205 207 } 206 208 else … … 214 216 ressourcesManager->waitPoolRegistration(CXios::defaultPoolId) ; 215 217 servicesManager->createServices(CXios::defaultPoolId, CXios::defaultGathererId, CServicesManager::GATHERER, nprocsGatherer, 1) ; 218 servicesManager->waitServiceRegistration(CXios::defaultPoolId, CXios::defaultGathererId) ; 216 219 servicesManager->createServicesOnto(CXios::defaultPoolId, CXios::defaultReaderId, CServicesManager::READER, CXios::defaultGathererId) ; 220 servicesManager->waitServiceRegistration(CXios::defaultPoolId, CXios::defaultReaderId) ; 217 221 servicesManager->createServices(CXios::defaultPoolId, CXios::defaultWriterId, CServicesManager::WRITER, nprocsServer, nbPoolsServer2) ; 222 servicesManager->waitServiceRegistration(CXios::defaultPoolId, CXios::defaultWriterId) ; 218 223 } 219 224 } 220 225 // servicesManager->createServices(CXios::defaultPoolId, CXios::defaultServicesId, CServicesManager::ALL_SERVICES, nbRessources, 1) ; 221 226 } 227 228 MPI_Request req ; 229 MPI_Status status ; 230 MPI_Ibarrier(getServersRessource()->getCommunicator(),&req) ; // be sure that all services are created now, could be remove later if more asynchronisity 231 int ok=false ; 232 while (!ok) 233 { 234 daemonsManager->eventLoop() ; 235 MPI_Test(&req,&ok,&status) ; 236 } 237 238 239 testingEventScheduler() ; 222 240 /* 223 241 MPI_Request req ; 224 242 MPI_Status status ; 225 MPI_Ibarrier( xiosGlobalComm,&req) ; // be sure that all services are created now, could be remove later if more asynchronisity243 MPI_Ibarrier(CXios::getXiosComm(),&req) ; // be sure that all services are created now, could be remove later if more asynchronisity 226 244 int ok=false ; 227 245 while (!ok) … … 252 270 253 271 254 272 void CServer::testingEventScheduler(void) 273 { 274 CXios::getPoolRessource()->getEventScheduler()->registerEvent(1,10) ; 275 CXios::getPoolRessource()->getEventScheduler()->registerEvent(2,10) ; 276 if (CXios::getPoolRessource()->hasService(CXios::defaultGathererId,0)) 277 { 278 CXios::getPoolRessource()->getService(CXios::defaultGathererId,0)-> getEventScheduler()->registerEvent(1,100) ; 279 CXios::getPoolRessource()->getService(CXios::defaultGathererId,0)-> getEventScheduler()->registerEvent(2,100) ; 280 CXios::getPoolRessource()->getService(CXios::defaultGathererId,0)-> getEventScheduler()->registerEvent(3,100) ; 281 } 282 if (CXios::getPoolRessource()->hasService(CXios::defaultWriterId,0)) 283 { 284 CXios::getPoolRessource()->getService(CXios::defaultWriterId,0)-> getEventScheduler()->registerEvent(1,1000) ; 285 CXios::getPoolRessource()->getService(CXios::defaultWriterId,0)-> getEventScheduler()->registerEvent(2,1000) ; 286 } 287 CXios::getPoolRessource()->getEventScheduler()->registerEvent(3,10) ; 288 CXios::getPoolRessource()->getEventScheduler()->registerEvent(4,10) ; 289 290 if (CXios::getPoolRessource()->hasService(CXios::defaultGathererId,0)) 291 { 292 CXios::getPoolRessource()->getService(CXios::defaultGathererId,0)-> getEventScheduler()->registerEvent(4,100) ; 293 CXios::getPoolRessource()->getService(CXios::defaultGathererId,0)-> getEventScheduler()->registerEvent(5,100) ; 294 } 295 if (CXios::getPoolRessource()->hasService(CXios::defaultWriterId,0)) 296 { 297 CXios::getPoolRessource()->getService(CXios::defaultWriterId,0)-> getEventScheduler()->registerEvent(3,1000) ; 298 CXios::getPoolRessource()->getService(CXios::defaultWriterId,0)-> getEventScheduler()->registerEvent(4,1000) ; 299 CXios::getPoolRessource()->getService(CXios::defaultWriterId,0)-> getEventScheduler()->registerEvent(5,1000) ; 300 } 301 CXios::getPoolRessource()->getEventScheduler()->registerEvent(5,10) ; 302 CXios::getPoolRessource()->getEventScheduler()->registerEvent(6,10) ; 303 304 int numEvents=0 ; 305 int poolEvent=1 ; 306 int gatherEvent=1 ; 307 int writerEvent=1 ; 308 do 309 { 310 if (CXios::getPoolRessource()->getEventScheduler()->queryEvent(poolEvent,10)) 311 { 312 CXios::getPoolRessource()->getEventScheduler()->popEvent() ; 313 MPI_Barrier(CXios::getPoolRessource()->getCommunicator()); 314 poolEvent++ ; 315 numEvents++; 316 } 317 318 if (CXios::getPoolRessource()->getEventScheduler()->queryEvent(gatherEvent,100)) 319 { 320 CXios::getPoolRessource()->getEventScheduler()->popEvent() ; 321 MPI_Barrier(CXios::getPoolRessource()->getService(CXios::defaultGathererId,0)->getCommunicator()); 322 gatherEvent++ ; 323 numEvents++; 324 } 325 326 if (CXios::getPoolRessource()->getEventScheduler()->queryEvent(writerEvent,1000)) 327 { 328 CXios::getPoolRessource()->getEventScheduler()->popEvent() ; 329 MPI_Barrier(CXios::getPoolRessource()->getService(CXios::defaultWriterId,0)->getCommunicator()); 330 writerEvent++ ; 331 numEvents++; 332 } 333 334 335 } while (numEvents!=11) ; 336 337 } 255 338 256 339 … … 410 493 boost::hash<string> hashString; 411 494 size_t hashId = hashString("oasis_enddef"); 412 if (CXios::getPoolRessource()->getService(CXios::defaultServicesId,0)->getEventScheduler()->queryEvent(0,hashId)) 495 496 if (CXios::getPoolRessource()->getEventScheduler()->queryEvent(0,hashId)) 413 497 { 414 CXios::getPoolRessource()->get Service(CXios::defaultServicesId,0)->getEventScheduler()->popEvent() ;498 CXios::getPoolRessource()->getEventScheduler()->popEvent() ; 415 499 driver_->endSynchronizedDefinition() ; 416 500 eventSent=false ; … … 426 510 boost::hash<string> hashString; 427 511 size_t hashId = hashString("oasis_enddef"); 428 CXios::getPoolRessource()->get Service(CXios::defaultServicesId,0)->getEventScheduler()->registerEvent(0,hashId);512 CXios::getPoolRessource()->getEventScheduler()->registerEvent(0,hashId); 429 513 eventSent=true ; 430 514 } -
XIOS3/trunk/src/server.hpp
r2335 r2523 43 43 static void listenRootOasisEnddef(void); 44 44 static void listenOasisEnddef(void); 45 45 static void testingEventScheduler(void); 46 46 47 static void finalize(void); 47 48 static void eventLoop(void);
Note: See TracChangeset
for help on using the changeset viewer.