Changeset 2482
- Timestamp:
- 03/28/23 16:42:11 (15 months ago)
- Location:
- XIOS3/dev/XIOS_ATTACHED/src
- Files:
-
- 8 added
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/dev/XIOS_ATTACHED/src/config/domain_attribute.conf
r2395 r2482 59 59 60 60 DECLARE_ARRAY(double, 2, area, false) 61 DECLARE_ARRAY(double, 2, area_2d, false) 62 DECLARE_ARRAY(double, 1, area_1d, false) 61 63 DECLARE_ATTRIBUTE(double, radius) 62 64 -
XIOS3/dev/XIOS_ATTACHED/src/config/redistribute_axis_attribute.conf
r2460 r2482 1 DECLARE_ARRAY(int,1, index, false) 2 DECLARE_ARRAY(bool, 1 , mask, false) 3 DECLARE_ENUM5(type, index, root, bands, column, full) -
XIOS3/dev/XIOS_ATTACHED/src/config/redistribute_domain_attribute.conf
r2460 r2482 1 DECLARE_ARRAY(int,1, index, false) 2 DECLARE_ARRAY(bool, 1 , mask, false) 3 DECLARE_ENUM5(type, index, root, bands, column, full) -
XIOS3/dev/XIOS_ATTACHED/src/config/redistribute_scalar_attribute.conf
r2460 r2482 1 DECLARE_ARRAY(int,1, index, false) 2 DECLARE_ARRAY(bool, 1 , mask, false) 3 DECLARE_ENUM5(type, index, root, bands, column, full) -
XIOS3/dev/XIOS_ATTACHED/src/distribution/grid_remote_connector.cpp
r2397 r2482 99 99 size_t globalIndexSize = globalIndex.numElements() ; 100 100 101 size_t allEqual ; 102 MPI_Allreduce(&globalIndexSize, &allEqual, 1, MPI_SIZE_T, MPI_BXOR, localComm_) ; 103 if (allEqual!=0) 101 size_t minVal,maxVal ; 102 MPI_Allreduce(&globalIndexSize, &minVal, 1, MPI_SIZE_T, MPI_MIN, localComm_) ; 103 MPI_Allreduce(&globalIndexSize, &maxVal, 1, MPI_SIZE_T, MPI_MAX, localComm_) ; 104 if (minVal!=maxVal) 104 105 { 105 106 isSrcViewDistributed_[i]=true ; … … 110 111 size_t hashValue=0 ; 111 112 for(size_t ind=0;ind<globalIndexSize;ind++) hashValue += hashGlobalIndex(globalIndex(ind)) ; 112 MPI_Allreduce(&hashValue, &allEqual, 1, MPI_SIZE_T, MPI_BXOR, localComm_) ; 113 if (allEqual!=0) isSrcViewDistributed_[i]=true ; 113 MPI_Allreduce(&hashValue, &minVal, 1, MPI_SIZE_T, MPI_MIN, localComm_) ; 114 MPI_Allreduce(&hashValue, &maxVal, 1, MPI_SIZE_T, MPI_MAX, localComm_) ; 115 if (minVal!=maxVal) isSrcViewDistributed_[i]=true ; 114 116 else isSrcViewDistributed_[i]=false ; 115 117 } -
XIOS3/dev/XIOS_ATTACHED/src/distribution/transform_connector.hpp
r2267 r2482 32 32 33 33 public: 34 35 34 36 template<typename T> 35 void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut )37 void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut, bool useMissingValue, T missingValue) 36 38 { 37 39 map<int,CArray<T,1>> tmpArrayIn ; … … 58 60 MPI_Waitall(requests.size(), requests.data(),status.data()) ; 59 61 60 const double nanValue = std::numeric_limits<double>::quiet_NaN(); 61 gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut, nanValue) ; 62 if (useMissingValue) gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut, missingValue) ; 63 else gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut) ; 64 // const double nanValue = std::numeric_limits<double>::quiet_NaN(); 65 // gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut, nanValue) ; 66 } 67 68 template<typename T> 69 void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut) 70 { 71 T missingValue ; 72 transfer(1, sizeT, dataIn, dataOut, false, missingValue) ; 73 } 74 75 template<typename T> 76 void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut, T missingValue) 77 { 78 transfer(1, sizeT, dataIn, dataOut, true, missingValue) ; 62 79 } 63 80 … … 66 83 { 67 84 transfer(1, sizeT, dataIn, dataOut) ; 85 } 86 87 template<typename T> 88 void transfer(int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut, T missingValue) 89 { 90 transfer(1, sizeT, dataIn, dataOut, missingValue) ; 68 91 } 69 92 … … 74 97 } 75 98 99 template<typename T> 100 void transfer(const CArray<T,1>& dataIn, CArray<T,1>& dataOut, T missingValue) 101 { 102 transfer(1, 1, dataIn, dataOut, missingValue) ; 103 } 104 76 105 }; 77 106 -
XIOS3/dev/XIOS_ATTACHED/src/filter/file_writer_store_filter.cpp
r2143 r2482 29 29 if (!field->prec.isEmpty() && field->prec == 2) hasRounding_ = true ; 30 30 if (!field->default_value.isEmpty()) {hasDefaultValue_=true ; defaultValue_ = field->default_value ;} 31 context->registerFileToWrite(file_) ; 31 32 } 32 33 -
XIOS3/dev/XIOS_ATTACHED/src/io/nc4_data_input.cpp
r2338 r2482 81 81 if ((domain->type) != CDomain::type_attr::unstructured) 82 82 { 83 start.push_back(domain->jbegin );84 count.push_back(domain->nj );83 start.push_back(domain->jbeginValue_); 84 count.push_back(domain->njValue_); 85 85 } 86 start.push_back(domain->ibegin );87 count.push_back(domain->ni );86 start.push_back(domain->ibeginValue_); 87 count.push_back(domain->niValue_); 88 88 --idxDomain; 89 89 } … … 131 131 // Verify the compatibility of dimension of declared grid and real grid in file 132 132 int realGridDim = 1; 133 bool isUnstructuredGrid = ((gridDim < 2 ) ? false : SuperClassWriter::isUnstructured(fieldId));133 bool isUnstructuredGrid = ((gridDim < 2 || domainP.size()==0) ? false : SuperClassWriter::isUnstructured(fieldId)); 134 134 std::map<StdString, StdSize> dimSizeMap = SuperClassWriter::getDimensions(&fieldId); 135 135 std::list<StdString> dimList = SuperClassWriter::getDimensionsList(&fieldId); -
XIOS3/dev/XIOS_ATTACHED/src/io/nc4_data_output.cpp
r2436 r2482 202 202 else bounds_latid = "bounds_"+latName+appendDomid; 203 203 204 SuperClassWriter::addDimension(dimXid, domain->ni );205 SuperClassWriter::addDimension(dimYid, domain->nj );204 SuperClassWriter::addDimension(dimXid, domain->niValue_); 205 SuperClassWriter::addDimension(dimYid, domain->njValue_); 206 206 207 207 if (domain->hasBounds) … … 210 210 if (context->intraCommSize_ > 1) 211 211 { 212 this->writeLocalAttributes(domain->ibegin ,213 domain->ni ,214 domain->jbegin ,215 domain->nj ,212 this->writeLocalAttributes(domain->ibeginValue_, 213 domain->niValue_, 214 domain->jbeginValue_, 215 domain->njValue_, 216 216 appendDomid); 217 217 218 218 if (singleDomain) 219 219 this->writeLocalAttributes_IOIPSL(dimXid, dimYid, 220 domain->ibegin ,221 domain->ni ,222 domain->jbegin ,223 domain->nj ,220 domain->ibeginValue_, 221 domain->niValue_, 222 domain->jbeginValue_, 223 domain->njValue_, 224 224 domain->ni_glo,domain->nj_glo, 225 225 context->intraCommRank_,context->intraCommSize_); … … 373 373 std::vector<StdSize> start(2) ; 374 374 std::vector<StdSize> count(2) ; 375 start[1]=domain->ibegin ;376 start[0]=domain->jbegin ;377 count[1]=domain->ni ; count[0]=domain->nj;375 start[1]=domain->ibeginValue_; 376 start[0]=domain->jbeginValue_; 377 count[1]=domain->niValue_ ; count[0]=domain->njValue_ ; 378 378 379 379 if (domain->hasLonLat) … … 391 391 std::vector<StdSize> count(1) ; 392 392 393 start[0]=domain->jbegin ;394 count[0]=domain->nj ;393 start[0]=domain->jbeginValue_; 394 count[0]=domain->njValue_; 395 395 CArray<double,1> lat; 396 lat.resize( domain->nj .getValue());397 for (int j=0;j<domain->nj .getValue();j++) lat(j) = domain->latvalue(j*domain->ni.getValue());396 lat.resize( domain->njValue_); 397 for (int j=0;j<domain->njValue_;j++) lat(j) = domain->latvalue(j*domain->niValue_); 398 398 SuperClassWriter::writeData(CArray<double,1>(lat.copy()), latid, isCollective, 0,&start,&count); 399 399 400 start[0]=domain->ibegin ;401 count[0]=domain->ni ;402 CArray<double,1> lon = domain->lonvalue(Range(0,domain->ni -1));400 start[0]=domain->ibeginValue_; 401 count[0]=domain->niValue_; 402 CArray<double,1> lon = domain->lonvalue(Range(0,domain->niValue_-1)); 403 403 SuperClassWriter::writeData(CArray<double,1>(lon.copy()), lonid, isCollective, 0,&start,&count); 404 404 } … … 419 419 { 420 420 start[2] = 0; 421 start[1] = domain->ibegin ;422 start[0] = domain->jbegin ;421 start[1] = domain->ibeginValue_; 422 start[0] = domain->jbeginValue_; 423 423 count[2] = domain->nvertex; 424 count[1] = domain->ni ;425 count[0] = domain->nj ;424 count[1] = domain->niValue_; 425 count[0] = domain->njValue_; 426 426 } 427 427 … … 435 435 std::vector<StdSize> count(2); 436 436 437 start[1] = domain->ibegin ;438 start[0] = domain->jbegin ;439 count[1] = domain->ni ;440 count[0] = domain->nj ;437 start[1] = domain->ibeginValue_; 438 start[0] = domain->jbeginValue_; 439 count[1] = domain->niValue_; 440 count[0] = domain->njValue_; 441 441 442 442 SuperClassWriter::writeData(domain->areavalue, areaId, isCollective, 0, &start, &count); … … 703 703 else 704 704 { 705 startNodes[0] = domain->ibegin ;706 countNodes[0] = domain->ni ;705 startNodes[0] = domain->ibeginValue_; 706 countNodes[0] = domain->niValue_ ; 707 707 } 708 708 … … 726 726 else 727 727 { 728 startEdges[0] = domain->ibegin ;729 countEdges[0] = domain->ni ;728 startEdges[0] = domain->ibeginValue_; 729 countEdges[0] = domain->niValue_; 730 730 startNodes[0] = domain->mesh->node_start; 731 731 countNodes[0] = domain->mesh->node_count; 732 732 if (countNodes[0]==0) startNodes[0]=0 ; // for netcdf error 733 startEdgeNodes[0] = domain->ibegin ;733 startEdgeNodes[0] = domain->ibeginValue_; 734 734 startEdgeNodes[1] = 0; 735 countEdgeNodes[0] = domain->ni ;735 countEdgeNodes[0] = domain->niValue_; 736 736 countEdgeNodes[1] = 2; 737 737 } … … 763 763 else 764 764 { 765 startFaces[0] = domain->ibegin ;766 countFaces[0] = domain->ni ;765 startFaces[0] = domain->ibeginValue_; 766 countFaces[0] = domain->niValue_ ; 767 767 startNodes[0] = domain->mesh->node_start; 768 768 countNodes[0] = domain->mesh->node_count; … … 785 785 countEdgeFaces[1]= 2; 786 786 787 startFaceConctv[0] = domain->ibegin ;788 countFaceConctv[0] = domain->ni ;787 startFaceConctv[0] = domain->ibeginValue_; 788 countFaceConctv[0] = domain->niValue_; 789 789 startFaceConctv[1] = 0; 790 790 countFaceConctv[1] = domain->nvertex; … … 998 998 else 999 999 { 1000 start[0]=domain->ibegin ;1001 count[0]=domain->ni ;1002 startBounds[0]=domain->ibegin ;1000 start[0]=domain->ibeginValue_; 1001 count[0]=domain->niValue_; 1002 startBounds[0]=domain->ibeginValue_; 1003 1003 startBounds[1]=0 ; 1004 countBounds[0]=domain->ni ;1004 countBounds[0]=domain->niValue_; 1005 1005 countBounds[1]=nvertex ; 1006 1006 } … … 1110 1110 if (!axis->label.isEmpty() && !SuperClassWriter::dimExist(strId)) SuperClassWriter::addDimension(strId, stringArrayLen); 1111 1111 1112 if (axis->hasValue || !axis->label.isEmpty())1112 if (axis->hasValue() || !axis->label.isEmpty()) 1113 1113 { 1114 1114 if (!axis->label.isEmpty()) dims.push_back(strId); … … 1499 1499 } 1500 1500 1501 firstGlobalIndex = domain->ibegin + domain->jbegin* domain->ni_glo;1501 firstGlobalIndex = domain->ibeginValue_ + domain->jbeginValue_ * domain->ni_glo; 1502 1502 1503 1503 domain->addRelFileCompressed(this->filename); … … 2322 2322 if ((domain->type) != CDomain::type_attr::unstructured) 2323 2323 { 2324 start.push_back(domain->jbegin );2325 count.push_back(domain->nj );2324 start.push_back(domain->jbeginValue_); 2325 count.push_back(domain->njValue_); 2326 2326 } 2327 2327 --idx; 2328 start.push_back(domain->ibegin );2329 count.push_back(domain->ni );2328 start.push_back(domain->ibeginValue_); 2329 count.push_back(domain->niValue_); 2330 2330 --idx; 2331 2331 } … … 2382 2382 if ((domain->type) != CDomain::type_attr::unstructured) 2383 2383 { 2384 start.push_back(domain->jbegin );2385 count.push_back(domain->nj );2384 start.push_back(domain->jbeginValue_); 2385 count.push_back(domain->njValue_); 2386 2386 } 2387 2387 --idx ; 2388 2388 2389 start.push_back(domain->ibegin );2390 count.push_back(domain->ni );2389 start.push_back(domain->ibeginValue_); 2390 count.push_back(domain->niValue_); 2391 2391 --idx ; 2392 2392 --idxDomain; -
XIOS3/dev/XIOS_ATTACHED/src/mpi_tools.cpp
r2118 r2482 28 28 29 29 template<> 30 MPI_Datatype MPI_GetType<bool>(void) { return MPI_CXX_BOOL ;} 31 32 template<> 30 33 MPI_Datatype MPI_GetType<char>(void) { return MPI_CHAR ;} 31 34 -
XIOS3/dev/XIOS_ATTACHED/src/node/axis.cpp
r2461 r2482 24 24 : CObjectTemplate<CAxis>() 25 25 , CAxisAttributes(), isChecked(false), relFiles() 26 , hasBounds (false), isCompressible_(false)27 , transformationMap_() , hasValue(false), hasLabel(false)26 , hasBounds_(false), isCompressible_(false) 27 , transformationMap_() 28 28 , clients() 29 29 { … … 33 33 : CObjectTemplate<CAxis>(id) 34 34 , CAxisAttributes(), isChecked(false), relFiles() 35 , hasBounds (false), isCompressible_(false)36 , transformationMap_() , hasValue(false), hasLabel(false)35 , hasBounds_(false), isCompressible_(false) 36 , transformationMap_() 37 37 , clients() 38 38 { … … 167 167 size += CArray<bool,1>::size(n_glo); 168 168 size += CArray<double,1>::size(n_glo); 169 if (hasBounds )169 if (hasBounds_) 170 170 size += CArray<double,2>::size(2*n_glo); 171 if (hasLabel )171 if (hasLabel_) 172 172 size += CArray<StdString,1>::size(n_glo); 173 173 } … … 200 200 size += CArray<bool,1>::size(it->second.size()); 201 201 size += CArray<double,1>::size(it->second.size()); 202 if (hasBounds )202 if (hasBounds_) 203 203 size += CArray<double,2>::size(2 * it->second.size()); 204 if (hasLabel )204 if (hasLabel_) 205 205 size += CArray<StdString,1>::size(it->second.size()); 206 206 … … 459 459 << ") than the one defined by the \'size\' attribute (" << n.getValue() << ").") 460 460 else return false ; 461 this->hasValue = true;461 this->hasValue_ = true; 462 462 } 463 463 … … 569 569 << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) << ".") 570 570 else return false ; 571 hasBounds = true;572 } 573 else hasBounds = false;571 hasBounds_ = true; 572 } 573 else hasBounds_ = false; 574 574 return true ; 575 575 } … … 587 587 << "label size is "<< label.extent(0)<< " .") 588 588 else return false ; 589 hasLabel = true;590 } 591 else hasLabel = false;589 hasLabel_ = true; 590 } 591 else hasLabel_ = false; 592 592 return true ; 593 593 } … … 1165 1165 CContext* context = CContext::getCurrent(); 1166 1166 1167 if (hasValue )1167 if (hasValue_) 1168 1168 { 1169 1169 { // send level value … … 1175 1175 } 1176 1176 1177 if (hasBounds )1177 if (hasBounds_) 1178 1178 { 1179 1179 { // send bounds level value … … 1185 1185 } 1186 1186 1187 if (hasLabel )1187 if (hasLabel_) 1188 1188 { 1189 1189 { // send label -
XIOS3/dev/XIOS_ATTACHED/src/node/axis.hpp
r2397 r2482 175 175 bool isEqual(CAxis* axis); 176 176 177 public: 178 bool hasValue; 179 bool hasBounds; 180 bool hasLabel; 177 private: 178 bool hasValue_= false; 179 bool hasBounds_= false; 180 bool hasLabel_= false; 181 public: 182 bool hasValue(void) { return hasValue_ ;} 183 bool hasBounds(void) { return hasBounds_ ;} 184 bool hasLabel(void) { return hasLabel_ ;} 181 185 182 186 private: -
XIOS3/dev/XIOS_ATTACHED/src/node/context.cpp
r2458 r2482 7 7 #include "duration.hpp" 8 8 9 #include "online_context_client.hpp" 9 10 #include "legacy_context_client.hpp" 10 11 #include "legacy_context_server.hpp" … … 678 679 vector<CContextClient*> CContext::getContextClient(const string& poolId, const string& serviceId) 679 680 { 680 vector<pair<CContextClient*,CContextServer*>> clientServers ; 681 getServerInterComm(poolId, serviceId, clientServers ) ; 682 vector<CContextClient*> ret ; 683 for(auto& clientServer : clientServers) ret.push_back(clientServer.first) ; 681 vector<CContextClient*> ret ; 682 683 if (serviceId=="attached") ret.push_back(onlineContextClient_) ; 684 else 685 { 686 vector<pair<CContextClient*,CContextServer*>> clientServers ; 687 getServerInterComm(poolId, serviceId, clientServers ) ; 688 for(auto& clientServer : clientServers) ret.push_back(clientServer.first) ; 689 } 684 690 return ret ; 685 691 } … … 807 813 if (serviceType_==CServicesManager::CLIENT) 808 814 { 809 //ym doPreTimestepOperationsForEnabledReadModeFiles(); // For now we only use server level 1 to read data810 815 triggerLateFields() ; 811 816 … … 985 990 986 991 CTimer::get("Context : close definition").resume() ; 992 993 onlineContextClient_=CContextClient::getNew<CContextClient::online>(this,intraComm_, intraComm_); 987 994 988 995 // create intercommunicator with servers. … … 1145 1152 { 1146 1153 for(auto field : fileInField) 1147 { 1148 field->sendFieldToInputFileServer() ; 1149 field->connectToServerInput(garbageCollector) ; // connect the field to server filter 1154 if (field->getContextClient()->getType() != CContextClient::online) field->sendFieldToInputFileServer() ; 1155 1156 for(auto field : fileInField) 1157 { 1158 if (field->getContextClient()->getType() == CContextClient::online) field->connectToOnlineReader(garbageCollector) ; 1159 else field->connectToServerInput(garbageCollector) ; // connect the field to server filter 1150 1160 fileInFields_.push_back(field) ; 1151 1161 } … … 1157 1167 for(auto field : fileOutField) 1158 1168 { 1159 field->connectToFileServer(garbageCollector) ; // connect the field to server filter 1160 } 1161 for(auto field : fileOutField) field->sendFieldToFileServer() ; 1169 if (field->getContextClient()->getType() == CContextClient::online) field->connectToOnlineWriter(garbageCollector) ; 1170 else field->connectToFileServer(garbageCollector) ; // connect the field to server filter 1171 } 1172 for(auto field : fileOutField) 1173 if (field->getContextClient()->getType() != CContextClient::online) field->sendFieldToFileServer() ; 1162 1174 } 1163 1175 … … 1176 1188 for(auto field : fileInField) 1177 1189 { 1178 field->connectToServerToClient(garbageCollector) ; 1190 if (field->getContextClient()->getType() == CContextClient::online) field->connectToOnlineReader(garbageCollector) ; 1191 else field->connectToServerToClient(garbageCollector) ; 1179 1192 } 1180 1193 } … … 1231 1244 if (serviceType_==CServicesManager::CLIENT) 1232 1245 { 1233 for(auto field : fileOutField) slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ; 1234 for(auto field : fileInField) slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ; 1246 for(auto field : fileOutField) 1247 if (field->getContextClient()->getType()!=CContextClient::online) slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ; 1248 for(auto field : fileInField) 1249 if (field->getContextClient()->getType()!=CContextClient::online) slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ; 1235 1250 } 1236 1251 else if (serviceType_==CServicesManager::GATHERER) … … 1241 1256 for(auto& slaveServer : slaveServers_) sendCloseDefinition(slaveServer) ; 1242 1257 1243 if (serviceType_==CServicesManager::WRITER) 1244 { 1245 createFileHeader(); 1246 } 1247 1248 if (serviceType_==CServicesManager::CLIENT) startPrefetchingOfEnabledReadModeFiles(); 1258 createFileHeader(); 1259 1260 //if (serviceType_==CServicesManager::CLIENT) startPrefetchingOfEnabledReadModeFiles(); 1261 if (serviceType_==CServicesManager::CLIENT) 1262 for(auto field : fileInField) field->sendReadDataRequest(getCalendar()->getCurrentDate()); 1249 1263 1250 1264 // send signal to couplerIn context that definition phasis is done … … 1355 1369 CATCH_DUMP_ATTR 1356 1370 1357 1358 void CContext::postProcessFilterGraph()1359 TRY1360 {1361 int size = enabledFiles.size();1362 for (int i = 0; i < size; ++i)1363 {1364 enabledFiles[i]->postProcessFilterGraph();1365 }1366 }1367 CATCH_DUMP_ATTR1368 1369 1371 void CContext::startPrefetchingOfEnabledReadModeFiles() 1370 1372 TRY … … 1374 1376 { 1375 1377 enabledReadModeFiles[i]->prefetchEnabledReadModeFields(); 1376 }1377 }1378 CATCH_DUMP_ATTR1379 1380 void CContext::doPreTimestepOperationsForEnabledReadModeFiles()1381 TRY1382 {1383 int size = enabledReadModeFiles.size();1384 for (int i = 0; i < size; ++i)1385 {1386 enabledReadModeFiles[i]->doPreTimestepOperationsForEnabledReadModeFields();1387 1378 } 1388 1379 } … … 2176 2167 if (serviceType_==CServicesManager::CLIENT) // For now we only use server level 1 to read data 2177 2168 { 2178 doPostTimestepOperationsForEnabledReadModeFiles(); 2169 // doPostTimestepOperationsForEnabledReadModeFiles(); 2170 for(auto& field : fileInFields_) field->sendReadDataRequestIfNeeded() ; 2179 2171 garbageCollector.invalidate(calendar->getCurrentDate()); 2180 2172 } … … 2201 2193 CATCH_DUMP_ATTR 2202 2194 2203 //! Server side:Create header of netcdf file2195 //! Create header of netcdf file 2204 2196 void CContext::createFileHeader(void) 2205 2197 TRY 2206 2198 { 2207 vector<CFile*>::const_iterator it; 2208 2209 //for (it=enabledFiles.begin(); it != enabledFiles.end(); it++) 2210 for (it=enabledWriteModeFiles.begin(); it != enabledWriteModeFiles.end(); it++) 2211 { 2212 (*it)->initWrite(); 2213 } 2199 for(auto& file : filesToWrite_) file->initWrite(); 2214 2200 } 2215 2201 CATCH_DUMP_ATTR -
XIOS3/dev/XIOS_ATTACHED/src/node/context.hpp
r2458 r2482 141 141 void initReadFiles(void); 142 142 void prepareTimeseries(void); 143 void postProcessFilterGraph();144 143 void startPrefetchingOfEnabledReadModeFiles(); 145 void doPreTimestepOperationsForEnabledReadModeFiles();146 144 void doPostTimestepOperationsForEnabledReadModeFiles(); 147 145 void findFieldsWithReadAccess(void); … … 298 296 // Determine context on server or not 299 297 bool hasServer; 300 298 public: 299 void registerFileToWrite(CFile* file) { filesToWrite_.insert(file); } // Add a file that need to be write for example to create headers 300 private: 301 std::set<CFile*> filesToWrite_ ; 301 302 302 303 private: 304 CContextClient* onlineContextClient_=nullptr ; 305 303 306 std::string defaultPoolWriterId_ ; 304 307 std::string defaultPoolReaderId_ ; -
XIOS3/dev/XIOS_ATTACHED/src/node/domain.cpp
r2461 r2482 293 293 \param [in] nbLocalDomain number of local domain on the domain destination 294 294 */ 295 295 296 void CDomain::redistribute(int nbLocalDomain) 296 297 TRY … … 862 863 863 864 864 if (!area.isEmpty()) area.transposeSelf(1, 0); // => to be checked why is it transposed865 // if (!area.isEmpty()) area.transposeSelf(1, 0); // => to be checked why is it transposed 865 866 } 866 867 … … 914 915 CATCH_DUMP_ATTR 915 916 917 void CDomain::compute2dBox(void) 918 { 919 if (i_index.numElements()==0) 920 { 921 ibeginValue_= 0 ; 922 jbeginValue_= 0 ; 923 niValue_= 0 ; 924 njValue_= 0 ; 925 } 926 else 927 { 928 int maxI=0 ; 929 int maxJ=0 ; 930 int minI=nj_glo*ni_glo ; 931 int minJ=nj_glo*ni_glo ; 932 int i,j,k,ij ; 933 for(int k=0; k<i_index.numElements(); k++) 934 { 935 ij=j_index(k)*ni_glo + i_index(k) ; 936 i=ij%ni_glo ; 937 j=ij/ni_glo ; 938 if (i<minI) minI=i; 939 if (j<minJ) minJ=j; 940 if (i>maxI) maxI=i; 941 if (j>maxJ) maxJ=j; 942 } 943 ibeginValue_=minI ; 944 jbeginValue_=minJ ; 945 niValue_=maxI-minI+1 ; 946 njValue_=maxJ-minJ+1 ; 947 } 948 } 949 916 950 size_t CDomain::getGlobalWrittenSize(void) 917 951 { … … 943 977 { 944 978 // No information about ni 945 int minIndex = ni_glo - 1;979 int minIndex = ni_glo*nj_glo - 1; 946 980 int maxIndex = 0; 947 981 for (int idx = 0; idx < i_index.numElements(); ++idx) … … 950 984 if (i_index(idx) > maxIndex) maxIndex = i_index(idx); 951 985 } 952 if (i_index.numElements()) { 986 if (i_index.numElements()) 987 { 953 988 ni = maxIndex - minIndex + 1; 954 989 minIIndex = minIndex; 955 990 } 956 else { 957 ni = 0; 958 } 959 } 991 else ni = 0; 992 } 960 993 961 994 // It's not so correct but if ibegin is not the first value of i_index … … 1010 1043 { 1011 1044 // No information about nj 1012 int minIndex = n j_glo - 1;1045 int minIndex = ni_glo*nj_glo - 1; 1013 1046 int maxIndex = 0; 1014 1047 for (int idx = 0; idx < j_index.numElements(); ++idx) … … 1354 1387 } 1355 1388 else if (!lonvalue_1d.isEmpty() && !lonlatValueExisted) 1389 { 1390 if (type_attr::rectilinear == type) 1391 { 1392 if (ni == lonvalue_1d.numElements() && nj == latvalue_1d.numElements()) 1393 { 1394 lonvalue.resize(ni * nj); 1395 latvalue.resize(ni * nj); 1396 if (hasBounds) 1397 { 1398 bounds_lonvalue.resize(nvertex, ni * nj); 1399 bounds_latvalue.resize(nvertex, ni * nj); 1400 } 1401 1402 for (int j = 0; j < nj; ++j) 1403 { 1404 for (int i = 0; i < ni; ++i) 1405 { 1406 int k = j * ni + i; 1407 1408 lonvalue(k) = lonvalue_1d(i); 1409 latvalue(k) = latvalue_1d(j); 1410 1411 if (hasBounds) 1412 { 1413 for (int n = 0; n < nvertex; ++n) 1414 { 1415 bounds_lonvalue(n,k) = bounds_lon_1d(n,i); 1416 bounds_latvalue(n,k) = bounds_lat_1d(n,j); 1417 } 1418 } 1419 } 1420 } 1421 } 1422 else if (i_index.numElements() == lonvalue_1d.numElements() && j_index.numElements() == latvalue_1d.numElements() && !lonlatValueExisted) 1423 { 1424 lonvalue.reference(lonvalue_1d.copy()); 1425 latvalue.reference(latvalue_1d.copy()); 1426 if (hasBounds) 1427 { 1428 bounds_lonvalue.reference(bounds_lon_1d.copy()); 1429 bounds_latvalue.reference(bounds_lat_1d.copy()); 1430 } 1431 } 1432 else 1433 ERROR("CDomain::completeLonClient(void)", 1434 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 1435 << "'lonvalue_1d' and 'latvalue_1d' does not have the same size as the local domain." << std::endl 1436 << "'lonvalue_1d' size is " << lonvalue_1d.numElements() 1437 << " and 'latvalue_1d' size is " << latvalue_1d.numElements() << std::endl 1438 << " They should be correspondingly " << ni.getValue() << " and " << nj.getValue() << " or " << std::endl 1439 << i_index.numElements() << " and " << j_index.numElements() << "."); 1440 } 1441 else if (type == type_attr::curvilinear || type == type_attr::unstructured && !lonlatValueExisted) 1442 { 1443 lonvalue.reference(lonvalue_1d.copy()); 1444 latvalue.reference(latvalue_1d.copy()); 1445 if (hasBounds) 1446 { 1447 bounds_lonvalue.reference(bounds_lon_1d.copy()); 1448 bounds_latvalue.reference(bounds_lat_1d.copy()); 1449 } 1450 } 1451 } 1452 1453 if (!area_2d.isEmpty() && areavalue.isEmpty()) 1454 { 1455 areavalue.resize(ni*nj); 1456 for (int j = 0; j < nj; ++j) 1457 { 1458 for (int i = 0; i < ni; ++i) 1459 { 1460 int k = j * ni + i; 1461 areavalue(k) = area_2d(i,j); 1462 } 1463 } 1464 } 1465 else if (!area_1d.isEmpty() && areavalue.isEmpty()) areavalue.reference(area_1d.copy()); 1466 1467 } 1468 CATCH_DUMP_ATTR 1469 1470 /* 1471 Convert internal longitude latitude value used by XIOS to "lonvalue_*" which can be retrieved with Fortran interface 1472 */ 1473 void CDomain::convertLonLatValue(void) 1474 TRY 1475 { 1476 bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); 1477 if (!lonvalue_2d.isEmpty() && lonlatValueExisted) 1478 { 1479 lonvalue_2d.resize(ni,nj); 1480 latvalue_2d.resize(ni,nj); 1481 if (hasBounds) 1482 { 1483 bounds_lon_2d.resize(nvertex, ni, nj); 1484 bounds_lat_2d.resize(nvertex, ni, nj); 1485 } 1486 1487 for (int j = 0; j < nj; ++j) 1488 { 1489 for (int i = 0; i < ni; ++i) 1490 { 1491 int k = j * ni + i; 1492 1493 lonvalue_2d(i,j) = lonvalue(k); 1494 latvalue_2d(i,j) = latvalue(k); 1495 1496 if (hasBounds) 1497 { 1498 for (int n = 0; n < nvertex; ++n) 1499 { 1500 bounds_lon_2d(n,i,j) = bounds_lonvalue(n,k); 1501 bounds_lat_2d(n,i,j) = bounds_latvalue(n,k); 1502 } 1503 } 1504 } 1505 } 1506 } 1507 else if (!lonvalue_1d.isEmpty() && lonlatValueExisted) 1356 1508 { 1357 1509 if (type_attr::rectilinear == type) … … 1417 1569 } 1418 1570 } 1419 1420 if (!area.isEmpty() && areavalue.isEmpty())1421 {1422 areavalue.resize(ni*nj);1423 for (int j = 0; j < nj; ++j)1424 {1425 for (int i = 0; i < ni; ++i)1426 {1427 int k = j * ni + i;1428 areavalue(k) = area(i,j);1429 }1430 }1431 }1432 }1433 CATCH_DUMP_ATTR1434 1435 /*1436 Convert internal longitude latitude value used by XIOS to "lonvalue_*" which can be retrieved with Fortran interface1437 */1438 void CDomain::convertLonLatValue(void)1439 TRY1440 {1441 bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements());1442 if (!lonvalue_2d.isEmpty() && lonlatValueExisted)1443 {1444 lonvalue_2d.resize(ni,nj);1445 latvalue_2d.resize(ni,nj);1446 if (hasBounds)1447 {1448 bounds_lon_2d.resize(nvertex, ni, nj);1449 bounds_lat_2d.resize(nvertex, ni, nj);1450 }1451 1452 for (int j = 0; j < nj; ++j)1453 {1454 for (int i = 0; i < ni; ++i)1455 {1456 int k = j * ni + i;1457 1458 lonvalue_2d(i,j) = lonvalue(k);1459 latvalue_2d(i,j) = latvalue(k);1460 1461 if (hasBounds)1462 {1463 for (int n = 0; n < nvertex; ++n)1464 {1465 bounds_lon_2d(n,i,j) = bounds_lonvalue(n,k);1466 bounds_lat_2d(n,i,j) = bounds_latvalue(n,k);1467 }1468 }1469 }1470 }1471 }1472 else if (!lonvalue_1d.isEmpty() && lonlatValueExisted)1473 {1474 if (type_attr::rectilinear == type)1475 {1476 if (ni == lonvalue_1d.numElements() && nj == latvalue_1d.numElements())1477 {1478 lonvalue.resize(ni * nj);1479 latvalue.resize(ni * nj);1480 if (hasBounds)1481 {1482 bounds_lonvalue.resize(nvertex, ni * nj);1483 bounds_latvalue.resize(nvertex, ni * nj);1484 }1485 1486 for (int j = 0; j < nj; ++j)1487 {1488 for (int i = 0; i < ni; ++i)1489 {1490 int k = j * ni + i;1491 1492 lonvalue(k) = lonvalue_1d(i);1493 latvalue(k) = latvalue_1d(j);1494 1495 if (hasBounds)1496 {1497 for (int n = 0; n < nvertex; ++n)1498 {1499 bounds_lonvalue(n,k) = bounds_lon_1d(n,i);1500 bounds_latvalue(n,k) = bounds_lat_1d(n,j);1501 }1502 }1503 }1504 }1505 }1506 else if (i_index.numElements() == lonvalue_1d.numElements() && j_index.numElements() == latvalue_1d.numElements() && !lonlatValueExisted)1507 {1508 lonvalue.reference(lonvalue_1d);1509 latvalue.reference(latvalue_1d);1510 if (hasBounds)1511 {1512 bounds_lonvalue.reference(bounds_lon_1d);1513 bounds_latvalue.reference(bounds_lat_1d);1514 }1515 }1516 else1517 ERROR("CDomain::completeLonClient(void)",1518 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "1519 << "'lonvalue_1d' and 'latvalue_1d' does not have the same size as the local domain." << std::endl1520 << "'lonvalue_1d' size is " << lonvalue_1d.numElements()1521 << " and 'latvalue_1d' size is " << latvalue_1d.numElements() << std::endl1522 << " They should be correspondingly " << ni.getValue() << " and " << nj.getValue() << " or " << std::endl1523 << i_index.numElements() << " and " << j_index.numElements() << ".");1524 }1525 else if (type == type_attr::curvilinear || type == type_attr::unstructured && !lonlatValueExisted)1526 {1527 lonvalue.reference(lonvalue_1d);1528 latvalue.reference(latvalue_1d);1529 if (hasBounds)1530 {1531 bounds_lonvalue.reference(bounds_lon_1d);1532 bounds_latvalue.reference(bounds_lat_1d);1533 }1534 }1535 }1536 1571 } 1537 1572 CATCH_DUMP_ATTR … … 1636 1671 { 1637 1672 bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements()); 1638 hasArea = !area .isEmpty();1673 hasArea = !area_1d.isEmpty() || !area_2d.isEmpty(); 1639 1674 if (hasArea && !hasAreaValue) 1640 1675 { 1641 if ( area.extent(0) != ni || area.extent(1) != nj)1676 if (!area_2d.isEmpty() && (area_2d.extent(0) != ni || area_2d.extent(1) != nj)) 1642 1677 { 1643 1678 ERROR("CDomain::checkArea(void)", … … 1645 1680 << "The area does not have the same size as the local domain." << std::endl 1646 1681 << "Local size is " << ni.getValue() << " x " << nj.getValue() << "." << std::endl 1647 << "Area size is " << area.extent(0) << " x " << area.extent(1) << "."); 1648 } 1649 // if (areavalue.isEmpty()) 1650 // { 1651 // areavalue.resize(ni*nj); 1652 // for (int j = 0; j < nj; ++j) 1653 // { 1654 // for (int i = 0; i < ni; ++i) 1655 // { 1656 // int k = j * ni + i; 1657 // areavalue(k) = area(i,j); 1658 // } 1659 // } 1660 // } 1682 << "Area size is " << area_2d.extent(0) << " x " << area_2d.extent(1) << "."); 1683 } 1684 1685 if (!area_1d.isEmpty() && area_1d.extent(0) != ni*nj) 1686 { 1687 ERROR("CDomain::checkArea(void)", 1688 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 1689 << "The area does not have the same size as the local domain." << std::endl 1690 << "Local size is " << ni.getValue() << " x " << nj.getValue() << "." << std::endl 1691 << "Area size is " << area_1d.extent(0) << " but must be ni*nj=" << ni*nj << " ."); 1692 } 1693 1661 1694 } 1662 1695 } … … 1731 1764 if (this->checkAttributes_done_) return; 1732 1765 this->checkDomain(); 1766 this->compute2dBox() ; 1733 1767 this->checkLonLat(); 1734 1768 this->checkBounds(); … … 1803 1837 excludedAttr.insert(excludedAttr.end(), { "mask_1d", "mask_2d" }); // ??? 1804 1838 excludedAttr.insert(excludedAttr.end(), { "bounds_lon_1d", "bounds_lat_1d", "bounds_lon_2d", "bounds_lat_2d" }); 1805 excludedAttr.insert(excludedAttr.end(), { "area " });1839 excludedAttr.insert(excludedAttr.end(), { "area_1d", "area_2d" }); 1806 1840 // private 1807 1841 excludedAttr.insert(excludedAttr.end(), { "lon_start", "lon_end", "lat_start", "lat_end" }); … … 1952 1986 CContext* context = CContext::getCurrent(); 1953 1987 map<int, CArray<size_t,1>> globalIndex ; 1954 /* old method 1955 if (type==EDistributionType::BANDS) // Bands distribution to send to file server 1956 { 1957 int nbServer = client->getRemoteSize(); 1958 std::vector<int> nGlobDomain(2); 1959 nGlobDomain[0] = this->ni_glo; 1960 nGlobDomain[1] = this->nj_glo; 1961 1962 // to be changed in future, need to rewrite more simply domain distribution 1963 CServerDistributionDescription serverDescription(nGlobDomain, nbServer); 1964 int distributedPosition ; 1965 if (isUnstructed_) distributedPosition = 0 ; 1966 else distributedPosition = 1 ; 1967 1968 std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin(); 1969 std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes(); 1970 vector<unordered_map<size_t,vector<int>>> indexServerOnElement ; 1971 CArray<int,1> axisDomainOrder(1) ; axisDomainOrder(0)=2 ; 1972 auto zeroIndex=serverDescription.computeServerGlobalByElement(indexServerOnElement, context->getIntraCommRank(), context->getIntraCommSize(), 1973 axisDomainOrder,distributedPosition) ; 1974 // distribution is very bad => to redo 1975 // convert indexServerOnElement => map<int,CArray<size_t,1>> - need to be changed later 1976 map<int, vector<size_t>> vectGlobalIndex ; 1977 for(auto& indexRanks : indexServerOnElement[0]) 1978 { 1979 size_t index=indexRanks.first ; 1980 auto& ranks=indexRanks.second ; 1981 for(int rank : ranks) vectGlobalIndex[rank].push_back(index) ; 1982 } 1983 for(auto& vect : vectGlobalIndex ) globalIndex.emplace(vect.first, CArray<size_t,1>(vect.second.data(), shape(vect.second.size()),duplicateData)) ; 1984 // some servers receves no index (zeroIndex array) => root process take them into account. 1985 if (context->getIntraCommRank()==0) 1986 for(auto& rank : zeroIndex) globalIndex[rank] = CArray<size_t,1>() ; 1987 } 1988 */ 1988 1989 1989 if (distType==EDistributionType::BANDS && isUnstructed_) distType=EDistributionType::COLUMNS ; 1990 1990 … … 2134 2134 CATCH 2135 2135 2136 2137 2138 2136 void CDomain::distributeToServer(CContextClient* client, bool inOut, map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn, 2139 2137 shared_ptr<CScattererConnector> &scattererConnector, const string& domainId) … … 2409 2407 CArray<double,1> value ; 2410 2408 gathererConnector_->transfer(event, value, 0.); 2411 area .resize(ni,nj) ;2412 if (area .numElements()>0) area=CArray<double,2>(value.dataFirst(),shape(ni,nj),neverDeleteData) ;2409 area_2d.resize(ni,nj) ; 2410 if (area_2d.numElements()>0) area_2d=CArray<double,2>(value.dataFirst(),shape(ni,nj),neverDeleteData) ; 2413 2411 } 2414 2412 } -
XIOS3/dev/XIOS_ATTACHED/src/node/domain.hpp
r2397 r2482 214 214 CArray<double, 2> bounds_lonvalue, bounds_latvalue; 215 215 CArray<double, 1> areavalue; 216 int niValue_ ; 217 int njValue_ ; 218 int ibeginValue_ ; 219 int jbeginValue_ ; 216 220 217 221 … … 241 245 void checkArea(void); 242 246 void checkLonLat(); 247 void compute2dBox(void) ; 243 248 244 249 public: -
XIOS3/dev/XIOS_ATTACHED/src/node/field.cpp
r2433 r2482 20 20 #include "temporal_filter.hpp" 21 21 #include "server_from_client_source_filter.hpp" 22 #include "client_online_reader_filter.hpp" 22 23 #include "file_reader_source_filter.hpp" 24 #include "grid_redistribute_filter.hpp" 23 25 #include "tracer.hpp" 24 26 #include "graph_package.hpp" … … 205 207 TRY 206 208 { 207 return clientFromServerSourceFilter_->sendReadDataRequest(tsDataRequested) ; 209 if (clientFromServerSourceFilter_) return clientFromServerSourceFilter_->sendReadDataRequest(tsDataRequested) ; 210 else if (clientOnlineReaderFilter_) return clientOnlineReaderFilter_->sendReadDataRequest(tsDataRequested) ; 211 else ERROR("bool CField::sendReadDataRequest(const CDate& tsDataRequested)", << "uninitialized source filter"); 208 212 } 209 213 CATCH_DUMP_ATTR … … 217 221 TRY 218 222 { 219 return clientFromServerSourceFilter_->sendReadDataRequestIfNeeded() ; 223 if (clientFromServerSourceFilter_) return clientFromServerSourceFilter_->sendReadDataRequestIfNeeded() ; 224 else if (clientOnlineReaderFilter_) return clientOnlineReaderFilter_->sendReadDataRequestIfNeeded() ; 225 else ERROR("bool CField::sendReadDataRequestIfNeeded(void)", << "uninitialized source filter"); 220 226 } 221 227 CATCH_DUMP_ATTR … … 304 310 TRY 305 311 { 306 clientFromServerSourceFilter_->checkForLateData() ; 312 if (clientFromServerSourceFilter_) return clientFromServerSourceFilter_->checkForLateData() ; 313 else if (clientOnlineReaderFilter_) return clientOnlineReaderFilter_->checkForLateData() ; 314 else ERROR("void CField::checkForLateDataFromServer(void)", << "uninitialized source filter"); 307 315 } 308 316 CATCH_DUMP_ATTR … … 315 323 { 316 324 checkForLateDataFromServer() ; 317 clientFromServerSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ; 325 if (clientFromServerSourceFilter_) clientFromServerSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ; 326 else if (clientOnlineReaderFilter_) clientOnlineReaderFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ; 318 327 } 319 328 else if (hasCouplerIn()) … … 325 334 CATCH_DUMP_ATTR 326 335 327 328 void CField::checkIfMustAutoTrigger(void) 329 TRY 330 { 331 mustAutoTrigger = clientFromServerSourceFilter_ ? clientFromServerSourceFilter_->mustAutoTrigger() : false; 332 } 333 CATCH_DUMP_ATTR 334 335 void CField::autoTriggerIfNeeded(void) 336 TRY 337 { 338 if (mustAutoTrigger) 339 clientFromServerSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()); 340 } 341 CATCH_DUMP_ATTR 342 336 343 337 344 338 //---------------------------------------------------------------- … … 506 500 bool bufferForWriting) 507 501 { 508 auto& contextBufferSize = bufferSize[client ] ;509 auto& contextMaxEventSize = maxEventSize[client ] ;510 const std::map<int, size_t> mapSize = grid_->getDataBufferSize(client , getId(), bufferForWriting);502 auto& contextBufferSize = bufferSize[client_] ; 503 auto& contextMaxEventSize = maxEventSize[client_] ; 504 const std::map<int, size_t> mapSize = grid_->getDataBufferSize(client_, getId(), bufferForWriting); 511 505 for(auto& it : mapSize ) 512 506 { … … 525 519 bool bufferForWriting) 526 520 { 527 auto& contextBufferSize = bufferSize[client ] ;528 auto& contextMaxEventSize = maxEventSize[client ] ;529 const std::map<int, size_t> mapSize = grid_->getAttributesBufferSize(client , bufferForWriting);521 auto& contextBufferSize = bufferSize[client_] ; 522 auto& contextMaxEventSize = maxEventSize[client_] ; 523 const std::map<int, size_t> mapSize = grid_->getAttributesBufferSize(client_, bufferForWriting); 530 524 for(auto& it : mapSize ) 531 525 { … … 797 791 { 798 792 // insert temporal filter before sending to files 799 clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client ));793 clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client_)); 800 794 // insert temporal filter before sending to files 801 795 getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(clientToServerStoreFilter_, 0); … … 809 803 } 810 804 805 void CField::connectToOnlineWriter(CGarbageCollector& gc) 806 { 807 // insert temporal filter before sending to files 808 CField* fieldOut ; 809 redistributeFilter_ = std::shared_ptr<CGridRedistributeFilter>(new CGridRedistributeFilter(gc, this, fieldOut)); 810 fieldOut->setFileOut(this->getFileOut()); 811 fileOut_->replaceEnabledFields(this, fieldOut) ; 812 // insert temporal filter before sending to files 813 getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(redistributeFilter_, 0); 814 fieldOut->inputFilter = std::shared_ptr<CPassThroughFilter>(new CPassThroughFilter(gc)); 815 fieldOut->instantDataFilter = fieldOut->inputFilter ; 816 redistributeFilter_->connectOutput(fieldOut->inputFilter, 0); 817 fieldOut->connectToFileWriter(gc) ; 818 fieldOut->solveServerOperation() ; // might not be called, create a new time functor.... find a better solution later 819 const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ; 820 821 if(buildGraph_) 822 { 823 clientToServerStoreFilter_->graphPackage = new CGraphPackage; 824 clientToServerStoreFilter_->graphEnabled = true; 825 clientToServerStoreFilter_->graphPackage->inFields.push_back(this); 826 } 827 } 828 829 void CField::connectToOnlineReader(CGarbageCollector& gc) 830 { 831 // insert temporal filter before sending to files 832 clientOnlineReaderFilter_ = std::shared_ptr<CClientOnlineReaderFilter>(new CClientOnlineReaderFilter(gc,this)) ; 833 clientOnlineReaderFilter_ -> connectOutput(inputFilter,0) ; 834 } 835 811 836 void CField::connectToCouplerOut(CGarbageCollector& gc) 812 837 { 813 838 // insert temporal filter before sending to files 814 clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client ));839 clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client_)); 815 840 instantDataFilter->connectOutput(clientToServerStoreFilter_, 0); 816 841 const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ; … … 951 976 void CField::connectToServerToClient(CGarbageCollector& gc) 952 977 { 953 serverToClientStoreFilter_ = std::shared_ptr<CServerToClientStoreFilter>(new CServerToClientStoreFilter(gc, this, client ));978 serverToClientStoreFilter_ = std::shared_ptr<CServerToClientStoreFilter>(new CServerToClientStoreFilter(gc, this, client_)); 954 979 instantDataFilter->connectOutput(serverToClientStoreFilter_, 0); 955 980 const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ; … … 1435 1460 { 1436 1461 CContext* context = CContext::getCurrent(); 1437 client = contextClient;1462 client_ = contextClient; 1438 1463 1439 1464 // A grid is sent by a client (both for read or write) or by primary server (write only) … … 1441 1466 { 1442 1467 if (getRelFile()->mode.isEmpty() || (!getRelFile()->mode.isEmpty() && getRelFile()->mode == CFile::mode_attr::write)) 1443 grid_->setContextClient(contextClient);1468 /*grid_->setContextClient(contextClient) */; // => nothing to do with thats now, to remove... 1444 1469 } 1445 1470 else if (context->getServiceType()==CServicesManager::CLIENT) 1446 1471 { 1447 1472 if (grid_) 1448 grid_->setContextClient(contextClient);1473 /*grid_->setContextClient(contextClient)*/; // => nothing to do with thats now, to remove... 1449 1474 else 1475 1450 1476 ERROR( "CField::setContextClient(contextClient)", 1451 1477 << "Grid not defined for " << getId() … … 1459 1485 void CField::sendFieldToFileServer(void) 1460 1486 { 1461 CContext::getCurrent()->sendContextToFileServer(client );1462 getRelFile()->sendFileToFileServer(client );1487 CContext::getCurrent()->sendContextToFileServer(client_); 1488 getRelFile()->sendFileToFileServer(client_); 1463 1489 sentGrid_ = grid_-> duplicateSentGrid() ; 1464 sentGrid_->sendGridToFileServer(client , false);1490 sentGrid_->sendGridToFileServer(client_, false); 1465 1491 name = getFieldOutputName() ; 1466 this->sendAllAttributesToServer(client );1467 this->sendAddAllVariables(client );1492 this->sendAllAttributesToServer(client_); 1493 this->sendAddAllVariables(client_); 1468 1494 } 1469 1495 1470 1496 void CField::sendFieldToInputFileServer(void) 1471 1497 { 1472 CContext::getCurrent()->sendContextToFileServer(client );1473 getRelFile()->sendFileToFileServer(client );1498 CContext::getCurrent()->sendContextToFileServer(client_); 1499 getRelFile()->sendFileToFileServer(client_); 1474 1500 sentGrid_ = grid_-> duplicateSentGrid() ; 1475 sentGrid_->sendGridToFileServer(client , true);1501 sentGrid_->sendGridToFileServer(client_, true); 1476 1502 read_access=true ; // not the best solution, but on server side, the field must be a starting point of the workflow 1477 1503 // must be replace by a better solution when implementing filters for reading and send to client 1478 1504 // on server side 1479 this->sendAllAttributesToServer(client );1480 this->sendAddAllVariables(client );1505 this->sendAllAttributesToServer(client_); 1506 this->sendAddAllVariables(client_); 1481 1507 } 1482 1508 … … 1486 1512 else sendFieldToCouplerOut_done_=true ; 1487 1513 sentGrid_ = grid_-> duplicateSentGrid() ; 1488 sentGrid_->sendGridToCouplerOut(client , this->getId());1514 sentGrid_->sendGridToCouplerOut(client_, this->getId()); 1489 1515 this->sendGridCompleted(); 1490 1516 … … 1502 1528 CEventClient event(getType(),EVENT_ID_GRID_COMPLETED); 1503 1529 1504 if (client ->isServerLeader())1530 if (client_->isServerLeader()) 1505 1531 { 1506 1532 CMessage msg; 1507 1533 msg<<this->getId(); 1508 for (auto& rank : client ->getRanksServerLeader()) event.push(rank,1,msg);1509 client ->sendEvent(event);1510 } 1511 else client ->sendEvent(event);1534 for (auto& rank : client_->getRanksServerLeader()) event.push(rank,1,msg); 1535 client_->sendEvent(event); 1536 } 1537 else client_->sendEvent(event); 1512 1538 } 1513 1539 CATCH_DUMP_ATTR -
XIOS3/dev/XIOS_ATTACHED/src/node/field.hpp
r2406 r2482 28 28 #include "client_to_server_store_filter.hpp" 29 29 #include "file_reader_source_filter.hpp" 30 #include "client_online_reader_filter.hpp" 30 31 31 32 … … 56 57 class CSourceFilter; 57 58 class CServerToClientFilter; 59 class CGridRedistributeFilter; 58 60 ///-------------------------------------------------------------- 59 61 … … 199 201 void checkForLateDataFromCoupler(void) ; 200 202 201 void checkIfMustAutoTrigger(void); // ym obsolete202 void autoTriggerIfNeeded(void); //ym obsolete203 203 void triggerLateField(void) ; 204 204 … … 237 237 void connectToFileReader(CGarbageCollector& gc) ; 238 238 void connectToServerToClient(CGarbageCollector& gc) ; 239 void connectToOnlineWriter(CGarbageCollector& gc) ; 240 void connectToOnlineReader(CGarbageCollector& gc) ; 239 241 240 242 void setContextClientDataBufferSize(map<CContextClient*,map<int,size_t>>& bufferSize, … … 267 269 CGrid* grid_=nullptr; 268 270 CGrid* getGrid(void) { return grid_; } 271 void setGrid(CGrid* grid) { grid_=grid; } 269 272 270 273 private: … … 327 330 328 331 private: 329 CContextClient* client ;332 CContextClient* client_; 330 333 public: 331 334 void setContextClient(CContextClient* newContextClient); 332 CContextClient* getContextClient(void) {return client ;}335 CContextClient* getContextClient(void) {return client_;} 333 336 334 337 private: … … 372 375 std::shared_ptr<COutputPin> selfReferenceFilter; // probably redondant with inputFilter 373 376 374 //! The source filter for data provided by the client375 // std::shared_ptr<CSourceFilter> clientSourceFilter; // obsolete to remove376 377 377 378 //! The source filter for data provided by the model to enter the client workflow … … 393 394 std::shared_ptr<CFileReaderSourceFilter> fileReaderSourceFilter_; 394 395 395 //! The source filter for data provided by the server396 // std::shared_ptr<CSourceFilter> serverSourceFilter; // obsolete to remove397 398 396 //! The terminal filter which send data to server for writing 399 397 std::shared_ptr<CClientToServerStoreFilter> clientToServerStoreFilter_; … … 405 403 std::shared_ptr<CServerToClientStoreFilter> serverToClientStoreFilter_; 406 404 405 //! the filter to redistribute data before to call the fileWriterStoreFilter 406 std::shared_ptr<CGridRedistributeFilter> redistributeFilter_ ; 407 408 //! the filter to connect to online reader 409 std::shared_ptr<CClientOnlineReaderFilter> clientOnlineReaderFilter_ ; 407 410 408 411 }; // class CField -
XIOS3/dev/XIOS_ATTACHED/src/node/file.cpp
r2458 r2482 178 178 179 179 return (this->enabledFields); 180 } 181 CATCH_DUMP_ATTR 182 183 void CFile::replaceEnabledFields(CField* fieldIn, CField* fieldOut) 184 TRY 185 { 186 for(auto& enableField : enabledFields) if (enableField==fieldIn) enableField=fieldOut ; 180 187 } 181 188 CATCH_DUMP_ATTR … … 979 986 980 987 /*! 981 * Post-process the filter graph for each active field.982 */983 void CFile::postProcessFilterGraph()984 TRY985 {986 int size = this->enabledFields.size();987 for (int i = 0; i < size; ++i)988 {989 this->enabledFields[i]->checkIfMustAutoTrigger();990 }991 }992 CATCH_DUMP_ATTR993 994 /*!995 988 Prefetching the data for enabled fields read from file. 996 989 */ … … 1004 997 for (int i = 0; i < size; ++i) 1005 998 this->enabledFields[i]->sendReadDataRequest(CContext::getCurrent()->getCalendar()->getCurrentDate()); 1006 }1007 CATCH_DUMP_ATTR1008 1009 /*!1010 Do all pre timestep operations for enabled fields in read mode:1011 - Check that the data excepted from server has been received1012 - Check if some filters must auto-trigger1013 */1014 void CFile::doPreTimestepOperationsForEnabledReadModeFields(void)1015 TRY1016 {1017 if (mode.isEmpty() || mode.getValue() != mode_attr::read)1018 return;1019 1020 int size = this->enabledFields.size();1021 for (int i = 0; i < size; ++i)1022 {1023 this->enabledFields[i]->checkForLateDataFromServer();1024 this->enabledFields[i]->autoTriggerIfNeeded();1025 }1026 999 } 1027 1000 CATCH_DUMP_ATTR -
XIOS3/dev/XIOS_ATTACHED/src/node/file.hpp
r2458 r2482 83 83 int default_level = 1, 84 84 bool default_enabled = true); 85 void replaceEnabledFields(CField* fieldIn, CField* fieldOut) ; 85 86 86 87 StdString dumpClassAttributes(void); … … 112 113 void processEnabledFile(void); 113 114 114 void postProcessFilterGraph();115 115 void prefetchEnabledReadModeFields(); 116 void doPreTimestepOperationsForEnabledReadModeFields();117 116 void doPostTimestepOperationsForEnabledReadModeFields(); 118 117 … … 212 211 213 212 private: 214 215 213 bool isOnline_=false; 214 public: 215 bool isOnline(void) { return isOnline_ ;} 216 void setOnline(bool online=true) { isOnline_=online ;} 216 217 public: 217 218 // virtual void toBinary (StdOStream& os) const; -
XIOS3/dev/XIOS_ATTACHED/src/node/grid.cpp
r2397 r2482 29 29 #include "generic_algorithm_transformation.hpp" 30 30 #include "algo_types.hpp" 31 #include "redistribute_domain.hpp" 32 #include "redistribute_axis.hpp" 33 #include "redistribute_scalar.hpp" 34 31 35 32 36 #include <regex> … … 48 52 , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 49 53 , gridSrc_(), order_() 50 , clients()51 54 { 52 55 setVirtualDomainGroup(CDomainGroup::create(getId() + "_virtual_domain_group")); … … 66 69 , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 67 70 , gridSrc_(), order_() 68 , clients()69 71 { 70 72 setVirtualDomainGroup(CDomainGroup::create(getId() + "_virtual_domain_group")); … … 1468 1470 distributeGridToServer(client, false, fieldId) ; 1469 1471 } 1472 1473 CGrid* CGrid::redistributeGridToWriter(void) 1474 { 1475 CContext* context = CContext::getCurrent(); 1476 CGrid* redistributedGrid ; 1477 string redistributeGridId="redistributedToWriter__"+getId() ; 1478 if (has(redistributeGridId)) redistributedGrid = get(redistributeGridId) ; 1479 else 1480 { 1481 redistributedGrid = CGrid::create(redistributeGridId) ; 1482 // simple Distribution for now 1483 // distribute over the fisrt element except if it is a scalar 1484 auto& elements = getElements() ; 1485 int posDistributed = 0 ; 1486 for(auto& element : elements) 1487 { 1488 if (element.type==TYPE_DOMAIN) break ; 1489 else if (element.type==TYPE_AXIS) break ; 1490 else if (element.type==TYPE_SCALAR) posDistributed++ ; 1491 } 1492 if (posDistributed==elements.size()) posDistributed=0 ; // grid composed only of scalar 1493 1494 for(int i=0 ; i<elements.size() ; i++) 1495 { 1496 if (elements[i].type==TYPE_DOMAIN) 1497 { 1498 CDomain* domain = redistributedGrid->addDomain() ; 1499 domain->domain_ref=elements[i].domain->getId() ; 1500 domain->name = elements[i].domain->getDomainOutputName() ; 1501 CRedistributeDomain* redistributeDomain = dynamic_cast<CRedistributeDomain *>(domain->addTransformation(TRANS_REDISTRIBUTE_DOMAIN, "")) ; 1502 redistributeDomain->type.setValue(posDistributed==i ? CRedistributeDomain::type_attr::bands : CRedistributeDomain::type_attr::full); 1503 } 1504 else if (elements[i].type==TYPE_AXIS) 1505 { 1506 CAxis* axis = redistributedGrid->addAxis() ; 1507 axis->axis_ref=elements[i].axis->getId() ; 1508 axis->name = elements[i].axis->getAxisOutputName() ; 1509 CRedistributeAxis* redistributeAxis = dynamic_cast<CRedistributeAxis *>(axis->addTransformation(TRANS_REDISTRIBUTE_AXIS, "")) ; 1510 redistributeAxis->type.setValue(posDistributed==i ? CRedistributeAxis::type_attr::bands : CRedistributeAxis::type_attr::full); 1511 } 1512 else if (elements[i].type==TYPE_SCALAR) 1513 { 1514 CScalar* scalar = redistributedGrid->addScalar() ; 1515 scalar->scalar_ref=elements[i].scalar->getId() ; 1516 scalar->name = elements[i].scalar->getScalarOutputName() ; 1517 CRedistributeScalar* redistributeScalar = dynamic_cast<CRedistributeScalar *>(scalar->addTransformation(TRANS_REDISTRIBUTE_SCALAR, "")) ; 1518 redistributeScalar->type.setValue(posDistributed==i ? CRedistributeScalar::type_attr::root : CRedistributeScalar::type_attr::full); 1519 } 1520 } 1521 } 1522 1523 return redistributedGrid ; 1524 } 1525 1526 1470 1527 1471 1528 … … 2369 2426 TRY 2370 2427 { 2371 if (clientsSet.find(contextClient)==clientsSet.end())2372 {2373 clients.push_back(contextClient) ;2374 clientsSet.insert(contextClient);2375 }2376 2428 for (auto domain : getDomains()) domain->setContextClient(contextClient); 2377 2429 for (auto axis : getAxis()) axis->setContextClient(contextClient); 2378 2430 for (auto scalar : getScalars()) scalar->setContextClient(contextClient); 2379 2380 2431 } 2381 2432 CATCH_DUMP_ATTR … … 2473 2524 } 2474 2525 2526 void CGrid::computeRedistributeToWriterConnector(CGrid* gridSrc) 2527 { 2528 CContext* context = CContext::getCurrent(); 2529 2530 vector<shared_ptr<CLocalView>> srcViews ; 2531 vector<shared_ptr<CLocalView>> dstViews ; 2532 2533 for(auto& element : gridSrc->getElements()) 2534 { 2535 if (element.type==TYPE_DOMAIN) srcViews.push_back(element.domain->getLocalView(CElementView::WORKFLOW)) ; 2536 else if (element.type==TYPE_AXIS) srcViews.push_back(element.axis->getLocalView(CElementView::WORKFLOW)) ; 2537 else if (element.type==TYPE_SCALAR) srcViews.push_back(element.scalar->getLocalView(CElementView::WORKFLOW)) ; 2538 } 2539 2540 for(auto& element : this->getElements()) 2541 { 2542 if (element.type==TYPE_DOMAIN) dstViews.push_back(element.domain->getLocalView(CElementView::WORKFLOW)) ; 2543 else if (element.type==TYPE_AXIS) dstViews.push_back(element.axis->getLocalView(CElementView::WORKFLOW)) ; 2544 else if (element.type==TYPE_SCALAR) dstViews.push_back(element.scalar->getLocalView(CElementView::WORKFLOW)) ; 2545 } 2546 2547 redistributeToWriterConnector_ = make_shared<CGridTransformConnector>(srcViews, dstViews, context->getIntraComm()) ; 2548 redistributeToWriterConnector_ -> computeConnector(true) ; 2549 } 2475 2550 2476 2551 } // namespace xios -
XIOS3/dev/XIOS_ATTACHED/src/node/grid.hpp
r2397 r2482 279 279 280 280 bool isDataDistributed(void) ; 281 private:282 283 /** Clients that have to send a grid. There can be multiple clients in case of secondary server, otherwise only one client. */284 std::list<CContextClient*> clients;285 std::set<CContextClient*> clientsSet;286 281 287 282 private: … … 327 322 ////////////////////////////////////////////////////////////////////////////////////// 328 323 public: 324 CGrid* redistributeGridToWriter(void) ; 325 public: 329 326 CGrid* duplicateSentGrid(void) ; 330 327 private: … … 402 399 void computeServerFromClientConnector(void) ; 403 400 401 private: 402 shared_ptr<CGridTransformConnector> redistributeToWriterConnector_ = nullptr ; 403 public: 404 shared_ptr<CGridTransformConnector> getRedistributeToWriterConnector(CGrid* gridSrc) { if (redistributeToWriterConnector_==nullptr) computeRedistributeToWriterConnector(gridSrc) ; return redistributeToWriterConnector_;} 405 void computeRedistributeToWriterConnector(CGrid* gridSrc) ; 406 407 404 408 }; // class CGrid 405 409 -
XIOS3/dev/XIOS_ATTACHED/src/node/scalar.cpp
r2461 r2482 123 123 if (n.isEmpty()) n=1 ; 124 124 if (mask.isEmpty()) mask=true ; 125 126 hasValue_ = (value.isEmpty()) ? false :true ; 127 hasBounds_ = (bounds.isEmpty()) ? false :true ; 128 hasLabel_ = (label.isEmpty()) ? false :true ; 129 125 130 126 131 initializeLocalElement() ; -
XIOS3/dev/XIOS_ATTACHED/src/node/scalar.hpp
r2397 r2482 143 143 144 144 bool isEqual(CScalar* scalar); 145 146 public: 147 bool hasValue() { return hasValue_; } 148 bool hasBounds() { return hasBounds_; } 149 bool hasLabel() { return hasLabel_; } 150 private: 151 bool hasValue_ = false ; 152 bool hasBounds_ = false ; 153 bool hasLabel_ = false ; 145 154 private: 146 155 /** Clients that have to send a scalar. There can be multiple clients in case of secondary server, otherwise only one client. */ -
XIOS3/dev/XIOS_ATTACHED/src/transformation/axis_algorithm/axis_algorithm_extract.cpp
r2270 r2482 92 92 } 93 93 94 if (axisSrc_->hasValue ) axisDest_->value.resize(nDest);95 if (axisSrc_->hasLabel ) axisDest_->label.resize(nDest);96 if (axisSrc_->hasBounds ) axisDest_->bounds.resize(2,nDest);94 if (axisSrc_->hasValue()) axisDest_->value.resize(nDest); 95 if (axisSrc_->hasLabel()) axisDest_->label.resize(nDest); 96 if (axisSrc_->hasBounds()) axisDest_->bounds.resize(2,nDest); 97 97 98 98 auto& transMap = this->transformationMapping_; … … 142 142 // ----------------------------------------------------------------------------- 143 143 144 if (axisSrc_->hasValue )144 if (axisSrc_->hasValue()) 145 145 { 146 146 axisDest_->value(countDest) = axisSrc_->value(countSrc); 147 147 } 148 if (axisSrc_->hasLabel )148 if (axisSrc_->hasLabel()) 149 149 { 150 150 axisDest_->label(countDest) = axisSrc_->label(countSrc); 151 151 } 152 if (axisSrc_->hasBounds )152 if (axisSrc_->hasBounds()) 153 153 { 154 154 axisDest_->bounds(0,countDest) = axisSrc_->bounds(0,countSrc); -
XIOS3/dev/XIOS_ATTACHED/src/transformation/axis_algorithm/axis_algorithm_inverse.cpp
r2270 r2482 123 123 } 124 124 125 if (axisSrc_->hasValue )125 if (axisSrc_->hasValue()) 126 126 { 127 127 axisDestination->value.resize(indexSize); … … 132 132 } 133 133 134 if (axisSrc_->hasBounds )134 if (axisSrc_->hasBounds()) 135 135 { 136 136 axisDestination->bounds.resize(2,indexSize); -
XIOS3/dev/XIOS_ATTACHED/src/transformation/axis_algorithm/axis_algorithm_redistribute.cpp
r2460 r2482 8 8 #include "grid.hpp" 9 9 #include "grid_transformation_factory_impl.hpp" 10 #include "context.hpp" 10 11 11 12 namespace xios … … 46 47 TRY 47 48 { 49 CContext* context = CContext::getCurrent(); 48 50 51 axisDestination->n_glo.reset(); 52 axisDestination->index.reset(); 53 axisDestination->n.reset(); 54 axisDestination->begin.reset(); 55 56 axisDestination->mask.reset(); 57 axisDestination->data_index.reset(); 58 axisDestination->data_n.reset(); 59 axisDestination->data_begin.reset(); 60 61 axisDestination->value.reset(); 62 axisDestination->label.reset(); 63 axisDestination->bounds.reset(); 64 65 redistributeAxis->checkValid(axisSource); 66 67 auto& index = redistributeAxis-> index ; 68 int n_glo = axisSource -> n_glo ; 69 axisDestination->n_glo = n_glo ; 70 71 72 73 // define the global index of the new domain 74 75 CArray<size_t,1> globalIndex ; 76 77 if (redistributeAxis->type == CRedistributeAxis::type_attr::index) 78 { 79 globalIndex.resize(index.numElements()) ; 80 globalIndex=index ; 81 } 82 else 83 { 84 85 auto distType = CRedistributeAxis::type_attr::column ; 86 87 if (redistributeAxis->type == CRedistributeAxis::type_attr::bands) distType = CRedistributeAxis::type_attr::column ; 88 else distType=redistributeAxis->type; 89 90 int size, start ; 91 if (distType==CRedistributeAxis::type_attr::column) // Bands distribution to send to file server 92 { 93 int nbClient = context->getIntraCommSize() ; 94 int rankClient = context->getIntraCommRank() ; 95 96 size = n_glo/nbClient ; 97 if (rankClient < n_glo % nbClient) 98 { 99 size++ ; 100 start = rankClient*size ; 101 } 102 else start = (n_glo % nbClient)*(size+1) + (rankClient-(n_glo % nbClient)) * size ; 103 104 } 105 else if (distType==CRedistributeAxis::type_attr::full) // domain is not distributed ie all servers get the same local domain 106 { 107 size=n_glo ; start=0 ; 108 } 109 else if (distType==CRedistributeAxis::type_attr::root) // domain is not distributed ie all servers get the same local domain 110 { 111 if (context->getIntraCommRank()==0) { size=n_glo ; start=0 ; } 112 else { size=0 ; start=0 ; } 113 } 114 115 globalIndex.resize(size) ; 116 size_t ind ; 117 ind=0 ; 118 for(int i=start; i<start+size; i++) 119 { 120 globalIndex(ind) = i ; 121 ind++ ; 122 } 123 } 124 125 axisDestination->index.resize(globalIndex.numElements()) ; 126 axisDestination->index = globalIndex ; 127 // apply the transformation to attributes 128 129 auto& transMap = this->transformationMapping_; 130 for(int i=0; i<globalIndex.numElements(); i++) transMap[globalIndex(i)]=globalIndex(i) ; 131 132 auto elementDst=shared_ptr<CLocalElement>(new CLocalElement(context->getIntraCommRank(), n_glo, globalIndex)) ; 133 elementDst->addFullView() ; 134 135 auto transformConnector = make_shared<CTransformConnector>(axisSource->getLocalView(CElementView::FULL), elementDst->getView(CElementView::FULL),context->getIntraComm()) ; 136 transformConnector->computeConnector() ; 137 138 if (axisSource->hasValue()) transformConnector->transfer(axisSource->value, axisDestination->value) ; 139 140 141 142 if (axisSource->hasBounds()) 143 { 144 CArray<double,1> boundsSrc(axisSource->bounds.dataFirst(),shape(axisSource->bounds.numElements()),neverDeleteData) ; 145 CArray<double,1> boundsDst ; 146 transformConnector->transfer(2, boundsSrc, boundsDst) ; 147 axisDestination->bounds.resize(2,globalIndex.numElements()) ; 148 axisDestination->bounds = CArray<double,2>(boundsDst.dataFirst(), shape(2,globalIndex.numElements()),neverDeleteData) ; 149 } 150 151 if (axisSource->hasLabel()) 152 { 153 //ym transferTransformConnector.transfer(axisSrc->label, axisDestination->label) ; -> probably not supported now, see later 154 } 155 156 // transfer the mask 157 auto transformMask = make_shared<CTransformConnector>(axisSource->getLocalView(CElementView::WORKFLOW), elementDst->getView(CElementView::FULL),context->getIntraComm()) ; 158 transformMask->computeConnector() ; 159 160 CArray<bool,1> workflow(axisSource->getLocalView(CElementView::WORKFLOW)->getSize()) ; 161 axisDestination->mask.resize(axisSource->getLocalView(CElementView::FULL)->getSize()) ; 162 workflow=true ; 163 164 transformMask->transfer(workflow,axisDestination->mask,false) ; 49 165 50 166 axisDestination->checkAttributes() ; 167 this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 51 168 } 52 169 CATCH -
XIOS3/dev/XIOS_ATTACHED/src/transformation/axis_algorithm/axis_algorithm_zoom.cpp
r2270 r2482 79 79 80 80 axisDest_->mask.resize(nDest); 81 if (axisSrc_->hasValue ) axisDest_->value.resize(nDest);82 if (axisSrc_->hasLabel ) axisDest_->label.resize(nDest);83 if (axisSrc_->hasBounds ) axisDest_->bounds.resize(2,nDest);81 if (axisSrc_->hasValue()) axisDest_->value.resize(nDest); 82 if (axisSrc_->hasLabel()) axisDest_->label.resize(nDest); 83 if (axisSrc_->hasBounds()) axisDest_->bounds.resize(2,nDest); 84 84 85 85 auto& transMap = this->transformationMapping_; … … 92 92 axisDest_->mask(iDest) = axisSrc_->mask(iSrc); 93 93 94 if (axisSrc_->hasValue )94 if (axisSrc_->hasValue()) 95 95 axisDest_->value(iDest) = axisSrc_->value(iSrc); 96 if (axisSrc_->hasLabel )96 if (axisSrc_->hasLabel()) 97 97 axisDest_->label(iDest) = axisSrc_->label(iSrc); 98 if (axisSrc_->hasBounds )98 if (axisSrc_->hasBounds()) 99 99 { 100 100 axisDest_->bounds(0,iDest) = axisSrc_->bounds(0,iSrc); -
XIOS3/dev/XIOS_ATTACHED/src/transformation/domain_algorithm/domain_algorithm_extract.cpp
r2340 r2482 76 76 domainDestination->bounds_lon_2d.reset(); 77 77 domainDestination->bounds_lat_2d.reset(); 78 domainDestination->area.reset(); 78 domainDestination->area_1d.reset(); 79 domainDestination->area_2d.reset(); 79 80 domainDestination->radius.reset(); 80 81 … … 175 176 } 176 177 } 177 if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest); 178 178 if (domainSrc_->hasArea) 179 { 180 if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d.resize(niDest,njDest); 181 else if (!domainSrc_->area_1d.isEmpty()) domainDest_->area_1d.resize(niDest*njDest); 182 } 179 183 // Set attributes required to define domainDestination->localElement_ and associated views, full and workflow) 180 184 CArray<size_t,1> sourceGlobalIdx = domainSource->getLocalElement()->getGlobalIndex(); … … 241 245 242 246 // area 243 if (!domainSrc_->area.isEmpty()) 244 { 245 domainDest_->area(iIdxDestLocal,jIdxDestLocal) = domainSrc_->area(iIdxSrcLocal,jIdxSrcLocal); 246 } 247 if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d(iIdxDestLocal,jIdxDestLocal) = domainSrc_->area_2d(iIdxSrcLocal,jIdxSrcLocal); 248 else if (!domainSrc_->area_1d.isEmpty()) domainDest_->area_1d(countDest) = domainSrc_->area_1d(countSrc); 247 249 248 250 // bounds -
XIOS3/dev/XIOS_ATTACHED/src/transformation/domain_algorithm/domain_algorithm_redistribute.cpp
r2460 r2482 8 8 #include "grid.hpp" 9 9 #include "grid_transformation_factory_impl.hpp" 10 #include "context.hpp" 10 11 11 12 namespace xios … … 46 47 TRY 47 48 { 48 49 CContext* context = CContext::getCurrent(); 50 // Reset geometrical attributes to avoid incompatible (user/domainSource) attributs 51 // attributs will be defined using domainSource and/or transformation attributs 52 domainDestination->type.reset(); 53 domainDestination->ni_glo.reset(); 54 domainDestination->nj_glo.reset(); 55 56 domainDestination->i_index.reset(); // defined using domainSource->getLocalElement() 57 domainDestination->j_index.reset(); // " 58 domainDestination->ibegin.reset(); // will be computed in domainDestination->checkDomain() (from checkAttributes()) 59 domainDestination->ni.reset(); // " 60 domainDestination->jbegin.reset(); // " 61 domainDestination->nj.reset(); // " 62 63 domainDestination->mask_1d.reset(); // defined scanning domainSource->getFullView() & domainSource->getWorkflowView() differencies 64 domainDestination->mask_2d.reset(); // in all case domainDestination->mask_1d used as reference 65 66 // domainDestination->data_* attributes will be computed in : 67 domainDestination->data_dim.reset(); // domainDestination->checkDomainData() (from checkAttributes()) 68 domainDestination->data_ni.reset(); 69 domainDestination->data_nj.reset(); 70 domainDestination->data_ibegin.reset(); 71 domainDestination->data_jbegin.reset(); 72 domainDestination->data_i_index.reset(); // domainDestination->checkCompression() (from checkAttributes()) 73 domainDestination->data_j_index.reset(); 74 75 // Next attributes will be set using domainSource->attributes 76 domainDestination->lonvalue_1d.reset(); 77 domainDestination->latvalue_1d.reset(); 78 domainDestination->lonvalue_2d.reset(); 79 domainDestination->latvalue_2d.reset(); 80 domainDestination->nvertex.reset(); 81 domainDestination->bounds_lon_1d.reset(); 82 domainDestination->bounds_lat_1d.reset(); 83 domainDestination->bounds_lon_2d.reset(); 84 domainDestination->bounds_lat_2d.reset(); 85 domainDestination->area.reset(); 86 domainDestination->radius.reset(); 87 88 auto& index = redistributeDomain-> index ; 89 90 domainDestination->type = domainSource->type ; 91 domainDestination-> ni_glo = domainSource-> ni_glo ; 92 domainDestination-> nj_glo = domainSource-> nj_glo ; 93 94 CArray<size_t,1> globalIndex ; 95 int start_i, start_j ; 96 int size_i, size_j ; 97 int ni_glo = domainDestination-> ni_glo ; 98 int nj_glo = domainDestination-> nj_glo ; 99 100 101 if (redistributeDomain->type == CRedistributeDomain::type_attr::index) 102 { 103 globalIndex.resize(index.numElements()) ; 104 globalIndex=index ; 105 } 106 else 107 { 108 109 auto distType = CRedistributeDomain::type_attr::column ; 110 111 if (redistributeDomain->type == CRedistributeDomain::type_attr::bands && domainDestination->type == CDomain::type_attr::unstructured) 112 distType = CRedistributeDomain::type_attr::column ; 113 else distType=redistributeDomain->type; 114 115 if (distType==CRedistributeDomain::type_attr::bands) // Bands distribution to send to file server 116 { 117 int nbClient = context->getIntraCommSize() ; 118 int rankClient = context->getIntraCommRank() ; 119 120 int size = nj_glo/nbClient ; 121 int start ; 122 if (rankClient < nj_glo % nbClient) 123 { 124 size++ ; 125 start = rankClient*size ; 126 } 127 else start = (nj_glo % nbClient)*(size+1) + (rankClient-(nj_glo % nbClient)) * size ; 128 129 size_i=ni_glo ; start_i=0 ; 130 size_j=size ; start_j=start ; 131 } 132 else if (distType==CRedistributeDomain::type_attr::column) // Bands distribution to send to file server 133 { 134 int nbClient = context->getIntraCommSize() ; 135 int rankClient = context->getIntraCommRank() ; 136 137 int size = ni_glo/nbClient ; 138 int start ; 139 140 if (rankClient < ni_glo % nbClient) 141 { 142 size++ ; 143 start = rankClient*size ; 144 } 145 else start = (ni_glo % nbClient)*(size+1) + (rankClient-(ni_glo % nbClient)) * size ; 146 147 size_i=size ; start_i=start ; 148 size_j=nj_glo ; start_j=0 ; 149 } 150 else if (distType==CRedistributeDomain::type_attr::full) // domain is not distributed ie all servers get the same local domain 151 { 152 size_i=ni_glo ; start_i=0 ; 153 size_j=nj_glo ; start_j=0 ; 154 } 155 else if (distType==CRedistributeDomain::type_attr::root) // domain is not distributed ie all servers get the same local domain 156 { 157 if (context->getIntraCommRank()==0) 158 { 159 size_i=ni_glo ; start_i=0 ; 160 size_j=nj_glo ; start_j=0 ; 161 } 162 else 163 { 164 size_i=0 ; start_i=0 ; 165 size_j=0 ; start_j=0 ; 166 } 167 } 168 globalIndex.resize(size_i*size_j) ; 169 size_t ind ; 170 ind=0 ; 171 for(int j=start_j;j<start_j+size_j;j++) 172 for(int i=start_i;i<start_i+size_i;i++) 173 { 174 globalIndex(ind) = j*ni_glo+i ; 175 ind++ ; 176 } 177 } 178 179 180 //domainDestination->ni = globalIndex.numElements() ; 181 //domainDestination->nj = 1 ; 182 domainDestination->i_index.resize(globalIndex.numElements()) ; 183 domainDestination->i_index = globalIndex ; 184 domainDestination->j_index.resize(globalIndex.numElements()) ; 185 domainDestination->j_index = 0 ; 186 187 if (!domainSource->nvertex.isEmpty()) domainDestination->nvertex=domainSource->nvertex ; 188 if (!domainSource->radius.isEmpty()) domainDestination->radius = domainSource->radius ; 189 190 191 auto& transMap = this->transformationMapping_; 192 for(int i=0; i<globalIndex.numElements(); i++) transMap[globalIndex(i)]=globalIndex(i) ; 193 194 auto elementDst=shared_ptr<CLocalElement>(new CLocalElement(context->getIntraCommRank(),domainDestination-> ni_glo*domainDestination->nj_glo, globalIndex)) ; 195 elementDst->addFullView() ; 196 197 auto transformConnector = make_shared<CTransformConnector>(domainSource->getLocalView(CElementView::FULL), elementDst->getView(CElementView::FULL),context->getIntraComm()) ; 198 transformConnector->computeConnector() ; 199 200 if (domainSource->hasLonLat) 201 { 202 transformConnector->transfer(domainSource->lonvalue, domainDestination->lonvalue_1d) ; 203 transformConnector->transfer(domainSource->latvalue, domainDestination->latvalue_1d) ; 204 } 205 206 if (domainSource->hasBounds) 207 { 208 int nv ; 209 if (domainDestination->type == CDomain::type_attr::rectilinear) nv=2 ; 210 else if (domainDestination->type == CDomain::type_attr::curvilinear) nv=4 ; 211 else if (domainDestination->type == CDomain::type_attr::unstructured) nv=domainDestination->nvertex ; 212 213 { // bounds_lon 214 CArray<double,1> boundsSrc(domainSource->bounds_lonvalue.dataFirst(),shape(domainSource->bounds_lonvalue.numElements()),neverDeleteData) ; 215 CArray<double,1> boundsDst ; 216 transformConnector->transfer(nv, boundsSrc, boundsDst) ; 217 domainDestination->bounds_lon_1d.resize(nv,globalIndex.numElements()) ; 218 domainDestination->bounds_lon_1d = CArray<double,2>(boundsDst.dataFirst(), shape(nv,globalIndex.numElements()),neverDeleteData) ; 219 } 220 { // bounds_lat 221 CArray<double,1> boundsSrc(domainSource->bounds_latvalue.dataFirst(),shape(domainSource->bounds_latvalue.numElements()),neverDeleteData) ; 222 CArray<double,1> boundsDst ; 223 transformConnector->transfer(nv, boundsSrc, boundsDst) ; 224 domainDestination->bounds_lat_1d.resize(nv,globalIndex.numElements()) ; 225 domainDestination->bounds_lat_1d = CArray<double,2>(boundsDst.dataFirst(), shape(nv,globalIndex.numElements()),neverDeleteData) ; 226 } 227 } 228 229 if (domainSource->hasArea) transformConnector->transfer(domainSource->areavalue, domainDestination->area_1d) ; 230 231 // transfer the mask 232 auto transformMask = make_shared<CTransformConnector>(domainSource->getLocalView(CElementView::WORKFLOW), elementDst->getView(CElementView::FULL),context->getIntraComm()) ; 233 transformMask->computeConnector() ; 234 235 CArray<bool,1> workflow(domainSource->getLocalView(CElementView::WORKFLOW)->getSize()) ; 236 domainDestination->mask_1d.resize(domainSource->getLocalView(CElementView::FULL)->getSize()) ; 237 workflow=true ; 238 239 transformMask->transfer(workflow,domainDestination->mask_1d,false) ; 240 /* 241 CArray<int,1> workflow(domainSource->getLocalView(CElementView::WORKFLOW)->getSize()) ; 242 CArray<int,1> mask(domainSource->getLocalView(CElementView::FULL)->getSize()) ; 243 workflow=1 ; 244 245 transformMask->transfer(workflow,mask,0) ; 246 domainDestination->mask_1d.resize(mask.numElements()) ; 247 for(int i=0 ; i<mask.numElements() ; i++) 248 if (mask(i)==1) domainDestination->mask_1d(i)=true ; 249 else domainDestination->mask_1d(i)=false ; 250 */ 49 251 50 252 domainDestination->checkAttributes() ; 253 this->computeAlgorithm(domainSource->getLocalView(CElementView::WORKFLOW), domainDestination->getLocalView(CElementView::WORKFLOW)) ; 51 254 } 52 255 CATCH -
XIOS3/dev/XIOS_ATTACHED/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp
r2270 r2482 128 128 else if (!domainSource->lonvalue_2d.isEmpty() ) 129 129 { 130 domainDestination->latvalue_2d.resize( domainSource->latvalue_2d. numElements() );131 domainDestination->lonvalue_2d.resize( domainSource->lonvalue_2d. numElements() );130 domainDestination->latvalue_2d.resize( domainSource->latvalue_2d.shape() ); 131 domainDestination->lonvalue_2d.resize( domainSource->lonvalue_2d.shape() ); 132 132 domainDestination->latvalue_2d = domainSource->latvalue_2d; 133 133 domainDestination->lonvalue_2d = domainSource->lonvalue_2d; … … 145 145 else if (!domainSource->bounds_lon_2d.isEmpty() ) 146 146 { 147 domainDestination->bounds_lon_2d.resize( domainSource->bounds_lon_2d. numElements() );148 domainDestination->bounds_lat_2d.resize( domainSource->bounds_lat_2d. numElements() );147 domainDestination->bounds_lon_2d.resize( domainSource->bounds_lon_2d.shape() ); 148 domainDestination->bounds_lat_2d.resize( domainSource->bounds_lat_2d.shape() ); 149 149 domainDestination->bounds_lon_2d = domainSource->bounds_lon_2d; 150 150 domainDestination->bounds_lat_2d = domainSource->bounds_lat_2d; 151 151 } 152 152 // set area 153 if (!domainSource->area.isEmpty() ) 154 { 155 domainDestination->area.resize( domainSource->area.numElements() ); 156 domainDestination->area = domainSource->area; 157 } 153 if (!domainSource->area_1d.isEmpty() ) 154 { 155 domainDestination->area_1d.resize( domainSource->area_1d.numElements() ); 156 domainDestination->area_1d = domainSource->area_1d; 157 } 158 else if (!domainSource->area_2d.isEmpty() ) 159 { 160 domainDestination->area_2d.resize( domainSource->area_2d.shape() ); 161 domainDestination->area_2d = domainSource->area_2d; 162 } 163 158 164 if (!domainSource->radius.isEmpty() ) 159 165 domainDestination->radius = domainSource->radius; -
XIOS3/dev/XIOS_ATTACHED/src/transformation/domain_algorithm/domain_algorithm_zoom.cpp
r2270 r2482 173 173 } 174 174 } 175 if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest); 176 175 if (domainSrc_->hasArea) 176 { 177 if (!domainSrc_->area_1d.isEmpty()) domainDest_->area_1d.resize(niDest*njDest); 178 else if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d.resize(niDest,njDest); 179 } 177 180 178 181 for (int iDest = 0; iDest < niDest; iDest++) … … 196 199 197 200 if (domainSrc_->hasArea) 198 domainDest_->area(iDest,jDest) = domainSrc_->area(iSrc,jSrc); 201 { 202 if (!domainSrc_->area_1d.isEmpty()) domainDest_->area_1d(indLocDest) = domainSrc_->area_1d(ind); 203 else if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d(iDest,jDest) = domainSrc_->area_2d(iSrc,jSrc); 204 } 199 205 200 206 if (domainSrc_->hasLonLat) -
XIOS3/dev/XIOS_ATTACHED/src/transformation/scalar_algorithm/scalar_algorithm_extract_axis.cpp
r2303 r2482 108 108 } 109 109 110 if (axisSource->hasValue )110 if (axisSource->hasValue()) 111 111 { 112 112 scalarDestination->value = axisSource->value(idxSrc); -
XIOS3/dev/XIOS_ATTACHED/src/transformation/scalar_algorithm/scalar_algorithm_redistribute.cpp
r2460 r2482 8 8 #include "grid.hpp" 9 9 #include "grid_transformation_factory_impl.hpp" 10 #include "context.hpp" 10 11 11 12 namespace xios … … 47 48 { 48 49 50 CContext* context = CContext::getCurrent(); 51 52 scalarDestination->n.reset(); 53 scalarDestination->mask.reset(); 54 scalarDestination->value.reset(); 55 scalarDestination->bounds.reset(); 56 57 redistributeScalar->checkValid(scalarSource); 58 59 // define the global index of the new domain 60 61 CArray<size_t,1> globalIndex ; 62 63 if ( redistributeScalar->type == CRedistributeScalar::type_attr::bands 64 || redistributeScalar->type == CRedistributeScalar::type_attr::column 65 || redistributeScalar->type == CRedistributeScalar::type_attr::root ) 66 { 67 if (context->getIntraCommRank()==0) 68 { 69 scalarDestination->n = 1; 70 globalIndex.resize(1) ; 71 globalIndex(0)=0 ; 72 } 73 else 74 { 75 scalarDestination->n = 0; 76 globalIndex.resize(0) ; 77 } 78 } 79 else if (redistributeScalar->type == CRedistributeScalar::type_attr::full) 80 { 81 scalarDestination->n = 1; 82 globalIndex.resize(1) ; 83 globalIndex(0)=0 ; 84 } 85 86 auto& transMap = this->transformationMapping_; 87 for(int i=0; i<globalIndex.numElements(); i++) transMap[globalIndex(i)]=globalIndex(i) ; 88 89 auto elementDst=shared_ptr<CLocalElement>(new CLocalElement(context->getIntraCommRank(), 1, globalIndex)) ; 90 elementDst->addFullView() ; 91 92 auto transformConnector = make_shared<CTransformConnector>(scalarSource->getLocalView(CElementView::FULL), elementDst->getView(CElementView::FULL),context->getIntraComm()) ; 93 transformConnector->computeConnector() ; 94 95 CArray<double,1> valSrc, valDst ; 96 valSrc.resize(scalarSource->getLocalView(CElementView::FULL)->getSize()) ; 97 valDst.resize(scalarDestination->getLocalView(CElementView::FULL)->getSize()) ; 98 99 if (scalarSource->hasValue()) 100 { 101 if (valSrc.numElements()>0) valSrc(0)=scalarSource->value ; 102 transformConnector->transfer(valSrc, valDst) ; 103 if (valDst.numElements()>0) scalarDestination->value = valDst(0) ; 104 } 105 106 if (scalarSource->hasBounds()) 107 { 108 transformConnector->transfer(2, scalarSource->bounds, scalarDestination->bounds) ; 109 } 110 111 if (scalarSource->hasLabel()) 112 { 113 //ym transferTransformConnector.transfer(axisSrc->label, axisDestination->label) ; -> probably not supported now, see later 114 } 115 116 // transfer the mask 117 auto transformMask = make_shared<CTransformConnector>(scalarSource->getLocalView(CElementView::WORKFLOW), elementDst->getView(CElementView::FULL),context->getIntraComm()) ; 118 transformMask->computeConnector() ; 119 120 CArray<bool,1> workflow(scalarSource->getLocalView(CElementView::WORKFLOW)->getSize()) ; 121 CArray<bool,1> mask ; 122 mask.resize(scalarSource->getLocalView(CElementView::FULL)->getSize()) ; 123 workflow=true ; 124 125 transformMask->transfer(workflow, mask, false) ; 126 scalarDestination->mask = mask(0) ; 49 127 50 128 scalarDestination->checkAttributes() ; -
XIOS3/dev/XIOS_ATTACHED/src/transport/context_client.cpp
r2343 r2482 18 18 #include "one_sided_context_client.hpp" 19 19 #include "legacy_context_client.hpp" 20 #include "online_context_client.hpp" 21 20 22 21 23 namespace xios … … 61 63 if (defaultProtocol=="one_sided") return getNew<CContextClient::oneSided>(parent, intraComm, interComm) ; 62 64 else if (defaultProtocol=="legacy") return getNew<CContextClient::legacy>(parent, intraComm, interComm) ; 65 else if (defaultProtocol=="online") return getNew<CContextClient::online>(parent, intraComm, interComm) ; 63 66 else if (defaultProtocol=="default") return getNew<CContextClient::legacy>(parent, intraComm, interComm) ; 64 67 else ERROR("CContextClient* CContextClient::getNew<CContextClient::generic>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer)", … … 76 79 { 77 80 return new CLegacyContextClient(parent, intraComm, interComm, parentServer); 81 } 82 83 template<> 84 CContextClient* CContextClient::getNew<CContextClient::online>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer) 85 { 86 return new COnlineContextClient(parent, intraComm, interComm, parentServer); 78 87 } 79 88 -
XIOS3/dev/XIOS_ATTACHED/src/transport/context_client.hpp
r2343 r2482 28 28 { 29 29 public: 30 enum ETransport { generic, legacy, oneSided } ;30 enum ETransport { generic, legacy, oneSided, online} ; 31 31 32 32 template<ETransport transport=generic> … … 56 56 57 57 58 virtual ETransport getType(void) = 0 ; 58 59 // Send event to server 59 60 virtual void sendEvent(CEventClient& event)=0; … … 68 69 virtual void setBufferSize(const std::map<int,StdSize>& mapSize)=0; 69 70 70 71 public: 72 static CContextClient* ONLINE(void) { return reinterpret_cast<CContextClient*>(0xdeaddead);} 71 73 protected: 72 74 … … 104 106 CContextClient* CContextClient::getNew<CContextClient::legacy>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer) ; 105 107 108 template<> 109 CContextClient* CContextClient::getNew<CContextClient::online>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer) ; 110 106 111 107 112 } -
XIOS3/dev/XIOS_ATTACHED/src/transport/legacy_context_client.cpp
r2458 r2482 40 40 } 41 41 42 CContextClient::ETransport getType(void) {return CContextClient::legacy ;} 42 43 43 44 /*! -
XIOS3/dev/XIOS_ATTACHED/src/transport/legacy_context_client.hpp
r2458 r2482 31 31 32 32 // Send event to server 33 ETransport getType(void) {return legacy ;} 33 34 void sendEvent(CEventClient& event); 34 35 void eventLoop(void) ; -
XIOS3/dev/XIOS_ATTACHED/src/transport/one_sided_context_client.hpp
r2458 r2482 30 30 COneSidedContextClient(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0); 31 31 32 ETransport getType(void) {return oneSided ;} 32 33 // Send event to server 33 34 void sendEvent(CEventClient& event);
Note: See TracChangeset
for help on using the changeset viewer.