Changeset 1935


Ignore:
Timestamp:
09/17/20 17:23:21 (12 months ago)
Author:
ymipsl
Message:

XIOS coupling.
Reorganize filters, update of the day.

YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src
Files:
4 added
4 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/file_reader_source_filter.hpp

    r1930 r1935  
    1 #ifndef __XIOS_FILE_READER_SOURCE_FILTER__ 
    2 #define __XIOS_FILE_READER_SOURCE_FILTER__ 
     1#ifndef  __XIOS_FILE_READER_SOURCE_FILTER_HPP__ 
     2#define  __XIOS_FILE_READER_SOURCE_FILTER_HPP__ 
    33 
    44#include "output_pin.hpp" 
     
    5252} // namespace xios 
    5353 
    54 #endif // __XIOS_FILE_READER_SOURCE_FILTER__ 
     54#endif //  __XIOS_FILE_READER_SOURCE_FILTER_HPP__ 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp

    r1934 r1935  
    150150  CATCH 
    151151 
    152   void CField::sendUpdateData(Time timeStamp, const CArray<double,1>& data, CContextClient* client) 
    153   TRY 
    154   { 
    155     CTimer::get("Field : send data").resume(); 
    156     CEventClient event(getType(), EVENT_ID_UPDATE_DATA); 
    157     CMessage message ; 
    158  
    159     message<<getId() << timeStamp ; 
    160     this->getGrid()->getClientToServerConnector(client)->transfer(data, client, event, message) ; 
    161     CTimer::get("Field : send data").suspend(); 
    162   } 
    163   CATCH_DUMP_ATTR 
    164  
    165    
     152 
    166153  void CField::recvUpdateData(CEventServer& event) 
    167154  TRY 
     
    263250  CATCH_DUMP_ATTR   
    264251 
    265  
    266   void CField::sendUpdateDataServerToClient(bool isEOF, const CArray<double,1>& data, CContextClient* client) 
    267   TRY 
    268   { 
    269     CEventClient event(getType(), EVENT_ID_READ_DATA_READY); 
    270     std::list<CMessage> msgs; 
    271     if (!grid_->doGridHaveDataDistributed(client)) 
    272     { 
    273        if (client->isServerLeader()) 
    274        { 
    275           if (0 != data.numElements()) 
    276           {             
    277             const std::list<int>& ranks = client->getRanksServerLeader(); 
    278             for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    279             { 
    280               msgs.push_back(CMessage()); 
    281               CMessage& msg = msgs.back(); 
    282               msg << getId(); 
    283                
    284               if (isEOF)  msg << int(-1); 
    285               else msg << getNStep() - 1 << data; 
    286           
    287               event.push(*itRank, 1, msg); 
    288             } 
    289           } 
    290           client->sendEvent(event); 
    291        } 
    292        else 
    293        { 
    294           client->sendEvent(event); 
    295        } 
    296     } 
    297     else 
    298     { 
    299       auto& outLocalIndexStoreOnClient = grid_-> getOutLocalIndexStoreOnClient() ; 
    300       for (auto it = outLocalIndexStoreOnClient.begin(); it != outLocalIndexStoreOnClient.end(); ++it) 
    301       { 
    302          
    303  
    304         msgs.push_back(CMessage()); 
    305         CMessage& msg = msgs.back(); 
    306         msg << getId(); 
    307         if (isEOF) msg << int(-1); 
    308         else  
    309         { 
    310           CArray<size_t,1>& indexTmp = it->second; 
    311           CArray<double,1> tmp(indexTmp.numElements()); 
    312           for (int idx = 0; idx < indexTmp.numElements(); ++idx) tmp(idx) = data(indexTmp(idx)); 
    313           msg << getNStep() - 1 << tmp; 
    314         } 
    315         event.push(it->first, grid_->getNbReadSenders(client)[it->first], msg); 
    316       } 
    317       client->sendEvent(event); 
    318     } 
    319   } 
    320   CATCH_DUMP_ATTR 
    321  
    322252   
    323253  /* 
     
    344274 
    345275  /* old interface to be removed ..*/ 
     276/* 
    346277  void CField::recvUpdateDataFromCoupler(std::map<int,CBufferIn*>& rankBuffers) 
    347278  TRY 
     
    378309  } 
    379310  CATCH_DUMP_ATTR 
    380   
     311*/  
    381312 
    382313  /*! 
     
    386317  */ 
    387318  // old interface to remove  
     319/* 
    388320  void CField::recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers) 
    389321  TRY 
     
    425357  } 
    426358  CATCH_DUMP_ATTR 
    427  
     359*/ 
    428360 
    429361  void CField::checkForLateDataFromCoupler(void) 
     
    11001032  { 
    11011033    // insert temporal filter before sending to files 
    1102     fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, client)); 
     1034    clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client)); 
    11031035    // insert temporal filter before sending to files 
    1104     getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(fileWriterFilter, 0); 
     1036    getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(clientToServerStoreFilter_, 0); 
    11051037  }  
    11061038 
     
    11081040  { 
    11091041    // insert temporal filter before sending to files 
    1110     fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, client)); 
    1111     instantDataFilter->connectOutput(fileWriterFilter, 0); 
     1042    clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client)); 
     1043    instantDataFilter->connectOutput(clientToServerStoreFilter_, 0); 
    11121044  }  
    11131045 
     
    11861118  void CField::connectToFileWriter(CGarbageCollector& gc) 
    11871119  { 
    1188     fileServerWriterFilter = std::shared_ptr<CFileServerWriterFilter>(new CFileServerWriterFilter(gc, this)); 
    1189     instantDataFilter->connectOutput(fileServerWriterFilter, 0); 
     1120    fileWriterStoreFilter_ = std::shared_ptr<CFileWriterStoreFilter>(new CFileWriterStoreFilter(gc, this)); 
     1121    instantDataFilter->connectOutput(fileWriterStoreFilter_, 0); 
    11901122  }  
    11911123 
     
    12661198  TRY 
    12671199  {      
     1200   //  ==> before removing, solving dependency in spatial_transform_filter.cpp about auxilairy field 
     1201/* 
    12681202    if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform(); 
    12691203    if (!isGridChecked) checkGridOfEnabledFields(); 
     
    13661300      } 
    13671301    } 
     1302*/   
    13681303  } 
    13691304  CATCH_DUMP_ATTR 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp

    r1934 r1935  
    2424#include "client_to_model_store_filter.hpp" 
    2525#include "server_to_client_store_filter.hpp" 
     26#include "server_from_client_source_filter.hpp" 
     27#include "file_writer_store_filter.hpp" 
     28#include "client_to_server_store_filter.hpp" 
     29#include "file_reader_source_filter.hpp" 
     30 
    2631 
    2732 
     
    4752   class COutputPin; 
    4853   class CSourceFilter; 
    49    class CFileWriterFilter; 
    50    class CFileServerWriterFilter; 
    51    class CFileReaderSourceFilter; 
    5254   class CServerToClientFilter; 
    53    class CModelToClientSourceFilter; 
    54    class CServerFromClientSourceFilter; 
    5555   ///-------------------------------------------------------------- 
    5656 
     
    405405 
    406406         //! The source filter for data provided by the client 
    407          std::shared_ptr<CSourceFilter> clientSourceFilter; // obsolete to remove 
     407//         std::shared_ptr<CSourceFilter> clientSourceFilter; // obsolete to remove 
    408408  
    409409         //! The source filter for data provided by the model to enter the client workflow 
     
    426426 
    427427         //! The source filter for data provided by the server 
    428          std::shared_ptr<CSourceFilter> serverSourceFilter; // obsolete to remove 
     428//         std::shared_ptr<CSourceFilter> serverSourceFilter; // obsolete to remove 
    429429         
    430          //! The terminal filter which writes the data to file 
    431          std::shared_ptr<CFileWriterFilter> fileWriterFilter; 
     430         //! The terminal filter which send data to server for writing 
     431         std::shared_ptr<CClientToServerStoreFilter> clientToServerStoreFilter_; 
    432432         
    433433         //! The terminal filter which writes data to file 
    434          std::shared_ptr<CFileServerWriterFilter> fileServerWriterFilter; 
     434         std::shared_ptr<CFileWriterStoreFilter> fileWriterStoreFilter_; 
    435435 
    436436         //! The terminal filter which send data from server to client 
Note: See TracChangeset for help on using the changeset viewer.