Changeset 1322


Ignore:
Timestamp:
10/30/17 18:16:37 (4 years ago)
Author:
rlacroix
Message:

Fix r1321 so that it makes some sense...

Polling a constant variable multiple times won't make its value change. If the data was received late but before the timeout, XIOS would throw an error anyway.

Location:
XIOS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/field.cpp

    r1321 r1322  
    569569    { 
    570570      CTimer timer("CField::checkForLateDataFromServer"); 
    571       const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + file->output_freq) : context->getCalendar()->getInitDate(); 
    572  
    573       bool isDataLate = nextDataDue < currentDate; 
    574       while (isDataLate && timer.getCumulatedTime() < CXios::recvFieldTimeout) 
     571 
     572      bool isDataLate; 
     573      do 
    575574      { 
    576         timer.resume(); 
    577  
    578         context->checkBuffersAndListen(); 
    579  
    580         timer.suspend(); 
    581  
     575        const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + file->output_freq) : context->getCalendar()->getInitDate(); 
    582576        isDataLate = nextDataDue < currentDate; 
    583       } 
     577 
     578        if (isDataLate) 
     579        { 
     580          timer.resume(); 
     581 
     582          context->checkBuffersAndListen(); 
     583 
     584          timer.suspend(); 
     585        } 
     586      } 
     587      while (isDataLate && timer.getCumulatedTime() < CXios::recvFieldTimeout); 
    584588 
    585589      if (isDataLate) 
  • XIOS/trunk/src/node/field.cpp

    r1321 r1322  
    482482    { 
    483483      CTimer timer("CField::checkForLateDataFromServer"); 
    484       const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + file->output_freq) : context->getCalendar()->getInitDate(); 
    485  
    486       bool isDataLate = nextDataDue < currentDate; 
    487       while (isDataLate && timer.getCumulatedTime() < CXios::recvFieldTimeout) 
    488       { 
    489         timer.resume(); 
    490  
    491         context->checkBuffersAndListen(); 
    492  
    493         timer.suspend(); 
    494  
     484 
     485      bool isDataLate; 
     486      do 
     487      { 
     488        const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + file->output_freq) : context->getCalendar()->getInitDate(); 
    495489        isDataLate = nextDataDue < currentDate; 
    496       } 
     490 
     491        if (isDataLate) 
     492        { 
     493          timer.resume(); 
     494 
     495          context->checkBuffersAndListen(); 
     496 
     497          timer.suspend(); 
     498        } 
     499      } 
     500      while (isDataLate && timer.getCumulatedTime() < CXios::recvFieldTimeout); 
    497501 
    498502      if (isDataLate) 
Note: See TracChangeset for help on using the changeset viewer.