Changeset 2260 for XIOS/dev


Ignore:
Timestamp:
11/19/21 15:41:40 (3 years ago)
Author:
ymipsl
Message:

Improvment of one sided protocol

  • removed latency
  • solve dead-lock

YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src
Files:
22 edited

Legend:

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

    r2259 r2260  
    248248    MPI_Status status; 
    249249    int flag; 
    250      
    251     if (hasWindows) 
    252     {  
    253       MPI_Win_lock(MPI_LOCK_EXCLUSIVE, clientRank_, 0, windows_[0]) ; 
    254       MPI_Win_unlock(clientRank_, windows_[0]) ; 
    255  
    256       MPI_Win_lock(MPI_LOCK_EXCLUSIVE, clientRank_, 0, windows_[1]) ; 
    257       MPI_Win_unlock(clientRank_, windows_[1]) ; 
    258     } 
    259      
     250    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
     251  
    260252    if (pending) 
    261253    { 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_client.hpp

    r2259 r2260  
    7171      bool hasWindows ; 
    7272 
    73       double latency_=1e-2 ; 
     73      double latency_=0 ; 
    7474      double lastCheckedWithNothing_=0 ; 
    7575      double lastCheckedNotify_=0 ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_server.hpp

    r2258 r2260  
    4040      bool hasWindows ; 
    4141      int windowsRank_ ; 
    42       double bufferFromClientLatency_=1e-1 ; 
     42      double bufferFromClientLatency_=0e-1 ; 
    4343      double bufferFromClientTime_ = 0; 
    4444 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/client.cpp

    r2238 r2260  
    431431      double time ; 
    432432      double lastTime=0 ; 
    433       double latency=1e-2 ; 
     433      double latency=0 ; 
    434434      bool out=false ; 
    435435      while (!out) 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.cpp

    r2259 r2260  
    118118    { 
    119119      list<int> ranks = event.getRanks(); 
    120       info(100)<<"Event "<<timeLine<<" of context "<<context_->getId()<<endl ; 
     120  
     121//      ostringstream str ; 
     122//      for(auto& rank : ranks) str<<rank<<" ; " ; 
     123//      info(100)<<"Event "<<timeLine<<" of context "<<context_->getId()<<"  for ranks : "<<str.str()<<endl ; 
     124 
    121125      if (CXios::checkEventSync) 
    122126      { 
     
    165169 
    166170        unlockBuffers(ranks) ; 
    167         info(100)<<"Event "<<timeLine<<" of context "<<context_->getId()<<"  sent"<<endl ; 
    168            
    169171        checkBuffers(ranks); 
     172         
    170173      } 
    171174       
     
    346349      } 
    347350      buffer->attachWindows(windows_[rank]) ; 
     351      if (!isAttachedModeEnabled()) MPI_Barrier(winComm_[rank]) ; 
     352        
    348353   } 
    349354 
     
    525530  } 
    526531   
     532  bool CContextClient::havePendingRequests(list<int>& ranks) 
     533  { 
     534      list<int>::iterator it; 
     535      bool pending = false; 
     536      for (it = ranks.begin(); it != ranks.end(); it++) pending |= buffers[*it]->hasPendingRequest(); 
     537      return pending; 
     538  } 
     539 
    527540  bool CContextClient::isNotifiedFinalized(void) 
    528541  { 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.hpp

    r2259 r2260  
    4141      void releaseBuffers(void); 
    4242      bool havePendingRequests(void); 
     43      bool havePendingRequests(list<int>& ranks) ; 
    4344 
    4445      bool isServerLeader(void) const; 
     
    127128      bool isGrowableBuffer_ = true ; 
    128129 
    129       double latency_=1e-2 ; 
     130      double latency_=0e-2 ; 
    130131  }; 
    131132} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.cpp

    r2259 r2260  
    166166        MPI_Win_create_dynamic(MPI_INFO_NULL, winComm_[rank], &windows_[rank][1]); 
    167167        CTimer::get("create Windows").suspend() ; 
     168        MPI_Barrier(winComm_[rank]) ; 
    168169      } 
    169170      else 
     
    302303        buffers[rank]->notifyBufferResizing() ; 
    303304        buffers[rank]->updateCurrentWindows() ; 
     305        info(100)<<"Receive NotifyChangeBufferSize from client rank "<<rank<<endl ; 
    304306      }  
    305307      else if (timeLine==timelineEventChangeBufferSize) 
     
    310312        buffers.erase(rank) ; 
    311313        buffers.insert(pair<int,CServerBuffer*>(rank,new CServerBuffer(windows_[rank], winAdress, 0, newSize))); 
     314        info(100)<<"Receive ChangeBufferSize from client rank "<<rank<<"  newSize : "<<newSize<<" Address : "<<winAdress[0]<<" & "<<winAdress[1]<<endl ; 
    312315      } 
    313316      else 
    314317      { 
     318        info(100)<<"Receive standard event from client rank "<<rank<<"  with timeLine : "<<timeLine<<endl ; 
    315319        it=events.find(timeLine); 
    316320        if (it==events.end()) it=events.insert(pair<int,CEventServer*>(timeLine,new CEventServer(this))).first; 
     
    391395      else if (pendingRequest.empty()) getBufferFromClient(currentTimeLine) ; 
    392396    } 
    393     else if (pureOneSided) getBufferFromClient(currentTimeLine) ; // if pure one sided check buffer even if no event recorded at current time line 
     397    else if (pendingRequest.empty()) getBufferFromClient(currentTimeLine) ; // if pure one sided check buffer even if no event recorded at current time line 
    394398  } 
    395399 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/contexts_manager.cpp

    r2258 r2260  
    155155  { 
    156156    CTimer::get("CContextsManager::eventLoop").resume(); 
     157    int flag ; 
     158    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
    157159    double time=MPI_Wtime() ; 
    158160    if (time-lastEventLoop_ > eventLoopLatency_)  
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/contexts_manager.hpp

    r2246 r2260  
    8383    int managerGlobalLeader_ ; 
    8484 
    85     const double eventLoopLatency_=1e-2;  
     85    const double eventLoopLatency_=0;  
    8686    double lastEventLoop_=0. ; 
    8787 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/pool_ressource.cpp

    r2246 r2260  
    106106    
    107107    double time=MPI_Wtime() ; 
     108    int flag ; 
     109    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
    108110    if (time-lastEventLoop_ > eventLoopLatency_)  
    109111    { 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/pool_ressource.hpp

    r2246 r2260  
    4545    bool finalizeSignal_ ; 
    4646     
    47     const double eventLoopLatency_=1e-2;  
     47    const double eventLoopLatency_=0;  
    4848    double lastEventLoop_=0. ; 
    4949  }; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/ressources_manager.cpp

    r2258 r2260  
    113113  { 
    114114    CTimer::get("CRessourcesManager::eventLoop").resume(); 
     115    int flag ; 
     116    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
    115117    double time=MPI_Wtime() ; 
    116118    if (time-lastEventLoop_ > eventLoopLatency_)  
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/ressources_manager.hpp

    r2246 r2260  
    7272    int freeRessourcesSize_ ; 
    7373 
    74     const double eventLoopLatency_=1e-2;  
     74    const double eventLoopLatency_=0;  
    7575    double lastEventLoop_=0. ; 
    7676 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/server_context.cpp

    r2258 r2260  
    237237    CTimer::get("CServerContext::eventLoop").resume(); 
    238238    bool finished=false ; 
    239      
     239    int flag ; 
     240    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
     241 
    240242//    double time=MPI_Wtime() ; 
    241243//    if (time-lastEventLoop_ > eventLoopLatency_)  
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/server_context.hpp

    r2246 r2260  
    6161    bool isAttachedMode_ ; 
    6262 
    63     const double eventLoopLatency_=1e-2;  
     63    const double eventLoopLatency_=0;  
    6464    double lastEventLoop_=0. ; 
    6565 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/servers_ressource.cpp

    r2246 r2260  
    118118    CTimer::get("CServersRessource::eventLoop").resume(); 
    119119    double time=MPI_Wtime() ; 
     120    int flag ; 
     121    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
     122 
    120123    if (time-lastEventLoop_ > eventLoopLatency_)  
    121124    { 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/servers_ressource.hpp

    r2246 r2260  
    5050    bool finalizeSignal_ ; 
    5151 
    52     const double eventLoopLatency_=1e-2;  
     52    const double eventLoopLatency_=0;  
    5353    double lastEventLoop_=0. ; 
    5454 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/services.cpp

    r2258 r2260  
    105105    //checkCreateContextNotification() ; 
    106106    CTimer::get("CService::eventLoop").resume(); 
    107      
     107    int flag ; 
     108    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
     109    
    108110//    double time=MPI_Wtime() ; 
    109111//    if (time-lastEventLoop_ > eventLoopLatency_)  
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/services.hpp

    r2246 r2260  
    7171    int nbPartitions_ ; 
    7272 
    73     const double eventLoopLatency_=1e-2;  
     73    const double eventLoopLatency_=0;  
    7474    double lastEventLoop_=0. ; 
    7575 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/services_manager.cpp

    r2246 r2260  
    109109  { 
    110110    CTimer::get("CServicesManager::eventLoop").resume(); 
     111    int flag ; 
     112    MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
    111113    double time=MPI_Wtime() ; 
    112114    if (time-lastEventLoop_ > eventLoopLatency_)  
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/services_manager.hpp

    r2246 r2260  
    6060    int managerGlobalLeader_ ; 
    6161 
    62     const double eventLoopLatency_=1e-2;  
     62    const double eventLoopLatency_=0;  
    6363    double lastEventLoop_=0. ; 
    6464     
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/window_manager.hpp

    r2258 r2260  
    6161        time=MPI_Wtime() ; 
    6262        while(time-lastTime < latency_) time=MPI_Wtime() ; 
     63        int flag ; 
     64        MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
    6365        MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, window_) ; 
    6466        MPI_Compare_and_swap(&WINDOWS_LOCKED, &state, &lock, MPI_INT, rank, OFFSET_LOCK, window_) ; 
     
    8688        time=MPI_Wtime() ; 
    8789        while(time-lastTime < latency_) time=MPI_Wtime() ; 
     90        int flag ; 
     91        MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, MPI_STATUS_IGNORE); 
    8892        MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, window_) ; 
    8993        MPI_Compare_and_swap(&WINDOWS_LOCKED, &state, &lock, MPI_INT, rank, OFFSET_LOCK, window_) ; 
Note: See TracChangeset for help on using the changeset viewer.