Changeset 492
- Timestamp:
- 10/02/14 17:34:02 (10 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/context_server.cpp
r489 r492 14 14 #include "timer.hpp" 15 15 #include "cxios.hpp" 16 #include "event_scheduler.hpp" 17 #include "server.hpp" 18 #include <boost/functional/hash.hpp> 16 19 17 20 … … 32 35 else MPI_Comm_size(interComm,&commSize) ; 33 36 currentTimeLine=0 ; 37 scheduled=false ; 34 38 finished=false ; 39 40 boost::hash<string> hashString ; 41 hashId=hashString(context->getId()) ; 42 35 43 } 36 44 void CContextServer::setPendingEvent(void) … … 150 158 { 151 159 event=it->second ; 160 152 161 if (event->isFull()) 153 162 { 163 if (!scheduled && !CXios::isServer) 164 { 165 CServer::eventScheduler->registerEvent(currentTimeLine,hashId) ; 166 scheduled=true ; 167 } 168 else if (CXios::isServer || CServer::eventScheduler->queryEvent(currentTimeLine,hashId) ) 169 { 154 170 CTimer::get("Process events").resume() ; 155 171 dispatchEvent(*event) ; … … 159 175 events.erase(it) ; 160 176 currentTimeLine++ ; 161 } 162 } 163 } 177 scheduled = false ; 178 } 179 } 180 } 181 } 164 182 165 183 CContextServer::~CContextServer() -
XIOS/trunk/src/context_server.hpp
r382 r492 41 41 bool finished ; 42 42 bool pendingEvent ; 43 bool scheduled ; /*!< event of current timeline is alreading scheduled ? */ 44 size_t hashId ; 43 45 ~CContextServer() ; 44 46 } ; -
XIOS/trunk/src/server.cpp
r491 r492 12 12 #include "tracer.hpp" 13 13 #include "timer.hpp" 14 #include "event_scheduler.hpp" 14 15 15 16 namespace xios … … 23 24 bool CServer::finished=false ; 24 25 bool CServer::is_MPI_Initialized ; 26 CEventScheduler* CServer::eventScheduler ; 25 27 26 28 void CServer::initialize(void) … … 86 88 { 87 89 clientLeader=it->second ; 90 int intraCommSize, intraCommRank ; 91 MPI_Comm_size(intraComm,&intraCommSize) ; 92 MPI_Comm_rank(intraComm,&intraCommRank) ; 93 cout<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize 94 <<" intraCommRank :"<<intraCommRank<<" clientLeader "<< clientLeader<<endl ; 88 95 89 96 MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ; … … 122 129 interComm.push_back(newComm) ; 123 130 } 124 oasis_enddef() ;131 oasis_enddef() ; 125 132 } 126 133 … … 129 136 if (rank==0) isRoot=true; 130 137 else isRoot=false; 131 // eventLoop() ; 132 // finalize() ;138 139 eventScheduler = new CEventScheduler(intraComm) ; 133 140 } 134 141 … … 136 143 { 137 144 CTimer::get("XIOS").suspend() ; 145 146 delete eventScheduler ; 147 138 148 if (!is_MPI_Initialized) 139 149 { … … 166 176 contextEventLoop() ; 167 177 if (finished && contextList.empty()) stop=true ; 178 if (! CXios::isServer) eventScheduler->checkEvent() ; 168 179 } 169 180 CTimer::get("XIOS server").suspend() ; -
XIOS/trunk/src/server.hpp
r490 r492 5 5 #include "context.hpp" 6 6 #include "mpi.hpp" 7 #include "event_scheduler.hpp" 7 8 8 9 namespace xios … … 25 26 static MPI_Comm intraComm ; 26 27 static list<MPI_Comm> interComm ; 28 static CEventScheduler* eventScheduler ; 27 29 28 30 struct contextMessage -
XIOS/trunk/src/xmlioserver_spl.hpp
r490 r492 20 20 #include <map> 21 21 #include <deque> 22 #include <queue> 22 23 #include <valarray> 23 24 // Flux.
Note: See TracChangeset
for help on using the changeset viewer.