Changeset 1378


Ignore:
Timestamp:
12/13/17 16:11:58 (6 years ago)
Author:
ymipsl
Message:

Attemping to solve a dead-lock rising at finalize :
Server 1 must be able receive buffer of on other context (ie from server2) when awaiting free buffer.
To be tested extensively...

YM


Location:
XIOS/dev/XIOS_DEV_CMIP6/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/context_client.cpp

    r1377 r1378  
    246246            for (int i = 0; i < context->serverPrimServer.size(); ++i) 
    247247              context->serverPrimServer[i]->listen(); 
    248 //            CServer::contextEventLoop(false) ; // avoid dead-lock at finalize... 
     248            CServer::contextEventLoop(false) ; // avoid dead-lock at finalize... 
    249249          } 
    250250 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/context.cpp

    r1372 r1378  
    396396 
    397397   //! Try to send the buffers and receive possible answers 
    398   bool CContext::checkBuffersAndListen(void) 
     398  bool CContext::checkBuffersAndListen(bool enableEventsProcessing /*= true*/) 
    399399  { 
    400400    bool clientReady, serverFinished; 
     
    408408        hasTmpBufferedEvent = !client->sendTemporarilyBufferedEvent(); 
    409409      // Don't process events if there is a temporarily buffered event 
    410       return server->eventLoop(!hasTmpBufferedEvent); 
     410      return server->eventLoop(!hasTmpBufferedEvent || !enableEventsProcessing); 
    411411    } 
    412412    else if (CServer::serverLevel == 1) 
     
    423423          clientPrimServer[i]->checkBuffers(); 
    424424        if (!finalized) 
    425           serverPrimFinished *= serverPrimServer[i]->eventLoop(); 
     425          serverPrimFinished *= serverPrimServer[i]->eventLoop(enableEventsProcessing); 
    426426      } 
    427427      return ( serverFinished && serverPrimFinished); 
     
    431431    { 
    432432      client->checkBuffers(); 
    433       return server->eventLoop(); 
     433      return server->eventLoop(enableEventsProcessing); 
    434434    } 
    435435  } 
     
    490490       { 
    491491         // Blocking send of context finalize message to its client (e.g. primary server or model) 
     492         info(100)<<"DEBUG: context "<<getId()<<" Send client finalize<<"<<endl ; 
    492493         client->finalize(); 
    493494         bool bufferReleased; 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/context.hpp

    r1358 r1378  
    9595 
    9696         // Put sever or client into loop state 
    97          bool checkBuffersAndListen(void); 
     97         bool checkBuffersAndListen(bool enableEventsProcessing=true); 
    9898 
    9999         // Finalize a context 
  • XIOS/dev/XIOS_DEV_CMIP6/src/server.hpp

    r1243 r1378  
    1616        static void finalize(void); 
    1717        static void eventLoop(void); 
    18         static void contextEventLoop(void); 
     18        static void contextEventLoop(bool enableEventsProcessing=true); 
    1919        static void listenContext(void); 
    2020        static void listenFinalize(void); 
Note: See TracChangeset for help on using the changeset viewer.