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

New timers integration/reporting

Location:
XIOS3/trunk/src/manager
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.