Changeset 704


Ignore:
Timestamp:
09/23/15 16:18:56 (6 years ago)
Author:
rlacroix
Message:

Fix random communication errors when using the attached mode.

Location:
XIOS/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/context_client.cpp

    r697 r704  
    104104      } 
    105105 
    106       if (0 != parentServer) // attached mode 
     106      if (isAttachedModeEnabled()) 
    107107      { 
    108108        waitEvent(ranks); 
     
    141141      } 
    142142 
    143       if (0 != parentServer) // attached mode 
     143      if (isAttachedModeEnabled()) 
    144144      { 
    145145        while (checkBuffers()) 
     
    288288  } 
    289289 
    290   
     290  /*! 
     291   * Check if the attached mode is used. 
     292   * 
     293   * \return true if and only if attached mode is used 
     294   */ 
     295  bool CContextClient::isAttachedModeEnabled() const 
     296  { 
     297    return (parentServer != 0); 
     298  } 
    291299 
    292300   /*! 
  • XIOS/trunk/src/context_client.hpp

    r697 r704  
    4343      const std::list<int>& getRanksServerLeader(void) const; 
    4444 
     45      bool isAttachedModeEnabled() const; 
     46 
    4547      // Close and finalize context client 
    4648      void closeContext(void); 
  • XIOS/trunk/src/interface/c/iccalendar.cpp

    r639 r704  
    1313    CTimer::get("XIOS").resume(); 
    1414    xios::CContext* context = CContext::getCurrent(); 
    15     if (!context->hasServer) context->checkBuffersAndListen(); 
     15    if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     16      context->checkBuffersAndListen(); 
    1617    context->updateCalendar(step); 
    1718    context->sendUpdateCalendar(step); 
  • XIOS/trunk/src/interface/c/icdata.cpp

    r597 r704  
    373373      CTimer::get("XIOS send field").resume(); 
    374374      CContext* context = CContext::getCurrent(); 
    375       if (!context->hasServer) context->checkBuffersAndListen(); 
     375      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     376        context->checkBuffersAndListen(); 
    376377      CArray<double, 1> data(data_k8, shape(data_Xsize), neverDeleteData); 
    377378      CField::get(fieldid_str)->setData(data); 
     
    389390 
    390391      CContext* context = CContext::getCurrent(); 
    391       if (!context->hasServer) context->checkBuffersAndListen(); 
     392      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     393        context->checkBuffersAndListen(); 
    392394 
    393395      CArray<double, 1> data(data_k8, shape(data_Xsize), neverDeleteData); 
     
    407409 
    408410      CContext* context = CContext::getCurrent(); 
    409       if (!context->hasServer) context->checkBuffersAndListen(); 
     411      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     412        context->checkBuffersAndListen(); 
    410413 
    411414      CArray<double, 2>data(data_k8, shape(data_Xsize, data_Ysize), neverDeleteData); 
     
    425428 
    426429      CContext* context = CContext::getCurrent(); 
    427       if (!context->hasServer) context->checkBuffersAndListen(); 
     430      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     431        context->checkBuffersAndListen(); 
    428432 
    429433      CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); 
     
    442446      CTimer::get("XIOS send field").resume(); 
    443447      CContext* context = CContext::getCurrent(); 
    444       if (!context->hasServer) context->checkBuffersAndListen(); 
     448      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     449        context->checkBuffersAndListen(); 
    445450 
    446451      CArray<float, 1> data_tmp(data_k4, shape(data_Xsize), neverDeleteData); 
     
    461466 
    462467      CContext* context = CContext::getCurrent(); 
    463       if (!context->hasServer) context->checkBuffersAndListen(); 
     468      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     469        context->checkBuffersAndListen(); 
    464470 
    465471      CArray<float, 1> data_tmp(data_k4, shape(data_Xsize), neverDeleteData); 
     
    481487 
    482488      CContext* context = CContext::getCurrent(); 
    483       if (!context->hasServer) context->checkBuffersAndListen(); 
     489      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     490        context->checkBuffersAndListen(); 
    484491 
    485492      CArray<float, 2> data_tmp(data_k4, shape(data_Xsize, data_Ysize), neverDeleteData); 
     
    501508 
    502509      CContext* context = CContext::getCurrent(); 
    503       if (!context->hasServer) context->checkBuffersAndListen(); 
     510      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     511        context->checkBuffersAndListen(); 
    504512 
    505513      CArray<float, 3> data_tmp(data_k4, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); 
     
    523531 
    524532      CContext* context = CContext::getCurrent(); 
    525       if (!context->hasServer) context->checkBuffersAndListen(); 
     533      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     534        context->checkBuffersAndListen(); 
    526535 
    527536      CArray<double, 1> data(data_k8, shape(data_Xsize), neverDeleteData); 
     
    541550 
    542551      CContext* context = CContext::getCurrent(); 
    543       if (!context->hasServer) context->checkBuffersAndListen(); 
     552      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     553        context->checkBuffersAndListen(); 
    544554 
    545555      CArray<double, 2>data(data_k8, shape(data_Xsize, data_Ysize), neverDeleteData); 
     
    559569 
    560570      CContext* context = CContext::getCurrent(); 
    561       if (!context->hasServer) context->checkBuffersAndListen(); 
     571      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     572        context->checkBuffersAndListen(); 
    562573 
    563574      CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); 
     
    577588 
    578589      CContext* context = CContext::getCurrent(); 
    579       if (!context->hasServer) context->checkBuffersAndListen(); 
     590      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     591        context->checkBuffersAndListen(); 
    580592 
    581593      CArray<double, 1> data(data_Xsize); 
     
    597609 
    598610      CContext* context = CContext::getCurrent(); 
    599       if (!context->hasServer) context->checkBuffersAndListen(); 
     611      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     612        context->checkBuffersAndListen(); 
    600613 
    601614      CArray<double, 2> data(data_Xsize, data_Ysize); 
     
    617630 
    618631      CContext* context = CContext::getCurrent(); 
    619       if (!context->hasServer) context->checkBuffersAndListen(); 
     632      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
     633        context->checkBuffersAndListen(); 
    620634 
    621635      CArray<double, 3> data(data_Xsize, data_Ysize, data_Zsize); 
Note: See TracChangeset for help on using the changeset viewer.