- Timestamp:
- 04/03/24 10:33:55 (6 months ago)
- Location:
- XIOS3/trunk/src
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk/src/client.cpp
r2627 r2628 36 36 StdOFStream CClient::m_errorStream; 37 37 CPoolRessource* CClient::poolRessource_=nullptr ; 38 extern CLogType logTimers ; 38 39 39 40 MPI_Comm& CClient::getInterComm(void) { return (interComm_); } … … 543 544 report(0)<< " Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 544 545 report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ; 545 report(100)<<CTimer::getAllCumulatedTime()<<endl ; 546 547 if (info.isActive(logProfile)) 548 { 549 printProfile(); 550 } 551 552 if (info.isActive(logTimers)) report(0)<<"\n"<<CTimer::getAllCumulatedTime()<<endl ; 546 553 if (CXios::reportMemory) 547 554 { … … 552 559 xios::releaseStaticAllocation() ; 553 560 561 } 562 563 void CClient::printProfile() 564 { 565 list< pair<string,int> > timer_name; 566 timer_name.push_back({"XIOS init",0}); 567 timer_name.push_back({"XIOS init context",0}); 568 timer_name.push_back({"XIOS close definition",0}); 569 timer_name.push_back({"XIOS solve inheritance",0}); 570 timer_name.push_back({"XIOS update calendar",0}); 571 timer_name.push_back({"Check late data (read)",1}); 572 timer_name.push_back({"XIOS recv field",0}); 573 timer_name.push_back({"XIOS send field",0}); 574 timer_name.push_back({"Context event loop",1}); 575 timer_name.push_back({"Model to client",1}); 576 timer_name.push_back({"Client workflow",1}); 577 timer_name.push_back({"Applying filters",2}); 578 timer_name.push_back({"Transformation transfers",3}); 579 timer_name.push_back({"Transformation MPI",4}); 580 timer_name.push_back({"Temporal filters",3}); 581 timer_name.push_back({"Scatter event",3}); 582 timer_name.push_back({"Field : send data",4}); 583 timer_name.push_back({"Blocking time",0}); 584 timer_name.push_back({"XIOS context finalize",0}); 585 timer_name.push_back({"XIOS finalize",0}); 586 587 report(0)<< endl; 588 double total_time = CTimer::get("XIOS").getCumulatedTime(); 589 for(auto it_timer_name = timer_name.begin(); it_timer_name != timer_name.end(); it_timer_name++) 590 { 591 double timer_time = CTimer::get(it_timer_name->first).getCumulatedTime(); 592 if ( timer_time / total_time > 0.001 ) 593 { 594 ostringstream printed_line; 595 printed_line << setprecision(3) << std::fixed; 596 for(int itab=0;itab<it_timer_name->second;itab++) 597 printed_line << " "; 598 printed_line << it_timer_name->first << " : " << timer_time <<endl; 599 string string_line = printed_line.str(); 600 report(0)<< string_line; 601 } 602 } 554 603 } 555 604 -
XIOS3/trunk/src/client.hpp
r2332 r2628 15 15 static void xiosGlobalCommByPublishing(MPI_Comm clientComm, const string& codeId) ; 16 16 static void finalize(void); 17 static void printProfile(void); 17 18 static void registerContext(const string& id, MPI_Comm contextComm); 18 19 static void registerContext_old(const string& id, MPI_Comm contextComm); -
XIOS3/trunk/src/distribution/grid_scatterer_connector.hpp
r2267 r2628 10 10 #include "context_client.hpp" 11 11 #include "scatterer_connector.hpp" 12 12 #include "timer.hpp" 13 13 14 14 namespace xios 15 15 { 16 extern CLogType logProfile ; 16 17 17 18 class CGridScattererConnector … … 78 79 event.push(rank, nbSenders_[rank], messages.back()); 79 80 } 81 if (info.isActive(logProfile)) CTimer::get("Scatter event").resume(); 80 82 client->sendEvent(event) ; 83 if (info.isActive(logProfile)) CTimer::get("Scatter event").suspend(); 81 84 } 82 85 -
XIOS3/trunk/src/distribution/grid_transform_connector.hpp
r2291 r2628 10 10 #include "reduction_types.hpp" 11 11 #include "mpi.hpp" 12 #include "timer.hpp" 12 13 13 14 namespace xios 14 15 { 15 16 16 17 extern CLogType logProfile ; 18 17 19 class CGridTransformConnector 18 20 { … … 41 43 map<int,CArray<T,1>> tmpArrayIn ; 42 44 gridScattererConnector_->transfer(dataIn, tmpArrayIn) ; 45 if (info.isActive(logProfile)) CTimer::get("Transformation MPI").resume(); 43 46 vector<MPI_Request> requests ; 44 47 MPI_Request request ; … … 61 64 vector<MPI_Status> status(requests.size()) ; 62 65 MPI_Waitall(requests.size(), requests.data(),status.data()) ; 66 if (info.isActive(logProfile)) CTimer::get("Transformation MPI").suspend(); 63 67 64 68 const double nanValue = std::numeric_limits<double>::quiet_NaN(); -
XIOS3/trunk/src/filter/client_to_server_store_filter.cpp
r2143 r2628 11 11 namespace xios 12 12 { 13 extern CLogType logProfile ; 13 14 CClientToServerStoreFilter::CClientToServerStoreFilter(CGarbageCollector& gc, CField* field, CContextClient* client) 14 15 : CInputPin(gc, 1) … … 24 25 buildWorkflowGraph(data); 25 26 26 CTimer::get("Field : send data").resume();27 if (info.isActive(logProfile)) CTimer::get("Field : send data").resume(); 27 28 CEventClient event(field_->getType(), CField::EVENT_ID_UPDATE_DATA); 28 29 CMessage message ; 29 30 message<<field_->getId() << data[0]->timestamp ; 30 31 field_->getSentGrid()->getClientToServerConnector(client_)->transfer(data[0]->data, client_, event, message) ; 31 CTimer::get("Field : send data").suspend();32 if (info.isActive(logProfile)) CTimer::get("Field : send data").suspend(); 32 33 } 33 34 -
XIOS3/trunk/src/filter/file_reader_source_filter.cpp
r2267 r2628 11 11 namespace xios 12 12 { 13 extern CLogType logProfile ; 13 14 CFileReaderSourceFilter::CFileReaderSourceFilter(CGarbageCollector& gc, CField* field) 14 15 : COutputPin(gc) … … 24 25 void CFileReaderSourceFilter::streamData() 25 26 { 27 if (info.isActive(logProfile)) CTimer::get("Reader workflow data entry").resume(); 26 28 Time timeStamp ; 27 29 CDataPacketPtr packet(new CDataPacket); … … 51 53 CWorkflowGraph::addNode("File Reader Source filter", 1, false, 0, packet); 52 54 } 55 if (info.isActive(logProfile)) CTimer::get("Reader workflow data entry").suspend(); 53 56 54 57 onOutputReady(packet); -
XIOS3/trunk/src/filter/filter.cpp
r1358 r2628 1 1 #include "filter.hpp" 2 #include "timer.hpp" 2 3 3 4 namespace xios 4 5 { 6 extern CLogType logProfile ; 5 7 CFilter::CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine) 6 8 : CInputPin(gc, inputSlotsCount) … … 12 14 void CFilter::onInputReady(std::vector<CDataPacketPtr> data) 13 15 { 16 if (info.isActive(logProfile)) CTimer::get("Applying filters").resume() ; 14 17 CDataPacketPtr outputPacket = engine->apply(data); 18 if (info.isActive(logProfile)) CTimer::get("Applying filters").suspend() ; 15 19 if (outputPacket) 16 20 onOutputReady(outputPacket); -
XIOS3/trunk/src/filter/model_to_client_source_filter.cpp
r2418 r2628 6 6 #include "workflow_graph.hpp" 7 7 #include "mem_checker.hpp" 8 #include "timer.hpp" 8 9 9 10 namespace xios 10 11 { 12 extern CLogType logProfile ; 11 13 CModelToClientSourceFilter::CModelToClientSourceFilter(CGarbageCollector& gc, CGrid* grid, bool hasMissingValue, double defaultValue) 12 14 : COutputPin(gc) … … 37 39 const double nanValue = std::numeric_limits<double>::quiet_NaN(); 38 40 packet->data.resize(connector->getDstSize()) ; 41 if (info.isActive(logProfile)) CTimer::get("Model to client").resume(); 39 42 connector->transfer(data, packet->data, nanValue) ; 43 if (info.isActive(logProfile)) CTimer::get("Model to client").suspend(); 40 44 41 45 CMemChecker::logMem( "CModelToClientSourceFilter::streamData" ); … … 50 54 51 55 buildWorkflowGraph(packet); 56 if (info.isActive(logProfile)) CTimer::get("Client workflow").resume(); 52 57 onOutputReady(packet); 58 if (info.isActive(logProfile)) CTimer::get("Client workflow").suspend(); 53 59 } 54 60 -
XIOS3/trunk/src/filter/server_from_client_source_filter.cpp
r2143 r2628 8 8 namespace xios 9 9 { 10 extern CLogType logProfile ; 10 11 CServerFromClientSourceFilter::CServerFromClientSourceFilter(CGarbageCollector& gc, CGrid* grid) 11 12 : COutputPin(gc) … … 25 26 packet->timestamp = timeStamp; 26 27 packet->status = CDataPacket::NO_ERROR; 28 if (info.isActive(logProfile)) CTimer::get("Server workflow data entry").resume(); 27 29 grid_->getServerFromClientConnector()->transfer(event,packet->data) ; 30 if (info.isActive(logProfile)) CTimer::get("Server workflow data entry").suspend(); 28 31 29 32 if(this->graphEnabled) … … 35 38 CWorkflowGraph::addNode("Server from Client Source filter", 1, false, 0, packet); 36 39 } 40 if (info.isActive(logProfile)) CTimer::get("Server workflow").resume(); 37 41 onOutputReady(packet); 42 if (info.isActive(logProfile)) CTimer::get("Server workflow").suspend(); 38 43 } 39 44 -
XIOS3/trunk/src/filter/server_to_client_store_filter.cpp
r2143 r2628 34 34 } 35 35 36 //if (info.isActive(logProfile)) CTimer::get("Field : send data (read)").resume(); 36 37 if (isEOF) 37 38 { … … 46 47 info(20)<<"Send Data from server to client: FieldId : "<<field_->getId()<<" step : "<<nStep_<<endl; 47 48 } 49 //if (info.isActive(logProfile)) CTimer::get("Field : send data (read)").suspend(); 48 50 49 51 nStep_++ ; -
XIOS3/trunk/src/filter/temporal_filter.cpp
r2418 r2628 4 4 #include "workflow_graph.hpp" 5 5 #include "mem_checker.hpp" 6 #include "timer.hpp" 6 7 7 8 namespace xios 8 9 { 10 extern CLogType logProfile ; 9 11 static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, CArray<double, 1>& tmpData); 10 12 … … 76 78 if (data[0]->status != CDataPacket::END_OF_STREAM) 77 79 { 80 if (info.isActive(logProfile)) CTimer::get("Temporal filters").resume() ; 78 81 bool usePacket, outputResult, copyLess; 79 82 if (isOnceOperation) … … 123 126 graphCycleCompleted = true; 124 127 } 128 if (info.isActive(logProfile)) CTimer::get("Temporal filters").suspend() ; 125 129 } 126 130 -
XIOS3/trunk/src/interface/c/icdata.cpp
r2471 r2628 167 167 { 168 168 CTimer::get("XIOS").resume(); 169 CTimer::get("XIOS solve inheritance").resume(); 169 170 CContext* context = CContext::getCurrent(); 170 171 context->solveAllInheritance(false); 172 CTimer::get("XIOS solve inheritance").suspend(); 171 173 CTimer::get("XIOS").suspend(); 172 174 } -
XIOS3/trunk/src/io/nc4_data_input.cpp
r2507 r2628 10 10 namespace xios 11 11 { 12 extern CLogType logProfile ; 12 13 CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, 13 14 bool readMetaDataPar /*= false*/, bool ugridConvention /*= false*/, const StdString& timeCounterName /*= "time_counter"*/) … … 57 58 { 58 59 case MULTI_FILE: 60 if (info.isActive(logProfile)) CTimer::get("Files : reading data").resume(); 59 61 SuperClassWriter::getData(dataOut, fieldId, isCollective, record ); 62 if (info.isActive(logProfile)) CTimer::get("Files : reading data").suspend(); 60 63 break; 61 64 case ONE_FILE: … … 106 109 } 107 110 111 if (info.isActive(logProfile)) CTimer::get("Files : reading data").resume(); 108 112 SuperClassWriter::getData(dataOut, fieldId, isCollective, record, &start, &count); 113 if (info.isActive(logProfile)) CTimer::get("Files : reading data").suspend(); 109 114 break; 110 115 } -
XIOS3/trunk/src/io/nc4_data_output.cpp
r2617 r2628 21 21 namespace xios 22 22 { 23 extern CLogType logProfile ; 23 24 /// ////////////////////// Dfinitions ////////////////////// /// 24 25 CNc4DataOutput::CNc4DataOutput … … 2277 2278 case (MULTI_FILE) : 2278 2279 { 2279 CTimer::get("Files : writing data").resume();2280 if (info.isActive(logProfile)) CTimer::get("Files : writing data").resume(); 2280 2281 writeAndConvertData(field, data, nstep - 1); 2281 CTimer::get("Files : writing data").suspend();2282 if (info.isActive(logProfile)) CTimer::get("Files : writing data").suspend(); 2282 2283 if (wtime) 2283 2284 { 2284 CTimer::get("Files : writing time axis").resume();2285 if (info.isActive(logProfile)) CTimer::get("Files : writing time axis").resume(); 2285 2286 if ( wtimeData) 2286 2287 { … … 2293 2294 if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, nstep - 1, isRoot); 2294 2295 } 2295 CTimer::get("Files : writing time axis").suspend();2296 if (info.isActive(logProfile)) CTimer::get("Files : writing time axis").suspend(); 2296 2297 } 2297 2298 break; … … 2441 2442 2442 2443 2443 CTimer::get("Files : writing data").resume();2444 if (info.isActive(logProfile)) CTimer::get("Files : writing data").resume(); 2444 2445 writeAndConvertData(field, data, nstep - 1, &start, &count); 2445 CTimer::get("Files : writing data").suspend();2446 if (info.isActive(logProfile)) CTimer::get("Files : writing data").suspend(); 2446 2447 2447 2448 if (wtime) 2448 2449 { 2449 CTimer::get("Files : writing time axis").resume();2450 if (info.isActive(logProfile)) CTimer::get("Files : writing time axis").resume(); 2450 2451 if ( wtimeData) 2451 2452 { … … 2459 2460 2460 2461 } 2461 CTimer::get("Files : writing time axis").suspend();2462 if (info.isActive(logProfile)) CTimer::get("Files : writing time axis").suspend(); 2462 2463 } 2463 2464 -
XIOS3/trunk/src/io/onetcdf4.cpp
r2613 r2628 13 13 namespace xios 14 14 { 15 extern CLogType logProfile ; 15 16 /// ////////////////////// Définitions ////////////////////// /// 16 17 … … 58 59 if (!append || !std::ifstream(filename.c_str())) 59 60 { 60 CTimer::get("Files : create").resume();61 if (info.isActive(logProfile)) CTimer::get("Files : create").resume(); 61 62 if (wmpi) 62 63 CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 63 64 else 64 65 CNetCdfInterface::create(filename, mode, this->ncidp); 65 CTimer::get("Files : create").suspend();66 if (info.isActive(logProfile)) CTimer::get("Files : create").suspend(); 66 67 67 68 this->appendMode = false; … … 70 71 { 71 72 mode |= NC_WRITE; 72 CTimer::get("Files : open").resume();73 if (info.isActive(logProfile)) CTimer::get("Files : open").resume(); 73 74 if (wmpi) 74 75 CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 75 76 else 76 77 CNetCdfInterface::open(filename, mode, this->ncidp); 77 CTimer::get("Files : open").suspend();78 if (info.isActive(logProfile)) CTimer::get("Files : open").suspend(); 78 79 this->appendMode = true; 79 80 } … … 89 90 void CONetCDF4::close() 90 91 { 91 CTimer::get("Files : close").resume();92 if (info.isActive(logProfile)) CTimer::get("Files : close").resume(); 92 93 CNetCdfInterface::close(this->ncidp); 93 CTimer::get("Files : close").suspend();94 if (info.isActive(logProfile)) CTimer::get("Files : close").suspend(); 94 95 } 95 96 -
XIOS3/trunk/src/log_type.cpp
r2341 r2628 5 5 { 6 6 using namespace std ; 7 CLogType logProtocol("log_protocol") ; 8 CLogType logTimers("log_timers") ; 9 CLogType logProfile("log_profile") ; 7 10 8 11 int CLogType::globalBitPos_ = 0 ; -
XIOS3/trunk/src/manager/contexts_manager.cpp
r2613 r2628 14 14 { 15 15 using namespace std ; 16 extern CLogType logTimers ; 16 17 17 18 CContextsManager::CContextsManager(bool isXiosServer) … … 153 154 void CContextsManager::eventLoop(void) 154 155 { 155 CTimer::get("CContextsManager::eventLoop").resume();156 if (info.isActive(logTimers)) CTimer::get("CContextsManager::eventLoop").resume(); 156 157 int flag ; 157 158 MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); … … 162 163 lastEventLoop_=time ; 163 164 } 164 CTimer::get("CContextsManager::eventLoop").suspend();165 if (info.isActive(logTimers)) CTimer::get("CContextsManager::eventLoop").suspend(); 165 166 } 166 167 -
XIOS3/trunk/src/manager/pool_ressource.cpp
r2589 r2628 12 12 namespace xios 13 13 { 14 extern CLogType logTimers ; 15 14 16 CPoolRessource::CPoolRessource(MPI_Comm poolComm, shared_ptr<CEventScheduler> eventScheduler, const std::string& Id, bool isServer) : Id_(Id), finalizeSignal_(false) 15 17 { … … 237 239 bool CPoolRessource::eventLoop(bool serviceOnly) 238 240 { 239 CTimer::get("CPoolRessource::eventLoop").resume();241 if (info.isActive(logTimers)) CTimer::get("CPoolRessource::eventLoop").resume(); 240 242 241 243 double time=MPI_Wtime() ; … … 259 261 } 260 262 } 261 CTimer::get("CPoolRessource::eventLoop").suspend();263 if (info.isActive(logTimers)) CTimer::get("CPoolRessource::eventLoop").suspend(); 262 264 if (services_.empty() && finalizeSignal_) finished_=true ; 263 265 return finished_ ; … … 266 268 void CPoolRessource::threadEventLoop(void) 267 269 { 268 CTimer::get("CPoolRessource::eventLoop").resume();270 if (info.isActive(logTimers)) CTimer::get("CPoolRessource::eventLoop").resume(); 269 271 info(100)<<"Launch Thread for CPoolRessource::threadEventLoop, pool id = "<<Id_<<endl ; 270 272 CThreadManager::threadInitialize() ; … … 294 296 } 295 297 296 CTimer::get("CPoolRessource::eventLoop").suspend();297 298 if (services_.empty() && finalizeSignal_) finished_=true ; 298 299 … … 302 303 303 304 CThreadManager::threadFinalize() ; 305 if (info.isActive(logTimers)) CTimer::get("CPoolRessource::eventLoop").suspend(); 304 306 info(100)<<"Close thread for CPoolRessource::threadEventLoop, pool id = "<<Id_<<endl ; 305 307 } -
XIOS3/trunk/src/manager/ressources_manager.cpp
r2580 r2628 12 12 { 13 13 using namespace std; 14 extern CLogType logTimers ; 14 15 15 16 CRessourcesManager::CRessourcesManager(bool isXiosServer) … … 112 113 void CRessourcesManager::eventLoop(void) 113 114 { 114 CTimer::get("CRessourcesManager::eventLoop").resume();115 if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::eventLoop").resume(); 115 116 int flag ; 116 117 MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); … … 122 123 } 123 124 124 CTimer::get("CRessourcesManager::eventLoop").suspend();125 if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::eventLoop").suspend(); 125 126 } 126 127 … … 129 130 int commRank ; 130 131 MPI_Comm_rank(xiosComm_, &commRank) ; 131 CTimer::get("CRessourcesManager::checkNotifications lock").resume();132 if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::checkNotifications lock").resume(); 132 133 winNotify_->lockWindowExclusive(commRank) ; 133 CTimer::get("CRessourcesManager::checkNotifications lock").suspend();134 CTimer::get("CRessourcesManager::checkNotifications pop").resume();134 if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::checkNotifications lock").suspend(); 135 if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::checkNotifications pop").resume(); 135 136 winNotify_->popFromLockedWindow(commRank, this, &CRessourcesManager::notificationsDumpIn) ; 136 CTimer::get("CRessourcesManager::checkNotifications pop").suspend();137 CTimer::get("CRessourcesManager::checkNotifications unlock").resume();137 if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::checkNotifications pop").suspend(); 138 if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::checkNotifications unlock").resume(); 138 139 winNotify_->unlockWindowExclusive(commRank) ; 139 CTimer::get("CRessourcesManager::checkNotifications unlock").suspend();140 if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::checkNotifications unlock").suspend(); 140 141 if (notifyType_==NOTIFY_CREATE_POOL) createPool() ; 141 142 else if (notifyType_==NOTIFY_FINALIZE) finalizeSignal() ; -
XIOS3/trunk/src/manager/server_context.cpp
r2589 r2628 13 13 { 14 14 using namespace std ; 15 extern CLogType logTimers ; 15 16 16 17 map<string, tuple<bool,MPI_Comm,MPI_Comm> > CServerContext::overlapedComm_ ; … … 233 234 bool CServerContext::eventLoop(bool serviceOnly) 234 235 { 235 CTimer::get("CServerContext::eventLoop").resume();236 if (info.isActive(logTimers)) CTimer::get("CServerContext::eventLoop").resume(); 236 237 bool finished=false ; 237 238 int flag ; … … 256 257 } 257 258 } 258 CTimer::get("CServerContext::eventLoop").suspend();259 if (info.isActive(logTimers)) CTimer::get("CServerContext::eventLoop").suspend(); 259 260 if (context_==nullptr && finalizeSignal_) finished=true ; 260 261 return finished ; … … 264 265 { 265 266 267 if (info.isActive(logTimers)) CTimer::get("CServerContext::eventLoop").resume(); 266 268 info(100)<<"Launch Thread for CServerContext::threadEventLoop, context id = "<<context_->getId()<<endl ; 267 269 CThreadManager::threadInitialize() ; 268 270 do 269 271 { 270 CTimer::get("CServerContext::eventLoop").resume();271 272 int flag ; 272 273 MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); … … 285 286 } 286 287 } 287 CTimer::get("CServerContext::eventLoop").suspend();288 288 if (context_==nullptr && finalizeSignal_) finished_=true ; 289 289 … … 294 294 CThreadManager::threadFinalize() ; 295 295 info(100)<<"Close thread for CServerContext::threadEventLoop"<<endl ; 296 if (info.isActive(logTimers)) CTimer::get("CServerContext::eventLoop").suspend(); 296 297 } 297 298 -
XIOS3/trunk/src/manager/servers_ressource.cpp
r2604 r2628 18 18 { 19 19 using namespace std ; 20 extern CLogType logTimers ; 20 21 21 22 CServersRessource::CServersRessource(MPI_Comm serverComm) : poolRessource_(nullptr), finalizeSignal_(false) … … 122 123 bool CServersRessource::eventLoop(bool serviceOnly) 123 124 { 124 CTimer::get("CServersRessource::eventLoop").resume();125 if (info.isActive(logTimers)) CTimer::get("CServersRessource::eventLoop").resume(); 125 126 double time=MPI_Wtime() ; 126 127 int flag ; … … 143 144 } 144 145 } 145 CTimer::get("CServersRessource::eventLoop").suspend();146 if (info.isActive(logTimers)) CTimer::get("CServersRessource::eventLoop").suspend(); 146 147 if (poolRessource_==nullptr && finalizeSignal_) finished_=true ; 147 148 return finished_ ; … … 150 151 void CServersRessource::threadEventLoop(void) 151 152 { 152 CTimer::get("CServersRessource::eventLoop").resume();153 if (info.isActive(logTimers)) CTimer::get("CServersRessource::eventLoop").resume(); 153 154 info(100)<<"Launch Thread for CServersRessource::threadEventLoop"<<endl ; 154 155 CThreadManager::threadInitialize() ; … … 175 176 } 176 177 } 177 CTimer::get("CServersRessource::eventLoop").suspend();178 178 if (poolRessource_==nullptr && finalizeSignal_) finished_=true ; 179 179 if (!finished_) CThreadManager::yield() ; … … 182 182 183 183 CThreadManager::threadFinalize() ; 184 if (info.isActive(logTimers)) CTimer::get("CServersRessource::eventLoop").suspend(); 184 185 info(100)<<"Close thread for CServersRessource::threadEventLoop"<<endl ; ; 185 186 } -
XIOS3/trunk/src/manager/services.cpp
r2589 r2628 10 10 namespace xios 11 11 { 12 extern CLogType logTimers ; 13 12 14 CService::CService(MPI_Comm serviceComm, shared_ptr<CEventScheduler> eventScheduler, const std::string& poolId, const std::string& serviceId, const int& partitionId, 13 15 int type, int nbPartitions) … … 115 117 { 116 118 //checkCreateContextNotification() ; 117 CTimer::get("CService::eventLoop").resume();119 if (info.isActive(logTimers)) CTimer::get("CService::eventLoop").resume(); 118 120 int flag ; 119 121 MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); … … 140 142 } 141 143 142 CTimer::get("CService::eventLoop").suspend();144 if (info.isActive(logTimers)) CTimer::get("CService::eventLoop").suspend(); 143 145 if (contexts_.empty() && finalizeSignal_) return true ; 144 146 else return false ; … … 147 149 void CService::threadEventLoop(void) 148 150 { 151 if (info.isActive(logTimers)) CTimer::get("CService::eventLoop").resume(); 149 152 info(100)<<"Launch Thread for CService::threadEventLoop, service id = "<<name_<<endl ; 150 153 CThreadManager::threadInitialize() ; … … 152 155 do 153 156 { 154 CTimer::get("CService::eventLoop").resume();155 157 int flag ; 156 158 MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); … … 177 179 } 178 180 179 CTimer::get("CService::eventLoop").suspend();180 181 if (contexts_.empty() && finalizeSignal_) finished_=true ; 181 182 if (!finished_) CThreadManager::yield() ; … … 184 185 CThreadManager::threadFinalize() ; 185 186 info(100)<<"Close thread for CService::threadEventLoop, service id = "<<name_<<endl ; 187 if (info.isActive(logTimers)) CTimer::get("CService::eventLoop").suspend(); 186 188 } 187 189 -
XIOS3/trunk/src/manager/services_manager.cpp
r2580 r2628 11 11 namespace xios 12 12 { 13 13 extern CLogType logTimers ; 14 14 15 15 … … 123 123 void CServicesManager::eventLoop(void) 124 124 { 125 CTimer::get("CServicesManager::eventLoop").resume();125 if (info.isActive(logTimers)) CTimer::get("CServicesManager::eventLoop").resume(); 126 126 int flag ; 127 127 MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); … … 132 132 lastEventLoop_=time ; 133 133 } 134 CTimer::get("CServicesManager::eventLoop").suspend();134 if (info.isActive(logTimers)) CTimer::get("CServicesManager::eventLoop").suspend(); 135 135 } 136 136 -
XIOS3/trunk/src/node/context.cpp
r2614 r2628 42 42 43 43 std::shared_ptr<CContextGroup> CContext::root; 44 extern CLogType logProfile ; 44 45 45 46 /// ////////////////////// Définitions ////////////////////// /// … … 818 819 bool finished(true); 819 820 if (isLockedContext()) enableEventsProcessing=false; 821 else if (info.isActive(logProfile)) CTimer::get("Context event loop").resume(); 820 822 821 823 setCurrent(getId()) ; … … 839 841 } 840 842 setCurrent(getId()) ; 843 if (!isLockedContext()) if (info.isActive(logProfile)) CTimer::get("Context event loop").suspend(); 841 844 return finalized && finished ; 842 845 } … … 1113 1116 CMemChecker::logMem( "CContext::closeDefinition" ); 1114 1117 1115 CTimer::get("Context : close definition").resume() ;1118 if (info.isActive(logProfile)) CTimer::get("Context : close definition").resume() ; 1116 1119 1117 1120 onlineContextClient_=CContextClient::getNew<CContextClient::online>(this,intraComm_, intraComm_); … … 1409 1412 1410 1413 1411 CTimer::get("Context : close definition").suspend() ;1414 if (info.isActive(logProfile)) CTimer::get("Context : close definition").suspend() ; 1412 1415 CMemChecker::logMem( "CContext::closeDefinition_END" ); 1413 1416 } -
XIOS3/trunk/src/node/field.cpp
r2544 r2628 28 28 namespace xios 29 29 { 30 extern CLogType logProfile ; 30 31 31 32 /// ////////////////////// Définitions ////////////////////// /// … … 320 321 TRY 321 322 { 323 if (info.isActive(logProfile)) CTimer::get("Check late data (read)").resume(); 322 324 if (hasFileIn()) 323 325 { … … 331 333 clientFromClientSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ; 332 334 } 335 if (info.isActive(logProfile)) CTimer::get("Check late data (read)").suspend(); 333 336 } 334 337 CATCH_DUMP_ATTR -
XIOS3/trunk/src/node/file.cpp
r2589 r2628 21 21 namespace xios { 22 22 23 extern CLogType logProfile ; 23 24 /// ////////////////////// Dfinitions ////////////////////// /// 24 25 … … 329 330 if (mode.isEmpty() || mode.getValue() == mode_attr::write) 330 331 { 331 CTimer::get("Files : create headers").resume();332 if (info.isActive(logProfile)) CTimer::get("Files : create headers").resume(); 332 333 if (!isOpen) createHeader(); 333 CTimer::get("Files : create headers").suspend();334 if (info.isActive(logProfile)) CTimer::get("Files : create headers").suspend(); 334 335 checkSync(); 335 336 } … … 357 358 if (!mode.isEmpty() && mode.getValue() == mode_attr::read) 358 359 { 359 CTimer::get("Files : open headers").resume();360 if (info.isActive(logProfile)) CTimer::get("Files : open headers").resume(); 360 361 361 362 if (!isOpen) openInReadMode(); 362 363 363 CTimer::get("Files : open headers").suspend();364 if (info.isActive(logProfile)) CTimer::get("Files : open headers").suspend(); 364 365 } 365 366 //checkSplit(); // Really need for reading? -
XIOS3/trunk/src/server.cpp
r2591 r2628 52 52 CServersRessource* CServer::serversRessource_=nullptr ; 53 53 CThirdPartyDriver* CServer::driver_ =nullptr ; 54 54 extern CLogType logTimers ; 55 55 56 56 void CServer::initialize(void) … … 622 622 report(0)<<"Performance report : Time spent in processing events : "<<CTimer::get("Process events").getCumulatedTime()<<endl ; 623 623 report(0)<<"Performance report : Ratio : "<<CTimer::get("Process events").getCumulatedTime()/CTimer::get("XIOS server").getCumulatedTime()*100.<<"%"<<endl ; 624 report(100)<<CTimer::getAllCumulatedTime()<<endl ; 624 625 if (info.isActive(logProfile)) 626 { 627 printProfile(); 628 } 629 630 if (info.isActive(logTimers)) report(0)<<"\n"<<CTimer::getAllCumulatedTime()<<endl ; 625 631 if (CXios::reportMemory) 626 632 { … … 630 636 CWorkflowGraph::drawWorkFlowGraph_server(); 631 637 xios::releaseStaticAllocation() ; // free memory from static allocation 638 } 639 640 void CServer::printProfile() 641 { 642 list< pair<string,int> > timer_name; 643 timer_name.push_back({"XIOS server",0}); 644 timer_name.push_back({"XIOS initialize",0}); 645 timer_name.push_back({"XIOS event loop",0}); 646 //timer_name.push_back({"Recv event loop (p2p)",1}); // timer concerned by yield and thread (if reader embedded) 647 //timer_name.push_back({"Recv event loop (legacy)",1}); // timer concerned by yield and thread 648 timer_name.push_back({"Process events",2}); 649 timer_name.push_back({"Context : close definition",3}); 650 timer_name.push_back({"Reader workflow data entry",3}); 651 timer_name.push_back({"Files : reading data",4}); 652 //timer_name.push_back({"Field : send data (read)",4}); // timer concerned by yield and thread 653 timer_name.push_back({"Server workflow data entry",3}); 654 timer_name.push_back({"Server workflow",3}); 655 timer_name.push_back({"Applying filters",4}); 656 timer_name.push_back({"Transformation transfers",5}); 657 timer_name.push_back({"Transformation MPI",6}); 658 timer_name.push_back({"Temporal filters",5}); 659 timer_name.push_back({"Field : send data",4}); 660 //timer_name.push_back({"Scatter event",5}); // timer concerned by yield and thread 661 //timer_name.push_back({"Blocking time",6}); // timer concerned by yield and thread 662 timer_name.push_back({"Files : create headers",4}); 663 timer_name.push_back({"Files : writing data",4}); 664 timer_name.push_back({"Context finalize",3}); // timer concerned by yield and thread 665 timer_name.push_back({"Files : close",4}); 666 667 report(0)<< endl; 668 double total_time = CTimer::get("Process events").getCumulatedTime(); 669 for(auto it_timer_name = timer_name.begin(); it_timer_name != timer_name.end(); it_timer_name++) 670 { 671 double timer_time = CTimer::get(it_timer_name->first).getCumulatedTime(); 672 if ( timer_time / total_time > 0.001 ) 673 { 674 ostringstream printed_line; 675 printed_line << setprecision(3) << std::fixed; 676 for(int itab=0;itab<it_timer_name->second;itab++) 677 printed_line << " "; 678 printed_line << it_timer_name->first << " : " << timer_time <<endl; 679 string string_line = printed_line.str(); 680 report(0)<< string_line; 681 } 682 } 632 683 } 633 684 -
XIOS3/trunk/src/server.hpp
r2523 r2628 46 46 47 47 static void finalize(void); 48 static void printProfile(void); 48 49 static void eventLoop(void); 49 50 -
XIOS3/trunk/src/transformation/grid_algorithm_generic.cpp
r2291 r2628 6 6 #include "context.hpp" 7 7 #include "transform_filter.hpp" 8 #include "timer.hpp" 8 9 9 10 namespace xios 10 11 { 12 extern CLogType logProfile ; 11 13 12 14 CGridAlgorithmGeneric::CGridAlgorithmGeneric(CGrid* gridSrc, CGrid* gridDst, int pos, shared_ptr<CGenericAlgorithmTransformation> algo) … … 54 56 { 55 57 CArray<double,1> dataOutTmp ; 58 if (info.isActive(logProfile)) CTimer::get("Transformation transfers").resume() ; 56 59 gridTransformConnector_->transfer(dataIn, dataOutTmp) ; 60 if (info.isActive(logProfile)) CTimer::get("Transformation transfers").suspend() ; 57 61 algorithm_->apply(dimBefore_, dimAfter_, dataOutTmp, dataOut) ; 58 62 } -
XIOS3/trunk/src/transport/legacy_context_client.cpp
r2592 r2628 20 20 namespace xios 21 21 { 22 extern CLogType logTimers ; 23 22 24 /*! 23 25 \param [in] parent Pointer to context on client side … … 218 220 // create windows dynamically for one-sided 219 221 /* 220 CTimer::get("create Windows").resume() ;222 if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 221 223 MPI_Comm interComm ; 222 224 int tag = 0 ; … … 241 243 if (flag) 242 244 { 243 CTimer::get("create Windows").resume() ;245 if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 244 246 MPI_Comm interComm ; 245 247 int tag = 0 ; -
XIOS3/trunk/src/transport/legacy_context_server.cpp
r2595 r2628 30 30 { 31 31 using namespace std ; 32 extern CLogType logTimers ; 33 extern CLogType logProfile ; 32 34 33 35 CLegacyContextServer::CLegacyContextServer(CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_) … … 70 72 bool CLegacyContextServer::eventLoop(bool enableEventsProcessing /*= true*/) 71 73 { 72 CTimer::get("listen request").resume(); 74 if (info.isActive(logProfile)) CTimer::get("Recv event loop (legacy)").resume(); 75 if (info.isActive(logTimers)) CTimer::get("listen request").resume(); 73 76 listen(); 74 CTimer::get("listen request").suspend();75 CTimer::get("check pending request").resume();77 if (info.isActive(logTimers)) CTimer::get("listen request").suspend(); 78 if (info.isActive(logTimers)) CTimer::get("check pending request").resume(); 76 79 checkPendingRequest(); 77 80 checkPendingProbe() ; 78 CTimer::get("check pending request").suspend();79 CTimer::get("check event process").resume();81 if (info.isActive(logTimers)) CTimer::get("check pending request").suspend(); 82 if (info.isActive(logTimers)) CTimer::get("check event process").resume(); 80 83 processEvents(enableEventsProcessing); 81 CTimer::get("check event process").suspend(); 84 if (info.isActive(logTimers)) CTimer::get("check event process").suspend(); 85 if (info.isActive(logProfile)) CTimer::get("Recv event loop (legacy)").suspend(); 82 86 return finished; 83 87 } … … 121 125 int dummy ; 122 126 MPI_Send(&dummy, 0, MPI_INT, rank, 21,interCommMerged_) ; 123 CTimer::get("create Windows").resume() ;127 if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 124 128 MPI_Comm interComm ; 125 129 int tag = 0 ; … … 138 142 windows_[rank][0] -> setWinBufferAddress(winBufferAddress[0],0) ; 139 143 windows_[rank][1] -> setWinBufferAddress(winBufferAddress[1],0) ; 140 CTimer::get("create Windows").suspend() ;144 if (info.isActive(logTimers)) CTimer::get("create Windows").suspend() ; 141 145 CXios::getMpiGarbageCollector().registerCommunicator(winComm_[rank]) ; 142 146 MPI_Barrier(winComm_[rank]) ; … … 200 204 MPI_Status status; 201 205 202 if (!pendingRequest.empty()) CTimer::get("receiving requests").resume();203 else CTimer::get("receiving requests").suspend();206 if (!pendingRequest.empty()) if (info.isActive(logTimers)) CTimer::get("receiving requests").resume(); 207 else if (info.isActive(logTimers)) CTimer::get("receiving requests").suspend(); 204 208 205 209 for(it=pendingRequest.begin();it!=pendingRequest.end();it++) … … 227 231 void CLegacyContextServer::getBufferFromClient(size_t timeLine) 228 232 { 229 CTimer::get("CLegacyContextServer::getBufferFromClient").resume() ;233 if (info.isActive(logTimers)) CTimer::get("CLegacyContextServer::getBufferFromClient").resume() ; 230 234 231 235 int rank ; … … 244 248 } 245 249 } 246 CTimer::get("CLegacyContextServer::getBufferFromClient").suspend() ;250 if (info.isActive(logTimers)) CTimer::get("CLegacyContextServer::getBufferFromClient").suspend() ; 247 251 } 248 252 … … 423 427 if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE) 424 428 { 429 if (info.isActive(logProfile)) CTimer::get("Context finalize").resume(); 425 430 finished=true; 426 431 info(20)<<" CLegacyContextServer: Receive context <"<<context->getId()<<"> finalize."<<endl; 427 432 notifyClientsFinalize() ; 428 CTimer::get("receiving requests").suspend();433 if (info.isActive(logTimers)) CTimer::get("receiving requests").suspend(); 429 434 context->finalize(); 430 435 … … 439 444 } 440 445 report(0)<< " Memory report : Context <"<<ctxId<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl; 446 if (info.isActive(logProfile)) CTimer::get("Context finalize").suspend(); 441 447 } 442 448 else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event); -
XIOS3/trunk/src/transport/one_sided_client_buffer.cpp
r2589 r2628 7 7 8 8 extern CLogType logProtocol; 9 extern CLogType logTimers ; 9 10 10 11 COneSidedClientBuffer::COneSidedClientBuffer(MPI_Comm& interComm, int serverRank, MPI_Comm& commSelf, MPI_Comm& interCommMerged, int intraServerRank) : interComm_(interComm), serverRank_(serverRank), interCommMerged_(interCommMerged), intraServerRank_(intraServerRank) … … 20 21 void COneSidedClientBuffer::createWindow(MPI_Comm& commSelf, MPI_Comm& interCommMerged, int intraServerRank ) 21 22 { 22 CTimer::get("create Windows").resume() ;23 if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 23 24 MPI_Comm interComm ; 24 25 xios::MPI_Intercomm_create(commSelf, 0, interCommMerged, intraServerRank, 0, &interComm) ; … … 46 47 MPI_Win_attach(winControl_, control_, controlSize_*sizeof(MPI_Aint)) ; 47 48 MPI_Barrier(winComm_) ; 48 CTimer::get("create Windows").suspend() ;49 if (info.isActive(logTimers)) CTimer::get("create Windows").suspend() ; 49 50 50 51 // MPI_Win_lock(MPI_LOCK_EXCLUSIVE, 0, 0, winControl_) ; -
XIOS3/trunk/src/transport/one_sided_context_server.cpp
r2595 r2628 30 30 { 31 31 using namespace std ; 32 extern CLogType logTimers ; 33 extern CLogType logProfile ; 32 34 33 35 COneSidedContextServer::COneSidedContextServer(CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_) … … 71 73 bool COneSidedContextServer::eventLoop(bool enableEventsProcessing /*= true*/) 72 74 { 73 CTimer::get("listen request").resume();75 if (info.isActive(logTimers)) CTimer::get("listen request").resume(); 74 76 listen(); 75 CTimer::get("listen request").suspend();76 77 CTimer::get("listen pending request").resume();77 if (info.isActive(logTimers)) CTimer::get("listen request").suspend(); 78 79 if (info.isActive(logTimers)) CTimer::get("listen pending request").resume(); 78 80 listenPendingRequest() ; 79 CTimer::get("listen pending request").suspend();80 81 CTimer::get("check server Buffers").resume();81 if (info.isActive(logTimers)) CTimer::get("listen pending request").suspend(); 82 83 if (info.isActive(logTimers)) CTimer::get("check server Buffers").resume(); 82 84 checkBuffers() ; 83 CTimer::get("check server Buffers").suspend();84 85 CTimer::get("check event process").resume();85 if (info.isActive(logTimers)) CTimer::get("check server Buffers").suspend(); 86 87 if (info.isActive(logTimers)) CTimer::get("check event process").resume(); 86 88 processEvents(enableEventsProcessing); 87 CTimer::get("check event process").suspend();89 if (info.isActive(logTimers)) CTimer::get("check event process").suspend(); 88 90 return finished; 89 91 … … 265 267 if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE) 266 268 { 269 if (info.isActive(logProfile)) CTimer::get("Context finalize").resume(); 267 270 finished=true; 268 271 info(20)<<" COneSidedContextServer: Receive context <"<<context->getId()<<"> finalize."<<endl; 269 272 notifyClientsFinalize() ; 270 CTimer::get("receiving requests").suspend();273 if (info.isActive(logTimers)) CTimer::get("receiving requests").suspend(); 271 274 context->finalize(); 272 275 … … 281 284 } 282 285 report(0)<< " Memory report : Context <"<<ctxId<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl; 286 if (info.isActive(logProfile)) CTimer::get("Context finalize").suspend(); 283 287 } 284 288 else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event); -
XIOS3/trunk/src/transport/one_sided_server_buffer.cpp
r2589 r2628 9 9 namespace xios 10 10 { 11 CLogType logProtocol("log_protocol") ; 11 extern CLogType logProtocol ; 12 extern CLogType logTimers ; 12 13 13 14 COneSidedServerBuffer::COneSidedServerBuffer(int clientRank, const MPI_Comm& commSelf, const MPI_Comm& interCommMerged, map<size_t, SPendingEvent>& pendingEvents, … … 23 24 void COneSidedServerBuffer::createWindow(const MPI_Comm& commSelf, const MPI_Comm& interCommMerged) 24 25 { 25 CTimer::get("create Windows").resume() ;26 if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 26 27 MPI_Comm interComm ; 27 28 xios::MPI_Intercomm_create(commSelf, 0, interCommMerged, clientRank_, 0 , &interComm) ; … … 40 41 MPI_Win_create_dynamic(MPI_INFO_NULL, winComm_, &winControl_); 41 42 CXios::getMpiGarbageCollector().registerWindow(winControl_) ; 42 CTimer::get("create Windows").suspend() ;43 if (info.isActive(logTimers)) CTimer::get("create Windows").suspend() ; 43 44 MPI_Barrier(winComm_) ; 44 45 MPI_Barrier(winComm_) ; -
XIOS3/trunk/src/transport/p2p_client_buffer.cpp
r2607 r2628 7 7 8 8 extern CLogType logProtocol; 9 extern CLogType logTimers ; 9 10 10 11 CP2pClientBuffer::CP2pClientBuffer(MPI_Comm& interComm, int serverRank, MPI_Comm& commSelf, MPI_Comm& interCommMerged, int intraServerRank) : interComm_(interComm), serverRank_(serverRank), interCommMerged_(interCommMerged), intraServerRank_(intraServerRank) … … 22 23 void CP2pClientBuffer::createWindow(MPI_Comm& commSelf, MPI_Comm& interCommMerged, int intraServerRank ) 23 24 { 24 CTimer::get("create Windows").resume() ;25 if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 25 26 //MPI_Comm interComm ; 26 27 //xios::MPI_Intercomm_create(commSelf, 0, interCommMerged, intraServerRank, 0, &interComm) ; … … 49 50 //MPI_Win_attach(winControl_, control_, controlSize_*sizeof(MPI_Aint)) ; 50 51 //MPI_Barrier(winComm_) ; 51 CTimer::get("create Windows").suspend() ;52 if (info.isActive(logTimers)) CTimer::get("create Windows").suspend() ; 52 53 53 54 // MPI_Win_lock(MPI_LOCK_EXCLUSIVE, 0, 0, winControl_) ; -
XIOS3/trunk/src/transport/p2p_context_server.cpp
r2595 r2628 30 30 { 31 31 using namespace std ; 32 extern CLogType logTimers ; 33 extern CLogType logProfile ; 32 34 33 35 CP2pContextServer::CP2pContextServer(CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_) … … 71 73 bool CP2pContextServer::eventLoop(bool enableEventsProcessing /*= true*/) 72 74 { 73 CTimer::get("listen request").resume(); 75 if (info.isActive(logProfile)) CTimer::get("Recv event loop (p2p)").resume(); 76 if (info.isActive(logTimers)) CTimer::get("listen request").resume(); 74 77 listen(); 75 CTimer::get("listen request").suspend();76 77 CTimer::get("listen pending request").resume();78 if (info.isActive(logTimers)) CTimer::get("listen request").suspend(); 79 80 if (info.isActive(logTimers)) CTimer::get("listen pending request").resume(); 78 81 listenPendingRequest() ; 79 CTimer::get("listen pending request").suspend();80 81 CTimer::get("check server Buffers").resume();82 if (info.isActive(logTimers)) CTimer::get("listen pending request").suspend(); 83 84 if (info.isActive(logTimers)) CTimer::get("check server Buffers").resume(); 82 85 checkBuffers() ; 83 CTimer::get("check server Buffers").suspend();84 85 CTimer::get("check event process").resume();86 if (info.isActive(logTimers)) CTimer::get("check server Buffers").suspend(); 87 88 if (info.isActive(logTimers)) CTimer::get("check event process").resume(); 86 89 processEvents(enableEventsProcessing); 87 CTimer::get("check event process").suspend(); 90 if (info.isActive(logTimers)) CTimer::get("check event process").suspend(); 91 if (info.isActive(logProfile)) CTimer::get("Recv event loop (p2p)").suspend(); 88 92 return finished; 89 93 … … 269 273 if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE) 270 274 { 275 CTimer::get("Context finalize").resume(); 271 276 finished=true; 272 277 info(20)<<" CP2pContextServer: Receive context <"<<context->getId()<<"> finalize."<<endl; 273 278 notifyClientsFinalize() ; 274 CTimer::get("receiving requests").suspend();279 if (info.isActive(logTimers)) CTimer::get("receiving requests").suspend(); 275 280 context->finalize(); 276 281 … … 285 290 } 286 291 report(0)<< " Memory report : Context <"<<ctxId<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl; 292 CTimer::get("Context finalize").suspend(); 287 293 } 288 294 else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event); -
XIOS3/trunk/src/transport/p2p_server_buffer.cpp
r2594 r2628 10 10 { 11 11 extern CLogType logProtocol ; 12 extern CLogType logTimers ; 12 13 13 14 CP2pServerBuffer::CP2pServerBuffer(int clientRank, const MPI_Comm& commSelf, const MPI_Comm& interCommMerged, map<size_t, SPendingEvent>& pendingEvents, … … 24 25 void CP2pServerBuffer::createWindow(const MPI_Comm& commSelf, const MPI_Comm& interCommMerged) 25 26 { 26 CTimer::get("create Windows").resume() ;27 if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 27 28 //MPI_Comm interComm ; 28 29 //xios::MPI_Intercomm_create(commSelf, 0, interCommMerged, clientRank_, 0 , &interComm) ; … … 41 42 //MPI_Win_create_dynamic(MPI_INFO_NULL, winComm_, &winControl_); 42 43 //CXios::getMpiGarbageCollector().registerWindow(winControl_) ; 43 CTimer::get("create Windows").suspend() ;44 if (info.isActive(logTimers)) CTimer::get("create Windows").suspend() ; 44 45 //MPI_Barrier(winComm_) ; 45 46 //MPI_Barrier(winComm_) ;
Note: See TracChangeset
for help on using the changeset viewer.