Changeset 1358 for XIOS/trunk/src/node
- Timestamp:
- 12/06/17 08:34:41 (6 years ago)
- Location:
- XIOS/trunk/src/node
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/context.cpp
r1357 r1358 438 438 buildFilterGraphOfFieldsWithReadAccess(); 439 439 this->solveAllRefOfEnabledFields(true); 440 postProcessFilterGraph(); 440 441 } 441 442 … … 505 506 } 506 507 508 void CContext::postProcessFilterGraph() 509 { 510 int size = enabledFiles.size(); 511 for (int i = 0; i < size; ++i) 512 { 513 enabledFiles[i]->postProcessFilterGraph(); 514 } 515 } 516 507 517 void CContext::startPrefetchingOfEnabledReadModeFiles() 508 518 { … … 511 521 { 512 522 enabledReadModeFiles[i]->prefetchEnabledReadModeFields(); 523 } 524 } 525 526 void CContext::doPreTimestepOperationsForEnabledReadModeFiles() 527 { 528 int size = enabledReadModeFiles.size(); 529 for (int i = 0; i < size; ++i) 530 { 531 enabledReadModeFiles[i]->doPreTimestepOperationsForEnabledReadModeFields(); 513 532 } 514 533 } … … 1206 1225 if (prevStep < step) 1207 1226 { 1227 if (hasClient) 1228 { 1229 doPreTimestepOperationsForEnabledReadModeFiles(); 1230 } 1231 1208 1232 info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 1209 1233 calendar->update(step); -
XIOS/trunk/src/node/context.hpp
r1318 r1358 114 114 void solveAllRefOfEnabledFields(bool sendToServer); 115 115 void buildFilterGraphOfEnabledFields(); 116 void postProcessFilterGraph(); 116 117 void startPrefetchingOfEnabledReadModeFiles(); 118 void doPreTimestepOperationsForEnabledReadModeFiles(); 117 119 void doPostTimestepOperationsForEnabledReadModeFiles(); 118 120 void findFieldsWithReadAccess(void); -
XIOS/trunk/src/node/field.cpp
r1326 r1358 40 40 , wasDataRequestedFromServer(false) 41 41 , wasDataAlreadyReceivedFromServer(false) 42 , mustAutoTrigger(false) 42 43 , isEOF(false) 43 44 { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } … … 55 56 , wasDataRequestedFromServer(false) 56 57 , wasDataAlreadyReceivedFromServer(false) 58 , mustAutoTrigger(false) 57 59 , isEOF(false) 58 60 { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } … … 479 481 480 482 // Check if data previously requested has been received as expected 481 if (wasDataRequestedFromServer && (!isEOF || currentDate <= dateEOF))483 if (wasDataRequestedFromServer && !isEOF) 482 484 { 483 485 CTimer timer("CField::checkForLateDataFromServer"); … … 487 489 { 488 490 const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + file->output_freq) : context->getCalendar()->getInitDate(); 489 isDataLate = nextDataDue < currentDate;491 isDataLate = (nextDataDue <= currentDate); 490 492 491 493 if (isDataLate) … … 504 506 << "Late data at timestep = " << currentDate); 505 507 } 508 } 509 510 void CField::checkIfMustAutoTrigger(void) 511 { 512 mustAutoTrigger = serverSourceFilter ? serverSourceFilter->mustAutoTrigger() : false; 513 } 514 515 void CField::autoTriggerIfNeeded(void) 516 { 517 if (mustAutoTrigger) 518 serverSourceFilter->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()); 506 519 } 507 520 -
XIOS/trunk/src/node/field.hpp
r1318 r1358 151 151 void recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers); 152 152 void checkForLateDataFromServer(void); 153 void checkIfMustAutoTrigger(void); 154 void autoTriggerIfNeeded(void); 153 155 void outputField(CArray<double,3>& fieldOut); 154 156 void outputField(CArray<double,2>& fieldOut); … … 200 202 CDate lastDataRequestedFromServer, lastDataReceivedFromServer, dateEOF; 201 203 bool wasDataRequestedFromServer, wasDataAlreadyReceivedFromServer; 204 bool mustAutoTrigger; 202 205 203 206 map<int,boost::shared_ptr<func::CFunctor> > foperation_srv; -
XIOS/trunk/src/node/file.cpp
r1318 r1358 770 770 771 771 /*! 772 * Post-process the filter graph for each active field. 773 */ 774 void CFile::postProcessFilterGraph() 775 { 776 int size = this->enabledFields.size(); 777 for (int i = 0; i < size; ++i) 778 { 779 this->enabledFields[i]->checkIfMustAutoTrigger(); 780 } 781 } 782 783 /*! 772 784 Prefetching the data for enabled fields read from file. 773 785 */ … … 783 795 784 796 /*! 785 Do all post timestep operations for enabled fields in read mode: 786 - Prefetch the data read from file when needed 797 Do all pre timestep operations for enabled fields in read mode: 787 798 - Check that the data excepted from server has been received 788 */ 789 void CFile::doPostTimestepOperationsForEnabledReadModeFields(void) 799 - Check if some filters must auto-trigger 800 */ 801 void CFile::doPreTimestepOperationsForEnabledReadModeFields(void) 790 802 { 791 803 if (mode.isEmpty() || mode.getValue() != mode_attr::read) … … 796 808 { 797 809 this->enabledFields[i]->checkForLateDataFromServer(); 810 this->enabledFields[i]->autoTriggerIfNeeded(); 811 } 812 } 813 814 /*! 815 Do all post timestep operations for enabled fields in read mode: 816 - Prefetch the data read from file when needed 817 */ 818 void CFile::doPostTimestepOperationsForEnabledReadModeFields(void) 819 { 820 if (mode.isEmpty() || mode.getValue() != mode_attr::read) 821 return; 822 823 int size = this->enabledFields.size(); 824 for (int i = 0; i < size; ++i) 825 { 798 826 this->enabledFields[i]->sendReadDataRequestIfNeeded(); 799 827 } -
XIOS/trunk/src/node/file.hpp
r1318 r1358 106 106 void solveAllRefOfEnabledFields(bool sendToServer); 107 107 void buildFilterGraphOfEnabledFields(CGarbageCollector& gc); 108 void postProcessFilterGraph(); 108 109 void prefetchEnabledReadModeFields(); 110 void doPreTimestepOperationsForEnabledReadModeFields(); 109 111 void doPostTimestepOperationsForEnabledReadModeFields(); 110 112
Note: See TracChangeset
for help on using the changeset viewer.