Ignore:
Timestamp:
10/11/21 14:41:56 (3 years ago)
Author:
ymipsl
Message:
  • Update of the tranfer protocol using one sided communication
  • Introduce MPI_Improb/MPI_mrecv to listen incomming request
  • Introducing latency when looping over managers

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/server_context.cpp

    r2230 r2246  
    66#include "register_context_info.hpp" 
    77#include "services.hpp" 
     8#include "timer.hpp" 
    89 
    910 
     
    1819                                 hasNotification_(false) 
    1920  { 
     21   info(40)<<"CCServerContext::CServerContext  : new context creation ; contextId : "<<contextId<<endl ; 
    2022   int localRank, globalRank, commSize ; 
    2123 
     
    5860                                       const MPI_Comm& intraComm, MPI_Comm& interCommClient, MPI_Comm& interCommServer, bool wait) 
    5961  { 
     62    info(40)<<"CServerContext::createIntercomm  : context intercomm creation ; contextId : "<<contextId<<endl ; 
    6063    int intraCommRank ; 
    6164    MPI_Comm_rank(intraComm, &intraCommRank) ; 
     
    145148     int commSize ; 
    146149     MPI_Comm_size(contextComm_,&commSize) ; 
     150     info(40)<<"CServerContext::createIntercomm  : notify createContextIntercomm to all context members ; sourceContext : "<<sourceContext<<endl ; 
     151     
    147152     for(int rank=0; rank<commSize; rank++) 
    148153     { 
     
    191196    if (!hasNotification_) 
    192197    { 
    193       int commRank ; 
    194       MPI_Comm_rank(contextComm_, &commRank) ; 
    195       winNotify_->lockWindow(commRank,0) ; 
    196       winNotify_->popFromWindow(commRank, this, &CServerContext::notificationsDumpIn) ; 
    197       winNotify_->unlockWindow(commRank,0) ; 
     198      double time=MPI_Wtime() ; 
     199      if (time-lastEventLoop_ > eventLoopLatency_)  
     200      { 
     201        int commRank ; 
     202        MPI_Comm_rank(contextComm_, &commRank) ; 
     203        winNotify_->lockWindow(commRank,0) ; 
     204        winNotify_->popFromWindow(commRank, this, &CServerContext::notificationsDumpIn) ; 
     205        winNotify_->unlockWindow(commRank,0) ; 
    198206       
    199       if (notifyInType_!= NOTIFY_NOTHING) 
    200       { 
    201         hasNotification_=true ; 
    202         auto eventScheduler=parentService_->getEventScheduler() ; 
    203         std::hash<string> hashString ; 
    204         size_t hashId = hashString(name_) ; 
    205         size_t currentTimeLine=0 ; 
    206         eventScheduler->registerEvent(currentTimeLine,hashId);  
     207        if (notifyInType_!= NOTIFY_NOTHING) 
     208        { 
     209          hasNotification_=true ; 
     210          auto eventScheduler=parentService_->getEventScheduler() ; 
     211          std::hash<string> hashString ; 
     212          size_t hashId = hashString(name_) ; 
     213          size_t currentTimeLine=0 ; 
     214          eventScheduler->registerEvent(currentTimeLine,hashId);  
     215        } 
     216        lastEventLoop_=time ; 
    207217      } 
    208218    } 
     
    225235  bool CServerContext::eventLoop(bool serviceOnly) 
    226236  { 
     237    CTimer::get("CServerContext::eventLoop").resume(); 
    227238    bool finished=false ; 
    228     if (winNotify_!=nullptr) checkNotifications() ; 
     239     
     240//    double time=MPI_Wtime() ; 
     241//    if (time-lastEventLoop_ > eventLoopLatency_)  
     242//    { 
     243      if (winNotify_!=nullptr) checkNotifications() ; 
     244//      lastEventLoop_=time ; 
     245//    } 
     246 
     247 
    229248    if (!serviceOnly && context_!=nullptr)   
    230249    { 
     
    235254      } 
    236255    } 
    237  
     256    CTimer::get("CServerContext::eventLoop").suspend(); 
    238257    if (context_==nullptr && finalizeSignal_) finished=true ; 
    239258    return finished ; 
     
    242261  void CServerContext::createIntercomm(void) 
    243262  { 
     263    info(40)<<"CServerContext::createIntercomm  : received createIntercomm notification"<<endl ; 
     264 
    244265     MPI_Comm interCommServer, interCommClient ; 
    245266     auto& arg=notifyInCreateIntercomm_ ; 
Note: See TracChangeset for help on using the changeset viewer.