Changeset 2628 for XIOS3


Ignore:
Timestamp:
04/03/24 10:33:55 (6 months ago)
Author:
jderouillat
Message:

New timers integration/reporting

Location:
XIOS3/trunk/src
Files:
37 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/client.cpp

    r2627 r2628  
    3636    StdOFStream CClient::m_errorStream; 
    3737    CPoolRessource* CClient::poolRessource_=nullptr ; 
     38    extern CLogType logTimers ; 
    3839 
    3940    MPI_Comm& CClient::getInterComm(void)   { return (interComm_); } 
     
    543544      report(0)<< " Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 
    544545      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 ; 
    546553      if (CXios::reportMemory) 
    547554      { 
     
    552559      xios::releaseStaticAllocation() ; 
    553560 
     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      } 
    554603    } 
    555604     
  • XIOS3/trunk/src/client.hpp

    r2332 r2628  
    1515        static void xiosGlobalCommByPublishing(MPI_Comm clientComm, const string& codeId) ; 
    1616        static void finalize(void); 
     17        static void printProfile(void); 
    1718        static void registerContext(const string& id, MPI_Comm contextComm); 
    1819        static void registerContext_old(const string& id, MPI_Comm contextComm); 
  • XIOS3/trunk/src/distribution/grid_scatterer_connector.hpp

    r2267 r2628  
    1010#include "context_client.hpp" 
    1111#include "scatterer_connector.hpp" 
    12  
     12#include "timer.hpp" 
    1313 
    1414namespace xios 
    1515{ 
     16  extern CLogType logProfile ; 
    1617  
    1718  class CGridScattererConnector 
     
    7879          event.push(rank, nbSenders_[rank], messages.back()); 
    7980        } 
     81        if (info.isActive(logProfile)) CTimer::get("Scatter event").resume(); 
    8082        client->sendEvent(event) ; 
     83        if (info.isActive(logProfile)) CTimer::get("Scatter event").suspend(); 
    8184      }  
    8285       
  • XIOS3/trunk/src/distribution/grid_transform_connector.hpp

    r2291 r2628  
    1010#include "reduction_types.hpp" 
    1111#include "mpi.hpp" 
     12#include "timer.hpp" 
    1213 
    1314namespace xios 
    1415{ 
    1516  
    16    
     17  extern CLogType logProfile ; 
     18 
    1719  class CGridTransformConnector 
    1820  { 
     
    4143        map<int,CArray<T,1>> tmpArrayIn ; 
    4244        gridScattererConnector_->transfer(dataIn, tmpArrayIn) ; 
     45        if (info.isActive(logProfile)) CTimer::get("Transformation MPI").resume(); 
    4346        vector<MPI_Request> requests ; 
    4447        MPI_Request request ; 
     
    6164        vector<MPI_Status> status(requests.size()) ; 
    6265        MPI_Waitall(requests.size(), requests.data(),status.data()) ; 
     66        if (info.isActive(logProfile)) CTimer::get("Transformation MPI").suspend(); 
    6367         
    6468        const double nanValue = std::numeric_limits<double>::quiet_NaN(); 
  • XIOS3/trunk/src/filter/client_to_server_store_filter.cpp

    r2143 r2628  
    1111namespace xios 
    1212{ 
     13  extern CLogType logProfile ; 
    1314  CClientToServerStoreFilter::CClientToServerStoreFilter(CGarbageCollector& gc, CField* field, CContextClient* client) 
    1415    : CInputPin(gc, 1) 
     
    2425    buildWorkflowGraph(data); 
    2526 
    26     CTimer::get("Field : send data").resume(); 
     27    if (info.isActive(logProfile)) CTimer::get("Field : send data").resume(); 
    2728    CEventClient event(field_->getType(), CField::EVENT_ID_UPDATE_DATA); 
    2829    CMessage message ; 
    2930    message<<field_->getId() << data[0]->timestamp ; 
    3031    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(); 
    3233  } 
    3334 
  • XIOS3/trunk/src/filter/file_reader_source_filter.cpp

    r2267 r2628  
    1111namespace xios 
    1212{ 
     13  extern CLogType logProfile ; 
    1314  CFileReaderSourceFilter::CFileReaderSourceFilter(CGarbageCollector& gc, CField* field) 
    1415    : COutputPin(gc) 
     
    2425  void CFileReaderSourceFilter::streamData() 
    2526  { 
     27    if (info.isActive(logProfile)) CTimer::get("Reader workflow data entry").resume(); 
    2628    Time timeStamp ; 
    2729    CDataPacketPtr packet(new CDataPacket); 
     
    5153      CWorkflowGraph::addNode("File Reader Source filter", 1, false, 0, packet); 
    5254    } 
     55    if (info.isActive(logProfile)) CTimer::get("Reader workflow data entry").suspend(); 
    5356            
    5457    onOutputReady(packet); 
  • XIOS3/trunk/src/filter/filter.cpp

    r1358 r2628  
    11#include "filter.hpp" 
     2#include "timer.hpp" 
    23 
    34namespace xios 
    45{ 
     6  extern CLogType logProfile ; 
    57  CFilter::CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine) 
    68    : CInputPin(gc, inputSlotsCount) 
     
    1214  void CFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    1315  { 
     16    if (info.isActive(logProfile)) CTimer::get("Applying filters").resume() ; 
    1417    CDataPacketPtr outputPacket = engine->apply(data); 
     18    if (info.isActive(logProfile)) CTimer::get("Applying filters").suspend() ; 
    1519    if (outputPacket) 
    1620      onOutputReady(outputPacket); 
  • XIOS3/trunk/src/filter/model_to_client_source_filter.cpp

    r2418 r2628  
    66#include "workflow_graph.hpp" 
    77#include "mem_checker.hpp" 
     8#include "timer.hpp" 
    89 
    910namespace xios 
    1011{ 
     12  extern CLogType logProfile ; 
    1113  CModelToClientSourceFilter::CModelToClientSourceFilter(CGarbageCollector& gc, CGrid* grid, bool hasMissingValue, double defaultValue) 
    1214    : COutputPin(gc) 
     
    3739    const double nanValue = std::numeric_limits<double>::quiet_NaN(); 
    3840    packet->data.resize(connector->getDstSize()) ; 
     41    if (info.isActive(logProfile)) CTimer::get("Model to client").resume(); 
    3942    connector->transfer(data, packet->data, nanValue) ; 
     43    if (info.isActive(logProfile)) CTimer::get("Model to client").suspend(); 
    4044 
    4145    CMemChecker::logMem( "CModelToClientSourceFilter::streamData" ); 
     
    5054     
    5155    buildWorkflowGraph(packet); 
     56    if (info.isActive(logProfile)) CTimer::get("Client workflow").resume(); 
    5257    onOutputReady(packet); 
     58    if (info.isActive(logProfile)) CTimer::get("Client workflow").suspend(); 
    5359  } 
    5460   
  • XIOS3/trunk/src/filter/server_from_client_source_filter.cpp

    r2143 r2628  
    88namespace xios 
    99{ 
     10  extern CLogType logProfile ; 
    1011  CServerFromClientSourceFilter::CServerFromClientSourceFilter(CGarbageCollector& gc, CGrid* grid) 
    1112    : COutputPin(gc) 
     
    2526    packet->timestamp = timeStamp; 
    2627    packet->status = CDataPacket::NO_ERROR; 
     28    if (info.isActive(logProfile)) CTimer::get("Server workflow data entry").resume(); 
    2729    grid_->getServerFromClientConnector()->transfer(event,packet->data) ; 
     30    if (info.isActive(logProfile)) CTimer::get("Server workflow data entry").suspend(); 
    2831 
    2932    if(this->graphEnabled) 
     
    3538      CWorkflowGraph::addNode("Server from Client Source filter", 1, false, 0, packet); 
    3639    } 
     40    if (info.isActive(logProfile)) CTimer::get("Server workflow").resume(); 
    3741    onOutputReady(packet); 
     42    if (info.isActive(logProfile)) CTimer::get("Server workflow").suspend(); 
    3843  } 
    3944 
  • XIOS3/trunk/src/filter/server_to_client_store_filter.cpp

    r2143 r2628  
    3434    } 
    3535 
     36    //if (info.isActive(logProfile)) CTimer::get("Field : send data (read)").resume(); 
    3637    if (isEOF)  
    3738    { 
     
    4647      info(20)<<"Send Data from server to client: FieldId : "<<field_->getId()<<"  step : "<<nStep_<<endl;  
    4748    } 
     49    //if (info.isActive(logProfile)) CTimer::get("Field : send data (read)").suspend(); 
    4850 
    4951    nStep_++ ; 
  • XIOS3/trunk/src/filter/temporal_filter.cpp

    r2418 r2628  
    44#include "workflow_graph.hpp" 
    55#include "mem_checker.hpp" 
     6#include "timer.hpp" 
    67 
    78namespace xios 
    89{ 
     10  extern CLogType logProfile ; 
    911  static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, CArray<double, 1>& tmpData); 
    1012 
     
    7678    if (data[0]->status != CDataPacket::END_OF_STREAM) 
    7779    { 
     80      if (info.isActive(logProfile)) CTimer::get("Temporal filters").resume() ; 
    7881      bool usePacket, outputResult, copyLess; 
    7982      if (isOnceOperation) 
     
    123126        graphCycleCompleted = true; 
    124127     } 
     128     if (info.isActive(logProfile)) CTimer::get("Temporal filters").suspend() ; 
    125129    } 
    126130 
  • XIOS3/trunk/src/interface/c/icdata.cpp

    r2471 r2628  
    167167   { 
    168168     CTimer::get("XIOS").resume(); 
     169     CTimer::get("XIOS solve inheritance").resume(); 
    169170     CContext* context = CContext::getCurrent(); 
    170171     context->solveAllInheritance(false); 
     172     CTimer::get("XIOS solve inheritance").suspend(); 
    171173     CTimer::get("XIOS").suspend(); 
    172174   } 
  • XIOS3/trunk/src/io/nc4_data_input.cpp

    r2507 r2628  
    1010namespace xios 
    1111{ 
     12  extern CLogType logProfile ; 
    1213  CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, 
    1314                               bool readMetaDataPar /*= false*/, bool ugridConvention /*= false*/, const StdString& timeCounterName /*= "time_counter"*/) 
     
    5758    { 
    5859      case MULTI_FILE: 
     60        if (info.isActive(logProfile)) CTimer::get("Files : reading data").resume(); 
    5961        SuperClassWriter::getData(dataOut, fieldId, isCollective, record ); 
     62        if (info.isActive(logProfile)) CTimer::get("Files : reading data").suspend(); 
    6063        break; 
    6164      case ONE_FILE: 
     
    106109        } 
    107110 
     111        if (info.isActive(logProfile)) CTimer::get("Files : reading data").resume(); 
    108112        SuperClassWriter::getData(dataOut, fieldId, isCollective, record, &start, &count); 
     113        if (info.isActive(logProfile)) CTimer::get("Files : reading data").suspend(); 
    109114        break; 
    110115      } 
  • XIOS3/trunk/src/io/nc4_data_output.cpp

    r2617 r2628  
    2121namespace xios 
    2222{ 
     23      extern CLogType logProfile ; 
    2324      /// ////////////////////// Dfinitions ////////////////////// /// 
    2425      CNc4DataOutput::CNc4DataOutput 
     
    22772278              case (MULTI_FILE) : 
    22782279              { 
    2279                  CTimer::get("Files : writing data").resume(); 
     2280                 if (info.isActive(logProfile)) CTimer::get("Files : writing data").resume(); 
    22802281                 writeAndConvertData(field, data, nstep - 1); 
    2281                  CTimer::get("Files : writing data").suspend(); 
     2282                 if (info.isActive(logProfile)) CTimer::get("Files : writing data").suspend(); 
    22822283                 if (wtime) 
    22832284                 { 
    2284                    CTimer::get("Files : writing time axis").resume(); 
     2285                   if (info.isActive(logProfile)) CTimer::get("Files : writing time axis").resume(); 
    22852286                   if ( wtimeData) 
    22862287                   { 
     
    22932294                     if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, nstep - 1, isRoot); 
    22942295                   } 
    2295                    CTimer::get("Files : writing time axis").suspend(); 
     2296                   if (info.isActive(logProfile)) CTimer::get("Files : writing time axis").suspend(); 
    22962297                 } 
    22972298                 break; 
     
    24412442 
    24422443 
    2443                 CTimer::get("Files : writing data").resume(); 
     2444                if (info.isActive(logProfile)) CTimer::get("Files : writing data").resume(); 
    24442445                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(); 
    24462447 
    24472448                 if (wtime) 
    24482449                 { 
    2449                    CTimer::get("Files : writing time axis").resume(); 
     2450                   if (info.isActive(logProfile)) CTimer::get("Files : writing time axis").resume(); 
    24502451                   if ( wtimeData) 
    24512452                   { 
     
    24592460 
    24602461                   } 
    2461                    CTimer::get("Files : writing time axis").suspend();   
     2462                   if (info.isActive(logProfile)) CTimer::get("Files : writing time axis").suspend();   
    24622463                 } 
    24632464 
  • XIOS3/trunk/src/io/onetcdf4.cpp

    r2613 r2628  
    1313namespace xios 
    1414{ 
     15      extern CLogType logProfile ; 
    1516      /// ////////////////////// Définitions ////////////////////// /// 
    1617 
     
    5859         if (!append || !std::ifstream(filename.c_str())) 
    5960         { 
    60             CTimer::get("Files : create").resume(); 
     61            if (info.isActive(logProfile)) CTimer::get("Files : create").resume(); 
    6162            if (wmpi) 
    6263               CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 
    6364            else 
    6465               CNetCdfInterface::create(filename, mode, this->ncidp); 
    65             CTimer::get("Files : create").suspend(); 
     66            if (info.isActive(logProfile)) CTimer::get("Files : create").suspend(); 
    6667  
    6768            this->appendMode = false; 
     
    7071         { 
    7172            mode |= NC_WRITE; 
    72             CTimer::get("Files : open").resume(); 
     73            if (info.isActive(logProfile)) CTimer::get("Files : open").resume(); 
    7374            if (wmpi) 
    7475               CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 
    7576            else 
    7677               CNetCdfInterface::open(filename, mode, this->ncidp); 
    77             CTimer::get("Files : open").suspend(); 
     78            if (info.isActive(logProfile)) CTimer::get("Files : open").suspend(); 
    7879            this->appendMode = true; 
    7980         } 
     
    8990      void CONetCDF4::close() 
    9091      { 
    91         CTimer::get("Files : close").resume(); 
     92        if (info.isActive(logProfile)) CTimer::get("Files : close").resume(); 
    9293        CNetCdfInterface::close(this->ncidp); 
    93         CTimer::get("Files : close").suspend(); 
     94        if (info.isActive(logProfile)) CTimer::get("Files : close").suspend(); 
    9495      } 
    9596 
  • XIOS3/trunk/src/log_type.cpp

    r2341 r2628  
    55{ 
    66  using namespace std ; 
     7  CLogType logProtocol("log_protocol") ; 
     8  CLogType logTimers("log_timers") ; 
     9  CLogType logProfile("log_profile") ; 
    710   
    811  int CLogType::globalBitPos_ = 0 ; 
  • XIOS3/trunk/src/manager/contexts_manager.cpp

    r2613 r2628  
    1414{ 
    1515  using namespace std ; 
     16  extern CLogType logTimers ; 
    1617 
    1718  CContextsManager::CContextsManager(bool isXiosServer) 
     
    153154  void CContextsManager::eventLoop(void) 
    154155  { 
    155     CTimer::get("CContextsManager::eventLoop").resume(); 
     156    if (info.isActive(logTimers)) CTimer::get("CContextsManager::eventLoop").resume(); 
    156157    int flag ; 
    157158    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
     
    162163      lastEventLoop_=time ; 
    163164    } 
    164     CTimer::get("CContextsManager::eventLoop").suspend(); 
     165    if (info.isActive(logTimers)) CTimer::get("CContextsManager::eventLoop").suspend(); 
    165166  } 
    166167   
  • XIOS3/trunk/src/manager/pool_ressource.cpp

    r2589 r2628  
    1212namespace xios 
    1313{ 
     14  extern CLogType logTimers ; 
     15   
    1416  CPoolRessource::CPoolRessource(MPI_Comm poolComm, shared_ptr<CEventScheduler> eventScheduler, const std::string& Id, bool isServer) : Id_(Id), finalizeSignal_(false) 
    1517  { 
     
    237239  bool CPoolRessource::eventLoop(bool serviceOnly) 
    238240  { 
    239     CTimer::get("CPoolRessource::eventLoop").resume(); 
     241    if (info.isActive(logTimers)) CTimer::get("CPoolRessource::eventLoop").resume(); 
    240242    
    241243    double time=MPI_Wtime() ; 
     
    259261      } 
    260262    } 
    261     CTimer::get("CPoolRessource::eventLoop").suspend(); 
     263    if (info.isActive(logTimers)) CTimer::get("CPoolRessource::eventLoop").suspend(); 
    262264    if (services_.empty() && finalizeSignal_) finished_=true ; 
    263265    return finished_ ; 
     
    266268  void CPoolRessource::threadEventLoop(void) 
    267269  { 
    268     CTimer::get("CPoolRessource::eventLoop").resume(); 
     270    if (info.isActive(logTimers)) CTimer::get("CPoolRessource::eventLoop").resume(); 
    269271    info(100)<<"Launch Thread for  CPoolRessource::threadEventLoop, pool id = "<<Id_<<endl ; 
    270272    CThreadManager::threadInitialize() ;  
     
    294296      } 
    295297 
    296       CTimer::get("CPoolRessource::eventLoop").suspend(); 
    297298      if (services_.empty() && finalizeSignal_) finished_=true ; 
    298299       
     
    302303 
    303304    CThreadManager::threadFinalize() ; 
     305    if (info.isActive(logTimers)) CTimer::get("CPoolRessource::eventLoop").suspend(); 
    304306    info(100)<<"Close thread for  CPoolRessource::threadEventLoop, pool id = "<<Id_<<endl ; 
    305307  } 
  • XIOS3/trunk/src/manager/ressources_manager.cpp

    r2580 r2628  
    1212{ 
    1313  using namespace std; 
     14  extern CLogType logTimers ; 
    1415 
    1516  CRessourcesManager::CRessourcesManager(bool isXiosServer)  
     
    112113  void CRessourcesManager::eventLoop(void) 
    113114  { 
    114     CTimer::get("CRessourcesManager::eventLoop").resume(); 
     115    if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::eventLoop").resume(); 
    115116    int flag ; 
    116117    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
     
    122123    } 
    123124 
    124     CTimer::get("CRessourcesManager::eventLoop").suspend(); 
     125    if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::eventLoop").suspend(); 
    125126  } 
    126127   
     
    129130    int commRank ; 
    130131    MPI_Comm_rank(xiosComm_, &commRank) ; 
    131     CTimer::get("CRessourcesManager::checkNotifications lock").resume(); 
     132    if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::checkNotifications lock").resume(); 
    132133    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(); 
    135136    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(); 
    138139    winNotify_->unlockWindowExclusive(commRank) ; 
    139     CTimer::get("CRessourcesManager::checkNotifications unlock").suspend(); 
     140    if (info.isActive(logTimers)) CTimer::get("CRessourcesManager::checkNotifications unlock").suspend(); 
    140141    if (notifyType_==NOTIFY_CREATE_POOL) createPool() ; 
    141142    else if (notifyType_==NOTIFY_FINALIZE) finalizeSignal() ; 
  • XIOS3/trunk/src/manager/server_context.cpp

    r2589 r2628  
    1313{ 
    1414  using namespace std ; 
     15  extern CLogType logTimers ; 
    1516 
    1617  map<string, tuple<bool,MPI_Comm,MPI_Comm> > CServerContext::overlapedComm_ ; 
     
    233234  bool CServerContext::eventLoop(bool serviceOnly) 
    234235  { 
    235     CTimer::get("CServerContext::eventLoop").resume(); 
     236    if (info.isActive(logTimers)) CTimer::get("CServerContext::eventLoop").resume(); 
    236237    bool finished=false ; 
    237238    int flag ; 
     
    256257      } 
    257258    } 
    258     CTimer::get("CServerContext::eventLoop").suspend(); 
     259    if (info.isActive(logTimers)) CTimer::get("CServerContext::eventLoop").suspend(); 
    259260    if (context_==nullptr && finalizeSignal_) finished=true ; 
    260261    return finished ; 
     
    264265  { 
    265266     
     267    if (info.isActive(logTimers)) CTimer::get("CServerContext::eventLoop").resume(); 
    266268    info(100)<<"Launch Thread for CServerContext::threadEventLoop, context id = "<<context_->getId()<<endl ; 
    267269    CThreadManager::threadInitialize() ;  
    268270    do 
    269271    { 
    270       CTimer::get("CServerContext::eventLoop").resume(); 
    271272      int flag ; 
    272273      MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
     
    285286        } 
    286287      } 
    287       CTimer::get("CServerContext::eventLoop").suspend(); 
    288288      if (context_==nullptr && finalizeSignal_) finished_=true ; 
    289289  
     
    294294    CThreadManager::threadFinalize() ; 
    295295    info(100)<<"Close thread for CServerContext::threadEventLoop"<<endl ; 
     296    if (info.isActive(logTimers)) CTimer::get("CServerContext::eventLoop").suspend(); 
    296297  } 
    297298 
  • XIOS3/trunk/src/manager/servers_ressource.cpp

    r2604 r2628  
    1818{ 
    1919  using namespace std ; 
     20  extern CLogType logTimers ; 
    2021 
    2122  CServersRessource::CServersRessource(MPI_Comm serverComm) : poolRessource_(nullptr), finalizeSignal_(false) 
     
    122123  bool CServersRessource::eventLoop(bool serviceOnly) 
    123124  { 
    124     CTimer::get("CServersRessource::eventLoop").resume(); 
     125    if (info.isActive(logTimers)) CTimer::get("CServersRessource::eventLoop").resume(); 
    125126    double time=MPI_Wtime() ; 
    126127    int flag ; 
     
    143144      }  
    144145    } 
    145     CTimer::get("CServersRessource::eventLoop").suspend(); 
     146    if (info.isActive(logTimers)) CTimer::get("CServersRessource::eventLoop").suspend(); 
    146147    if (poolRessource_==nullptr && finalizeSignal_) finished_=true ; 
    147148    return finished_ ; 
     
    150151  void CServersRessource::threadEventLoop(void) 
    151152  { 
    152     CTimer::get("CServersRessource::eventLoop").resume(); 
     153    if (info.isActive(logTimers)) CTimer::get("CServersRessource::eventLoop").resume(); 
    153154    info(100)<<"Launch Thread for  CServersRessource::threadEventLoop"<<endl ; 
    154155    CThreadManager::threadInitialize() ;  
     
    175176        }  
    176177      } 
    177       CTimer::get("CServersRessource::eventLoop").suspend(); 
    178178      if (poolRessource_==nullptr && finalizeSignal_) finished_=true ; 
    179179      if (!finished_) CThreadManager::yield() ; 
     
    182182 
    183183    CThreadManager::threadFinalize() ; 
     184    if (info.isActive(logTimers)) CTimer::get("CServersRessource::eventLoop").suspend(); 
    184185    info(100)<<"Close thread for CServersRessource::threadEventLoop"<<endl ; ; 
    185186  } 
  • XIOS3/trunk/src/manager/services.cpp

    r2589 r2628  
    1010namespace xios 
    1111{ 
     12  extern CLogType logTimers ; 
     13 
    1214  CService::CService(MPI_Comm serviceComm, shared_ptr<CEventScheduler> eventScheduler, const std::string& poolId, const std::string& serviceId, const int& partitionId,  
    1315                     int type, int nbPartitions)  
     
    115117  { 
    116118    //checkCreateContextNotification() ; 
    117     CTimer::get("CService::eventLoop").resume(); 
     119    if (info.isActive(logTimers)) CTimer::get("CService::eventLoop").resume(); 
    118120    int flag ; 
    119121    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
     
    140142    } 
    141143   
    142     CTimer::get("CService::eventLoop").suspend(); 
     144    if (info.isActive(logTimers)) CTimer::get("CService::eventLoop").suspend(); 
    143145    if (contexts_.empty() && finalizeSignal_) return true ; 
    144146    else return false ; 
     
    147149  void CService::threadEventLoop(void) 
    148150  { 
     151    if (info.isActive(logTimers)) CTimer::get("CService::eventLoop").resume(); 
    149152    info(100)<<"Launch Thread for  CService::threadEventLoop, service id = "<<name_<<endl ; 
    150153    CThreadManager::threadInitialize() ;  
     
    152155    do 
    153156    { 
    154       CTimer::get("CService::eventLoop").resume(); 
    155157      int flag ; 
    156158      MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
     
    177179      } 
    178180 
    179       CTimer::get("CService::eventLoop").suspend(); 
    180181      if (contexts_.empty() && finalizeSignal_) finished_=true ; 
    181182      if (!finished_) CThreadManager::yield() ; 
     
    184185    CThreadManager::threadFinalize() ; 
    185186    info(100)<<"Close thread for  CService::threadEventLoop, service id = "<<name_<<endl ; 
     187    if (info.isActive(logTimers)) CTimer::get("CService::eventLoop").suspend(); 
    186188  } 
    187189 
  • XIOS3/trunk/src/manager/services_manager.cpp

    r2580 r2628  
    1111namespace xios 
    1212{ 
    13  
     13  extern CLogType logTimers ; 
    1414   
    1515 
     
    123123  void CServicesManager::eventLoop(void) 
    124124  { 
    125     CTimer::get("CServicesManager::eventLoop").resume(); 
     125    if (info.isActive(logTimers)) CTimer::get("CServicesManager::eventLoop").resume(); 
    126126    int flag ; 
    127127    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
     
    132132      lastEventLoop_=time ; 
    133133    } 
    134     CTimer::get("CServicesManager::eventLoop").suspend(); 
     134    if (info.isActive(logTimers)) CTimer::get("CServicesManager::eventLoop").suspend(); 
    135135  } 
    136136 
  • XIOS3/trunk/src/node/context.cpp

    r2614 r2628  
    4242 
    4343  std::shared_ptr<CContextGroup> CContext::root; 
     44  extern CLogType logProfile ; 
    4445 
    4546   /// ////////////////////// Définitions ////////////////////// /// 
     
    818819    bool  finished(true);  
    819820    if (isLockedContext()) enableEventsProcessing=false; 
     821    else if (info.isActive(logProfile)) CTimer::get("Context event loop").resume(); 
    820822     
    821823    setCurrent(getId()) ; 
     
    839841    } 
    840842    setCurrent(getId()) ; 
     843    if (!isLockedContext()) if (info.isActive(logProfile)) CTimer::get("Context event loop").suspend(); 
    841844    return finalized && finished ; 
    842845  } 
     
    11131116     CMemChecker::logMem( "CContext::closeDefinition" ); 
    11141117 
    1115      CTimer::get("Context : close definition").resume() ; 
     1118     if (info.isActive(logProfile)) CTimer::get("Context : close definition").resume() ; 
    11161119 
    11171120     onlineContextClient_=CContextClient::getNew<CContextClient::online>(this,intraComm_, intraComm_); 
     
    14091412 
    14101413 
    1411      CTimer::get("Context : close definition").suspend() ; 
     1414     if (info.isActive(logProfile)) CTimer::get("Context : close definition").suspend() ; 
    14121415     CMemChecker::logMem( "CContext::closeDefinition_END" ); 
    14131416  } 
  • XIOS3/trunk/src/node/field.cpp

    r2544 r2628  
    2828namespace xios 
    2929{ 
     30  extern CLogType logProfile ; 
    3031 
    3132  /// ////////////////////// Définitions ////////////////////// /// 
     
    320321  TRY 
    321322  { 
     323    if (info.isActive(logProfile)) CTimer::get("Check late data (read)").resume(); 
    322324    if (hasFileIn())  
    323325    { 
     
    331333      clientFromClientSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ; 
    332334    } 
     335    if (info.isActive(logProfile)) CTimer::get("Check late data (read)").suspend(); 
    333336  } 
    334337  CATCH_DUMP_ATTR 
  • XIOS3/trunk/src/node/file.cpp

    r2589 r2628  
    2121namespace xios { 
    2222 
     23   extern CLogType logProfile ; 
    2324   /// ////////////////////// Dfinitions ////////////////////// /// 
    2425 
     
    329330      if (mode.isEmpty() || mode.getValue() == mode_attr::write) 
    330331      { 
    331         CTimer::get("Files : create headers").resume(); 
     332        if (info.isActive(logProfile)) CTimer::get("Files : create headers").resume(); 
    332333        if (!isOpen) createHeader(); 
    333         CTimer::get("Files : create headers").suspend(); 
     334        if (info.isActive(logProfile)) CTimer::get("Files : create headers").suspend(); 
    334335        checkSync(); 
    335336      }         
     
    357358        if (!mode.isEmpty() && mode.getValue() == mode_attr::read) 
    358359        { 
    359           CTimer::get("Files : open headers").resume(); 
     360          if (info.isActive(logProfile)) CTimer::get("Files : open headers").resume(); 
    360361           
    361362          if (!isOpen) openInReadMode(); 
    362363 
    363           CTimer::get("Files : open headers").suspend(); 
     364          if (info.isActive(logProfile)) CTimer::get("Files : open headers").suspend(); 
    364365        } 
    365366        //checkSplit(); // Really need for reading? 
  • XIOS3/trunk/src/server.cpp

    r2591 r2628  
    5252    CServersRessource* CServer::serversRessource_=nullptr ; 
    5353    CThirdPartyDriver* CServer::driver_ =nullptr ; 
    54  
     54    extern CLogType logTimers ; 
    5555        
    5656    void CServer::initialize(void) 
     
    622622      report(0)<<"Performance report : Time spent in processing events : "<<CTimer::get("Process events").getCumulatedTime()<<endl  ; 
    623623      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 ; 
    625631      if (CXios::reportMemory) 
    626632      { 
     
    630636      CWorkflowGraph::drawWorkFlowGraph_server(); 
    631637      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      } 
    632683    } 
    633684 
  • XIOS3/trunk/src/server.hpp

    r2523 r2628  
    4646         
    4747        static void finalize(void); 
     48        static void printProfile(void); 
    4849        static void eventLoop(void); 
    4950         
  • XIOS3/trunk/src/transformation/grid_algorithm_generic.cpp

    r2291 r2628  
    66#include "context.hpp" 
    77#include "transform_filter.hpp" 
     8#include "timer.hpp" 
    89 
    910namespace xios 
    1011{ 
     12  extern CLogType logProfile ; 
    1113 
    1214  CGridAlgorithmGeneric::CGridAlgorithmGeneric(CGrid* gridSrc, CGrid* gridDst, int pos,  shared_ptr<CGenericAlgorithmTransformation> algo) 
     
    5456  { 
    5557    CArray<double,1> dataOutTmp ; 
     58    if (info.isActive(logProfile)) CTimer::get("Transformation transfers").resume() ; 
    5659    gridTransformConnector_->transfer(dataIn, dataOutTmp) ; 
     60    if (info.isActive(logProfile)) CTimer::get("Transformation transfers").suspend() ; 
    5761    algorithm_->apply(dimBefore_, dimAfter_, dataOutTmp, dataOut) ; 
    5862  } 
  • XIOS3/trunk/src/transport/legacy_context_client.cpp

    r2592 r2628  
    2020namespace xios 
    2121{ 
     22    extern CLogType logTimers ; 
     23   
    2224    /*! 
    2325    \param [in] parent Pointer to context on client side 
     
    218220           // create windows dynamically for one-sided 
    219221          /* 
    220           CTimer::get("create Windows").resume() ; 
     222          if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 
    221223          MPI_Comm interComm ; 
    222224          int tag = 0 ; 
     
    241243          if (flag) 
    242244          { 
    243             CTimer::get("create Windows").resume() ; 
     245            if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 
    244246            MPI_Comm interComm ; 
    245247            int tag = 0 ; 
  • XIOS3/trunk/src/transport/legacy_context_server.cpp

    r2595 r2628  
    3030{ 
    3131  using namespace std ; 
     32  extern CLogType logTimers ; 
     33  extern CLogType logProfile ; 
    3234 
    3335  CLegacyContextServer::CLegacyContextServer(CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_)  
     
    7072  bool CLegacyContextServer::eventLoop(bool enableEventsProcessing /*= true*/) 
    7173  { 
    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(); 
    7376    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(); 
    7679    checkPendingRequest(); 
    7780    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(); 
    8083    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(); 
    8286    return finished; 
    8387  } 
     
    121125      int dummy ; 
    122126      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() ; 
    124128      MPI_Comm interComm ; 
    125129      int tag = 0 ; 
     
    138142      windows_[rank][0] -> setWinBufferAddress(winBufferAddress[0],0) ; 
    139143      windows_[rank][1] -> setWinBufferAddress(winBufferAddress[1],0) ; 
    140       CTimer::get("create Windows").suspend() ; 
     144      if (info.isActive(logTimers)) CTimer::get("create Windows").suspend() ; 
    141145      CXios::getMpiGarbageCollector().registerCommunicator(winComm_[rank]) ; 
    142146      MPI_Barrier(winComm_[rank]) ; 
     
    200204    MPI_Status status; 
    201205    
    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(); 
    204208 
    205209    for(it=pendingRequest.begin();it!=pendingRequest.end();it++) 
     
    227231  void CLegacyContextServer::getBufferFromClient(size_t timeLine) 
    228232  { 
    229     CTimer::get("CLegacyContextServer::getBufferFromClient").resume() ; 
     233    if (info.isActive(logTimers)) CTimer::get("CLegacyContextServer::getBufferFromClient").resume() ; 
    230234 
    231235    int rank ; 
     
    244248      } 
    245249    } 
    246     CTimer::get("CLegacyContextServer::getBufferFromClient").suspend() ; 
     250    if (info.isActive(logTimers)) CTimer::get("CLegacyContextServer::getBufferFromClient").suspend() ; 
    247251  } 
    248252          
     
    423427    if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE) 
    424428    { 
     429      if (info.isActive(logProfile)) CTimer::get("Context finalize").resume(); 
    425430      finished=true; 
    426431      info(20)<<" CLegacyContextServer: Receive context <"<<context->getId()<<"> finalize."<<endl; 
    427432      notifyClientsFinalize() ; 
    428       CTimer::get("receiving requests").suspend(); 
     433      if (info.isActive(logTimers)) CTimer::get("receiving requests").suspend(); 
    429434      context->finalize(); 
    430435       
     
    439444      } 
    440445      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(); 
    441447    } 
    442448    else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event); 
  • XIOS3/trunk/src/transport/one_sided_client_buffer.cpp

    r2589 r2628  
    77   
    88  extern CLogType logProtocol; 
     9  extern CLogType logTimers ; 
    910 
    1011  COneSidedClientBuffer::COneSidedClientBuffer(MPI_Comm& interComm, int serverRank, MPI_Comm& commSelf, MPI_Comm& interCommMerged, int intraServerRank) : interComm_(interComm), serverRank_(serverRank), interCommMerged_(interCommMerged), intraServerRank_(intraServerRank) 
     
    2021  void COneSidedClientBuffer::createWindow(MPI_Comm& commSelf, MPI_Comm& interCommMerged, int intraServerRank ) 
    2122  { 
    22     CTimer::get("create Windows").resume() ; 
     23    if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 
    2324    MPI_Comm interComm ; 
    2425    xios::MPI_Intercomm_create(commSelf, 0, interCommMerged, intraServerRank, 0, &interComm) ; 
     
    4647    MPI_Win_attach(winControl_, control_, controlSize_*sizeof(MPI_Aint)) ; 
    4748    MPI_Barrier(winComm_) ; 
    48     CTimer::get("create Windows").suspend() ; 
     49    if (info.isActive(logTimers)) CTimer::get("create Windows").suspend() ; 
    4950  
    5051 //   MPI_Win_lock(MPI_LOCK_EXCLUSIVE, 0, 0, winControl_) ; 
  • XIOS3/trunk/src/transport/one_sided_context_server.cpp

    r2595 r2628  
    3030{ 
    3131  using namespace std ; 
     32  extern CLogType logTimers ; 
     33  extern CLogType logProfile ; 
    3234 
    3335  COneSidedContextServer::COneSidedContextServer(CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_) 
     
    7173  bool COneSidedContextServer::eventLoop(bool enableEventsProcessing /*= true*/) 
    7274  { 
    73     CTimer::get("listen request").resume(); 
     75    if (info.isActive(logTimers)) CTimer::get("listen request").resume(); 
    7476    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(); 
    7880    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(); 
    8284    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(); 
    8688    processEvents(enableEventsProcessing); 
    87     CTimer::get("check event process").suspend(); 
     89    if (info.isActive(logTimers)) CTimer::get("check event process").suspend(); 
    8890    return finished; 
    8991 
     
    265267    if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE) 
    266268    { 
     269      if (info.isActive(logProfile)) CTimer::get("Context finalize").resume(); 
    267270      finished=true; 
    268271      info(20)<<" COneSidedContextServer: Receive context <"<<context->getId()<<"> finalize."<<endl; 
    269272      notifyClientsFinalize() ; 
    270       CTimer::get("receiving requests").suspend(); 
     273      if (info.isActive(logTimers)) CTimer::get("receiving requests").suspend(); 
    271274      context->finalize(); 
    272275       
     
    281284      } 
    282285      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(); 
    283287    } 
    284288    else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event); 
  • XIOS3/trunk/src/transport/one_sided_server_buffer.cpp

    r2589 r2628  
    99namespace xios 
    1010{ 
    11   CLogType logProtocol("log_protocol") ; 
     11  extern CLogType logProtocol ; 
     12  extern CLogType logTimers ; 
    1213 
    1314  COneSidedServerBuffer::COneSidedServerBuffer(int clientRank, const MPI_Comm& commSelf, const MPI_Comm& interCommMerged, map<size_t, SPendingEvent>& pendingEvents,  
     
    2324  void COneSidedServerBuffer::createWindow(const MPI_Comm& commSelf, const MPI_Comm& interCommMerged) 
    2425  { 
    25     CTimer::get("create Windows").resume() ; 
     26    if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 
    2627    MPI_Comm interComm ; 
    2728    xios::MPI_Intercomm_create(commSelf, 0, interCommMerged, clientRank_, 0 , &interComm) ; 
     
    4041    MPI_Win_create_dynamic(MPI_INFO_NULL, winComm_, &winControl_); 
    4142    CXios::getMpiGarbageCollector().registerWindow(winControl_) ; 
    42     CTimer::get("create Windows").suspend() ; 
     43    if (info.isActive(logTimers)) CTimer::get("create Windows").suspend() ; 
    4344    MPI_Barrier(winComm_) ; 
    4445    MPI_Barrier(winComm_) ; 
  • XIOS3/trunk/src/transport/p2p_client_buffer.cpp

    r2607 r2628  
    77   
    88  extern CLogType logProtocol; 
     9  extern CLogType logTimers ; 
    910 
    1011  CP2pClientBuffer::CP2pClientBuffer(MPI_Comm& interComm, int serverRank, MPI_Comm& commSelf, MPI_Comm& interCommMerged, int intraServerRank) : interComm_(interComm), serverRank_(serverRank), interCommMerged_(interCommMerged), intraServerRank_(intraServerRank) 
     
    2223  void CP2pClientBuffer::createWindow(MPI_Comm& commSelf, MPI_Comm& interCommMerged, int intraServerRank ) 
    2324  { 
    24     CTimer::get("create Windows").resume() ; 
     25    if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 
    2526    //MPI_Comm interComm ; 
    2627    //xios::MPI_Intercomm_create(commSelf, 0, interCommMerged, intraServerRank, 0, &interComm) ; 
     
    4950    //MPI_Win_attach(winControl_, control_, controlSize_*sizeof(MPI_Aint)) ; 
    5051    //MPI_Barrier(winComm_) ; 
    51     CTimer::get("create Windows").suspend() ; 
     52    if (info.isActive(logTimers)) CTimer::get("create Windows").suspend() ; 
    5253  
    5354 //   MPI_Win_lock(MPI_LOCK_EXCLUSIVE, 0, 0, winControl_) ; 
  • XIOS3/trunk/src/transport/p2p_context_server.cpp

    r2595 r2628  
    3030{ 
    3131  using namespace std ; 
     32  extern CLogType logTimers ; 
     33  extern CLogType logProfile ; 
    3234 
    3335  CP2pContextServer::CP2pContextServer(CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_) 
     
    7173  bool CP2pContextServer::eventLoop(bool enableEventsProcessing /*= true*/) 
    7274  { 
    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(); 
    7477    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(); 
    7881    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(); 
    8285    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(); 
    8689    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(); 
    8892    return finished; 
    8993 
     
    269273    if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE) 
    270274    { 
     275      CTimer::get("Context finalize").resume(); 
    271276      finished=true; 
    272277      info(20)<<" CP2pContextServer: Receive context <"<<context->getId()<<"> finalize."<<endl; 
    273278      notifyClientsFinalize() ; 
    274       CTimer::get("receiving requests").suspend(); 
     279      if (info.isActive(logTimers)) CTimer::get("receiving requests").suspend(); 
    275280      context->finalize(); 
    276281       
     
    285290      } 
    286291      report(0)<< " Memory report : Context <"<<ctxId<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl; 
     292      CTimer::get("Context finalize").suspend(); 
    287293    } 
    288294    else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event); 
  • XIOS3/trunk/src/transport/p2p_server_buffer.cpp

    r2594 r2628  
    1010{ 
    1111  extern CLogType logProtocol ; 
     12  extern CLogType logTimers ; 
    1213 
    1314  CP2pServerBuffer::CP2pServerBuffer(int clientRank, const MPI_Comm& commSelf, const MPI_Comm& interCommMerged, map<size_t, SPendingEvent>& pendingEvents,  
     
    2425  void CP2pServerBuffer::createWindow(const MPI_Comm& commSelf, const MPI_Comm& interCommMerged) 
    2526  { 
    26     CTimer::get("create Windows").resume() ; 
     27    if (info.isActive(logTimers)) CTimer::get("create Windows").resume() ; 
    2728    //MPI_Comm interComm ; 
    2829    //xios::MPI_Intercomm_create(commSelf, 0, interCommMerged, clientRank_, 0 , &interComm) ; 
     
    4142    //MPI_Win_create_dynamic(MPI_INFO_NULL, winComm_, &winControl_); 
    4243    //CXios::getMpiGarbageCollector().registerWindow(winControl_) ; 
    43     CTimer::get("create Windows").suspend() ; 
     44    if (info.isActive(logTimers)) CTimer::get("create Windows").suspend() ; 
    4445    //MPI_Barrier(winComm_) ; 
    4546    //MPI_Barrier(winComm_) ; 
Note: See TracChangeset for help on using the changeset viewer.