Ignore:
Timestamp:
06/12/23 11:52:10 (13 months ago)
Author:
ymipsl
Message:

New way to manage locks in window manager. Windows is locked with MPI_Win_lock_all at creation (shared mode), and lock is manage by software way in the class (using MPI_swap_and_compare and MPI_Fetch_op). We get in this case a better control of lock, with controled latency between each attemp of lock.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/manager/contexts_manager.cpp

    r2287 r2517  
    2727    MPI_Comm_rank(xiosComm_, &commRank) ; 
    2828    winNotify_ = new CWindowManager(xiosComm_, maxBufferSize_) ; 
     29    winNotify_->updateToExclusiveWindow(commRank, this, &CContextsManager::notificationsDumpOut) ; 
    2930    
    3031 
    3132    winContexts_ = new CWindowManager(xiosComm_, maxBufferSize_) ; 
    32     winContexts_->lockWindow(commRank,0) ; 
    33     winContexts_->updateToWindow(commRank, this, &CContextsManager::contextsDumpOut) ; 
    34     winContexts_->unlockWindow(commRank,0) ; 
    35  
     33    winContexts_->updateToExclusiveWindow(commRank, this, &CContextsManager::contextsDumpOut) ; 
     34   
    3635    MPI_Barrier(xiosComm_)  ;     
    3736  } 
     
    111110    winNotify_->lockWindowExclusive(rank) ; 
    112111    winNotify_->pushToLockedWindow(rank, this, &CContextsManager::notificationsDumpOut) ; 
    113     winNotify_->unlockWindow(rank) ; 
     112    winNotify_->unlockWindowExclusive(rank) ; 
    114113  } 
    115114 
     
    170169    int commRank ; 
    171170    MPI_Comm_rank(xiosComm_, &commRank) ; 
    172     winNotify_->lockWindowExclusive(commRank) ; 
    173     winNotify_->popFromLockedWindow(commRank, this, &CContextsManager::notificationsDumpIn) ; 
    174     winNotify_->unlockWindow(commRank) ; 
     171    winNotify_->popFromExclusiveWindow(commRank, this, &CContextsManager::notificationsDumpIn) ; 
    175172    if (notifyType_==NOTIFY_CREATE_CONTEXT) createServerContext() ; 
    176173    else if (notifyType_==NOTIFY_CREATE_INTERCOMM) createServerContextIntercomm() ; 
     
    215212    contexts_[fullContextId] = contextInfo ; 
    216213    winContexts_->updateToLockedWindow(managerGlobalLeader_, this, &CContextsManager::contextsDumpOut) ; 
    217     winContexts_->unlockWindow(managerGlobalLeader_) ; 
     214    winContexts_->unlockWindowExclusive(managerGlobalLeader_) ; 
    218215  } 
    219216 
     
    227224    { 
    228225 
    229       winContexts_->lockWindowShared(managerGlobalLeader_) ; 
    230       winContexts_->updateFromLockedWindow(managerGlobalLeader_, this, &CContextsManager::contextsDumpIn) ; 
    231       winContexts_->unlockWindow(managerGlobalLeader_) ; 
     226      winContexts_->updateFromSharedWindow(managerGlobalLeader_, this, &CContextsManager::contextsDumpIn) ; 
    232227 
    233228      auto it=contexts_.find(fullContextId) ; 
Note: See TracChangeset for help on using the changeset viewer.