- Timestamp:
- 09/17/20 17:23:21 (4 years ago)
- 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__ 3 3 4 4 #include "output_pin.hpp" … … 52 52 } // namespace xios 53 53 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 150 150 CATCH 151 151 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 166 153 void CField::recvUpdateData(CEventServer& event) 167 154 TRY … … 263 250 CATCH_DUMP_ATTR 264 251 265 266 void CField::sendUpdateDataServerToClient(bool isEOF, const CArray<double,1>& data, CContextClient* client)267 TRY268 {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 else293 {294 client->sendEvent(event);295 }296 }297 else298 {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 else309 {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_ATTR321 322 252 323 253 /* … … 344 274 345 275 /* old interface to be removed ..*/ 276 /* 346 277 void CField::recvUpdateDataFromCoupler(std::map<int,CBufferIn*>& rankBuffers) 347 278 TRY … … 378 309 } 379 310 CATCH_DUMP_ATTR 380 311 */ 381 312 382 313 /*! … … 386 317 */ 387 318 // old interface to remove 319 /* 388 320 void CField::recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers) 389 321 TRY … … 425 357 } 426 358 CATCH_DUMP_ATTR 427 359 */ 428 360 429 361 void CField::checkForLateDataFromCoupler(void) … … 1100 1032 { 1101 1033 // 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)); 1103 1035 // 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); 1105 1037 } 1106 1038 … … 1108 1040 { 1109 1041 // 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); 1112 1044 } 1113 1045 … … 1186 1118 void CField::connectToFileWriter(CGarbageCollector& gc) 1187 1119 { 1188 file ServerWriterFilter = std::shared_ptr<CFileServerWriterFilter>(new CFileServerWriterFilter(gc, this));1189 instantDataFilter->connectOutput(file ServerWriterFilter, 0);1120 fileWriterStoreFilter_ = std::shared_ptr<CFileWriterStoreFilter>(new CFileWriterStoreFilter(gc, this)); 1121 instantDataFilter->connectOutput(fileWriterStoreFilter_, 0); 1190 1122 } 1191 1123 … … 1266 1198 TRY 1267 1199 { 1200 // ==> before removing, solving dependency in spatial_transform_filter.cpp about auxilairy field 1201 /* 1268 1202 if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform(); 1269 1203 if (!isGridChecked) checkGridOfEnabledFields(); … … 1366 1300 } 1367 1301 } 1302 */ 1368 1303 } 1369 1304 CATCH_DUMP_ATTR -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp
r1934 r1935 24 24 #include "client_to_model_store_filter.hpp" 25 25 #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 26 31 27 32 … … 47 52 class COutputPin; 48 53 class CSourceFilter; 49 class CFileWriterFilter;50 class CFileServerWriterFilter;51 class CFileReaderSourceFilter;52 54 class CServerToClientFilter; 53 class CModelToClientSourceFilter;54 class CServerFromClientSourceFilter;55 55 ///-------------------------------------------------------------- 56 56 … … 405 405 406 406 //! The source filter for data provided by the client 407 std::shared_ptr<CSourceFilter> clientSourceFilter; // obsolete to remove407 // std::shared_ptr<CSourceFilter> clientSourceFilter; // obsolete to remove 408 408 409 409 //! The source filter for data provided by the model to enter the client workflow … … 426 426 427 427 //! The source filter for data provided by the server 428 std::shared_ptr<CSourceFilter> serverSourceFilter; // obsolete to remove428 // std::shared_ptr<CSourceFilter> serverSourceFilter; // obsolete to remove 429 429 430 //! The terminal filter which writes the data to file431 std::shared_ptr<C FileWriterFilter> fileWriterFilter;430 //! The terminal filter which send data to server for writing 431 std::shared_ptr<CClientToServerStoreFilter> clientToServerStoreFilter_; 432 432 433 433 //! The terminal filter which writes data to file 434 std::shared_ptr<CFile ServerWriterFilter> fileServerWriterFilter;434 std::shared_ptr<CFileWriterStoreFilter> fileWriterStoreFilter_; 435 435 436 436 //! The terminal filter which send data from server to client
Note: See TracChangeset
for help on using the changeset viewer.