Changeset 2326


Ignore:
Timestamp:
04/22/22 11:46:41 (2 years ago)
Author:
ymipsl
Message:

Fix Deadlock from reading phase.
YM

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

Legend:

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

    r2324 r2326  
    449449   void CContextClient::setBufferSize(const std::map<int,StdSize>& mapSize) 
    450450   { 
    451      for(auto& it : mapSize)  
    452       buffers[it.first]->fixBufferSize(std::max(CXios::minBufferSize*1.0,std::min(it.second*CXios::bufferSizeFactor*1.01,CXios::maxBufferSize*1.0))); 
     451     setFixedBuffer() ; 
     452     for(auto& it : mapSize) 
     453     { 
     454      size_t size=std::max(CXios::minBufferSize*1.0,std::min(it.second*CXios::bufferSizeFactor*1.01,CXios::maxBufferSize*1.0)) ; 
     455      mapBufferSize_[it.first]=size ; 
     456      if (buffers.count(it.first)>0) buffers[it.first]->fixBufferSize(size); 
     457     } 
    453458   } 
    454459 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.cpp

    r2310 r2326  
    115115    CTimer::get("check pending request").suspend(); 
    116116    CTimer::get("check event process").resume(); 
    117     if (enableEventsProcessing)  processEvents(); 
     117    processEvents(enableEventsProcessing); 
    118118    CTimer::get("check event process").suspend(); 
    119119    return finished; 
     
    320320        buffers[rank]->freeBuffer(count) ; 
    321321        delete buffers[rank] ; 
    322         buffers[rank] = new CServerBuffer(windows_[rank], winAdress, 0, newSize) ; 
     322        buffers[rank] = new CServerBuffer(windows_[rank], winAdress, 0, 2*newSize) ; 
    323323        info(100)<<"Context id "<<context->getId()<<" : Receive ChangeBufferSize from client rank "<<rank 
    324324                 <<"  newSize : "<<newSize<<" Address : "<<winAdress[0]<<" & "<<winAdress[1]<<endl ; 
     
    339339  } 
    340340 
    341   void CContextServer::processEvents(void) 
     341  void CContextServer::processEvents(bool enableEventsProcessing) 
    342342  { 
    343343    map<size_t,CEventServer*>::iterator it; 
     
    363363        else if (isAttachedModeEnabled() || eventScheduler_->queryEvent(currentTimeLine,hashId) ) 
    364364        { 
     365          if (!enableEventsProcessing && isCollectiveEvent(*event)) return ; 
    365366 
    366367          if (!eventScheduled_)  
     
    498499  bool CContextServer::isCollectiveEvent(CEventServer& event) 
    499500  { 
    500     if (event.classId==CField::GetType()) return CField::isCollectiveEvent(event); 
     501    if (event.type>1000) return false ; 
    501502    else return true ; 
    502503  } 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.hpp

    r2259 r2326  
    2525    void getBufferFromClient(size_t timeLine) ; 
    2626    void processRequest(int rank, char* buff,int count) ; 
    27     void processEvents(void) ; 
     27    void processEvents(bool enableEventsProcessing) ; 
    2828    bool hasFinished(void); 
    2929    void dispatchEvent(CEventServer& event) ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp

    r2304 r2326  
    5555         enum EEventId 
    5656         { 
     57           EVENT_ID_COLLECTIVE=100, 
    5758           EVENT_ID_AXIS_DISTRIBUTION, 
    58            EVENT_ID_SEND_DISTRIBUTED_ATTRIBUTE 
     59           EVENT_ID_SEND_DISTRIBUTED_ATTRIBUTE, 
     60           EVENT_ID_NO_COLLECTIVE=1000, 
    5961         } ; 
    6062 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp

    r2325 r2326  
    11301130    for(auto field : fileOutField) field->evaluateBufferSize(fieldBufferEvaluation, CXios::isOptPerformance) ; // output to server 
    11311131    for(auto field : couplerOutField) field->evaluateBufferSize(fieldBufferEvaluation, CXios::isOptPerformance) ; // output to coupler 
    1132     for(auto field : fieldModelIn) field->evaluateBufferSize(fieldBufferEvaluation, CXios::isOptPerformance) ; // server to client (for io servers) 
     1132    for(auto field : fileInField) field->evaluateBufferSize(fieldBufferEvaluation, CXios::isOptPerformance) ; // server to client (for io servers) 
    11331133     
    11341134    // fix size for each context client 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp

    r2274 r2326  
    5353         enum EEventId 
    5454         { 
     55           EVENT_ID_COLLECTIVE=100, 
    5556           EVENT_ID_CLOSE_DEFINITION,EVENT_ID_UPDATE_CALENDAR, 
    5657           EVENT_ID_CREATE_FILE_HEADER,EVENT_ID_CONTEXT_FINALIZE, 
     
    5960           EVENT_ID_COUPLER_IN_CLOSE_DEFINITION, 
    6061           EVENT_ID_COUPLER_IN_CONTEXT_FINALIZED, 
     62           EVENT_ID_NO_COLLECTIVE=1000, 
    6163         }; 
    6264 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.hpp

    r1875 r2326  
    5252         enum EEventId 
    5353         { 
    54            NO_EVENT 
     54           EVENT_ID_COLLECTIVE=100, 
     55           NO_EVENT, 
     56           EVENT_ID_NO_COLLECTIVE=1000, 
    5557         }; 
    5658 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.hpp

    r2002 r2326  
    4747         enum EEventId 
    4848         { 
    49            NO_EVENT 
     49           EVENT_ID_COLLECTIVE=100, 
     50           NO_EVENT, 
     51           EVENT_ID_NO_COLLECTIVE=1000, 
    5052         }; 
    5153 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp

    r2312 r2326  
    5858         enum EEventId 
    5959         { 
    60            EVENT_ID_DOMAIN_DISTRIBUTION, EVENT_ID_SEND_DISTRIBUTED_ATTRIBUTE 
     60           EVENT_ID_COLLECTIVE=100, 
     61           EVENT_ID_DOMAIN_DISTRIBUTION, EVENT_ID_SEND_DISTRIBUTED_ATTRIBUTE, 
     62           EVENT_ID_NO_COLLECTIVE=100, 
    6163         } ; 
    6264 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp

    r2315 r2326  
    558558  { 
    559559    CContextClient* client=nullptr ; 
     560    const size_t headerSize=100 ; 
    560561 
    561562    for(int i=0;i<2;i++) 
     
    569570        map<int,size_t> bufferSize ; 
    570571    
    571         if (evaluateBuffer.count(client)!=0) bufferSize = evaluateBuffer[client] ; 
     572        bufferSize = evaluateBuffer[client] ; 
    572573        if (isOptPerformance) 
    573574        { 
    574575          for(auto& it : dataSize)  
    575576          { 
    576             if (bufferSize.count(it.first)==0) bufferSize[it.first]=it.second ; 
    577             else bufferSize[it.first]+=it.second ; 
     577            if (bufferSize.count(it.first)==0) bufferSize[it.first]=it.second+headerSize ; 
     578            else bufferSize[it.first]+=it.second+headerSize ; 
    578579          } 
    579580        } 
     
    582583          for(auto& it : dataSize)  
    583584          { 
    584             if (bufferSize.count(it.first)==0) bufferSize[it.first]=it.second ; 
    585             else bufferSize[it.first]=std::max(bufferSize[it.first],(size_t)it.second) ; 
     585              if (bufferSize.count(it.first)==0) bufferSize[it.first]=it.second+headerSize ; 
     586              else bufferSize[it.first]=std::max(bufferSize[it.first],(size_t)(it.second+headerSize)) ; 
    586587          } 
    587588        } 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp

    r2318 r2326  
    9090         enum EEventId 
    9191         { 
     92           EVENT_ID_COLLECTIVE=100, 
    9293           EVENT_ID_UPDATE_DATA, EVENT_ID_READ_DATA, EVENT_ID_READ_DATA_READY, 
    93            EVENT_ID_ADD_VARIABLE, EVENT_ID_ADD_VARIABLE_GROUP, EVENT_ID_GRID_COMPLETED 
     94           EVENT_ID_ADD_VARIABLE, EVENT_ID_ADD_VARIABLE_GROUP, EVENT_ID_GRID_COMPLETED, 
     95           EVENT_ID_NO_COLLECTIVE=1000, 
    9496         }; 
    9597 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.hpp

    r2002 r2326  
    5252         enum EEventId 
    5353         { 
     54           EVENT_ID_COLLECTIVE=100, 
    5455           EVENT_ID_ADD_FIELD, EVENT_ID_ADD_FIELD_GROUP, EVENT_ID_ADD_VARIABLE, 
    55            EVENT_ID_ADD_VARIABLE_GROUP, EVENT_ID_CREATE_ENABLED_FIELDS 
     56           EVENT_ID_ADD_VARIABLE_GROUP, EVENT_ID_CREATE_ENABLED_FIELDS, 
     57           EVENT_ID_NO_COLLECTIVE=1000, 
    5658         }; 
    5759 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp

    r2315 r2326  
    7777         enum EEventId 
    7878         { 
     79           EVENT_ID_COLLECTIVE=100, 
    7980           EVENT_ID_ADD_DOMAIN, EVENT_ID_ADD_AXIS, EVENT_ID_ADD_SCALAR, 
    8081           EVENT_ID_SEND_MASK, 
     82           EVENT_ID_NO_COLLECTIVE=1000, 
    8183 
    8284         }; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp

    r2304 r2326  
    5252      enum EEventId 
    5353      { 
     54        EVENT_ID_COLLECTIVE=100, 
    5455        EVENT_ID_SCALAR_DISTRIBUTION, 
    5556        EVENT_ID_SEND_DISTRIBUTED_ATTRIBUTE, 
     57        EVENT_ID_NO_COLLECTIVE=1000, 
    5658      } ; 
    5759      static bool dispatchEvent(CEventServer& event);       
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/variable.hpp

    r1784 r2326  
    3939            enum EEventId 
    4040            { 
    41              EVENT_ID_VARIABLE_VALUE 
     41             EVENT_ID_COLLECTIVE=100, 
     42             EVENT_ID_VARIABLE_VALUE, 
     43             EVENT_ID_NO_COLLECTIVE=1000, 
    4244            }; 
    4345 
Note: See TracChangeset for help on using the changeset viewer.