Changeset 1679 for XIOS/dev/dev_trunk_omp/src/node
- Timestamp:
- 07/02/19 11:42:27 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/node/field.cpp
r1677 r1679 1133 1133 1134 1134 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1135 1135 1136 const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1137 1138 1136 1139 const double defaultValue = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 1137 1140 1138 1141 CContext* context = CContext::getCurrent(); 1142 Time filter_start; 1143 if(!build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = context->calendar->getInitDate()+build_workflow_graph_start; 1144 else if(build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = 0; 1145 else filter_start = -1; 1146 1147 Time filter_end; 1148 if(!build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = context->calendar->getInitDate()+build_workflow_graph_end; 1149 else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807; 1150 else filter_end = -1; 1151 1152 1139 1153 bool hasWriterServer = context->hasServer && !context->hasClient; 1140 1154 bool hasIntermediateServer = context->hasServer && context->hasClient; … … 1181 1195 boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 1182 1196 std::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 1183 filter->output_field_id = this->getId();1184 1197 1185 1198 // Check if a spatial transformation is needed … … 1193 1206 { 1194 1207 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, 1195 detectMissingValues, defaultValue , buildWorkflowGraph);1208 detectMissingValues, defaultValue); 1196 1209 1197 1210 filter->connectOutput(filters.first, 0); 1198 filters.second->output_field_id = this->getId();1199 1211 1200 1212 … … 1205 1217 1206 1218 instantDataFilter = filter; 1207 instantDataFilter->output_field_id = this->getId(); 1208 filter->output_field_id = this->getId(); 1219 instantDataFilter->field = this; 1209 1220 filter->tag = buildWorkflowGraph; 1210 // std::cout<<"=====1============= output_field_id = "<<this->getId()<<" =========== tag="<<filter->tag<<std::endl; 1221 1222 filter->start_graph = filter_start; 1223 filter->end_graph = filter_end; 1224 1211 1225 for(int i=0; i<filter->parent_filters.size(); i++) 1212 1226 { 1213 // std::cout<<"transforme filter cout= "<<std::shared_ptr<COutputPin>(filter)<<" parent filter = "<<filter->parent_filters[i]<<std::endl;1214 1227 filter->tag = filter->tag || filter->parent_filters[i]->tag; 1215 1228 } … … 1226 1239 instantDataFilter = getFieldReference(gc); 1227 1240 instantDataFilter->tag = buildWorkflowGraph; 1241 instantDataFilter->start_graph = filter_start; 1242 instantDataFilter->end_graph = filter_end; 1228 1243 } 1229 1244 // Check if the data is to be read from a file … … 1232 1247 checkTimeAttributes(); 1233 1248 instantDataFilter = serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false, freq_offset, true, 1234 detectMissingValues, defaultValue , buildWorkflowGraph));1249 detectMissingValues, defaultValue)); 1235 1250 instantDataFilter->tag = buildWorkflowGraph; 1251 instantDataFilter->start_graph = filter_start; 1252 instantDataFilter->end_graph = filter_end; 1253 instantDataFilter->field = this; 1254 1236 1255 } 1237 1256 else // The data might be passed from the model … … 1239 1258 if (check_if_active.isEmpty()) check_if_active = false; 1240 1259 instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, true, NoneDu, false, 1241 detectMissingValues, defaultValue , buildWorkflowGraph));1260 detectMissingValues, defaultValue)); 1242 1261 instantDataFilter->tag = buildWorkflowGraph; 1243 // std::cout<<"=====4============= output_field_id = "<<this->getId()<<" =========== tag="<<instantDataFilter->tag<<std::endl; 1244 // std::cout<<"Source filter cout = "<<std::shared_ptr<COutputPin>(clientSourceFilter)<<std::endl; 1262 instantDataFilter->start_graph = filter_start; 1263 instantDataFilter->end_graph = filter_end; 1264 instantDataFilter->field = this; 1245 1265 } 1246 1266 } … … 1256 1276 1257 1277 storeFilter->tag = (instantDataFilter->tag || buildWorkflowGraph); 1278 instantDataFilter->start_graph = filter_start; 1279 instantDataFilter->end_graph = filter_end; 1280 1258 1281 instantDataFilter->setParentFiltersTag(); 1282 storeFilter->start_graph = filter_start; 1283 storeFilter->end_graph = filter_end; 1284 storeFilter->field = this; 1259 1285 } 1260 1286 1261 1287 if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write)) 1262 1288 { 1263 fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this , buildWorkflowGraph));1289 fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 1264 1290 getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 1265 std::cout<<"=====10============= output_field_id = "<<this->name<<std::endl;1266 // std::cout<<"CFileWriterFilter filter = "<<fileWriterFilter<<" parent filter = "<<std::shared_ptr<COutputPin>(getTemporalDataFilter(gc, file->output_freq))<<std::endl;1267 1291 1268 1292 fileWriterFilter->tag = (getTemporalDataFilter(gc, file->output_freq)->tag || buildWorkflowGraph); 1269 fileWriterFilter->output_field_id = this->name; 1293 getTemporalDataFilter(gc, file->output_freq)->start_graph = filter_start; 1294 getTemporalDataFilter(gc, file->output_freq)->end_graph = filter_end; 1270 1295 getTemporalDataFilter(gc, file->output_freq)->setParentFiltersTag(); 1296 fileWriterFilter->start_graph = filter_start; 1297 fileWriterFilter->end_graph = filter_end; 1298 1299 std::cout<<"CFileWriterFilter filter start = "<<filter_start<<" end = "<<filter_end<<std::endl; 1300 1271 1301 } 1272 1302 } … … 1291 1321 CField* fieldRef = CField::get(field_ref); 1292 1322 fieldRef->buildFilterGraph(gc, false); 1293 bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1323 const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1324 1325 CContext* context = CContext::getCurrent(); 1326 1327 Time filter_start; 1328 if(!build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = context->calendar->getInitDate()+build_workflow_graph_start; 1329 else if(build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = 0; 1330 else filter_start = -1; 1331 1332 Time filter_end; 1333 if(!build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = context->calendar->getInitDate()+build_workflow_graph_end; 1334 else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807; 1335 else filter_end = -1; 1336 1294 1337 1295 1338 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters; … … 1299 1342 bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1300 1343 double defaultValue = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 1301 filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue , buildWorkflowGraph);1344 filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue); 1302 1345 1303 1346 fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 1304 1347 1305 filters.second->output_field_id = this->getId();1306 1348 1307 1349 … … 1310 1352 1311 1353 filters.second->tag = (buildWorkflowGraph || filters.second->parent_filters[0]->tag); 1312 1313 // std::cout<<"=====5============= output_field_id = "<<this->getId()<<std::endl;1314 // std::cout<<"CSpatialTransformFilter first filter cout = "<<std::shared_ptr<COutputPin>(filters.first)<<" second filter cout = "<<std::shared_ptr<COutputPin>(filters.second)<< " parent filter = "<<fieldRef->getInstantDataFilter()<<std::endl;1315 1354 1355 filters.second->start_graph = filter_start; 1356 filters.second->end_graph = filter_end; 1357 filters.second->field = this; 1358 1316 1359 } 1317 1360 else 1318 1361 { 1319 filters.first = filters.second = std::shared_ptr<CFilter>(new CPassThroughFilter(gc , buildWorkflowGraph));1362 filters.first = filters.second = std::shared_ptr<CFilter>(new CPassThroughFilter(gc)); 1320 1363 1321 1364 fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 1322 filters.second->output_field_id = this->getId();1323 1365 1324 1366 … … 1328 1370 filters.second->tag = buildWorkflowGraph || filters.second->parent_filters[0]->tag; 1329 1371 1330 // std::cout<<"=====6============= output_field_id = "<<this->getId()<<" =========== tag="<<filters.second->tag<<std::endl; 1331 // std::cout<<"Pass through filter cout = "<<std::shared_ptr<COutputPin>(filters.second)<<" parent filter = "<<filters.second->parent_filters[0]<<std::endl; 1372 filters.second->start_graph = filter_start; 1373 filters.second->end_graph = filter_end; 1374 filters.second->field = this; 1332 1375 1333 1376 } … … 1391 1434 1392 1435 selfReferenceFilter->tag = buildWorkflowGraph; 1436 selfReferenceFilter->field = this; 1393 1437 return selfReferenceFilter; 1394 1438 } … … 1408 1452 { 1409 1453 std::map<CDuration, std::shared_ptr<COutputPin> >::iterator it = temporalDataFilters.find(outFreq); 1410 bool buildWorkflowGraph = buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1454 const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1455 1456 CContext* context = CContext::getCurrent(); 1457 1458 Time filter_start; 1459 if(!build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = context->calendar->getInitDate()+build_workflow_graph_start; 1460 else if(build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = 0; 1461 else filter_start = -1; 1462 1463 Time filter_end; 1464 if(!build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = context->calendar->getInitDate()+build_workflow_graph_end; 1465 else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807; 1466 else filter_end = -1; 1467 1468 1411 1469 1412 1470 if (it == temporalDataFilters.end()) … … 1421 1479 std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, CContext::getCurrent()->getCalendar()->getInitDate(), 1422 1480 freq_op, freq_offset, outFreq, 1423 detectMissingValues , buildWorkflowGraph));1481 detectMissingValues)); 1424 1482 1425 1483 instantDataFilter->connectOutput(temporalFilter, 0); 1426 temporalFilter->output_field_id = this->getId();1427 1484 temporalFilter->tag = buildWorkflowGraph; 1428 1485 … … 1431 1488 1432 1489 1433 // std::cout<<"=====8============= output_field_id = "<<this->getId()<<" =========== tag="<<temporalFilter->tag<<std::endl;1434 // std::cout<<"Temporal filter cout = "<<std::shared_ptr<COutputPin>(temporalFilter)<<" parent filter = "<<temporalFilter->parent_filters[0]<<std::endl;1435 1490 if(temporalFilter->parent_filters[0]->tag) temporalFilter->tag=true; 1491 1492 temporalFilter->start_graph = filter_start; 1493 temporalFilter->end_graph = filter_end; 1494 temporalFilter->field = this; 1436 1495 1437 1496 it = temporalDataFilters.insert(std::make_pair(outFreq, temporalFilter)).first; … … 1473 1532 CContext::getCurrent()->getCalendar()->getInitDate(), 1474 1533 freq_op, freq_offset, outFreq, 1475 detectMissingValues , buildWorkflowGraph));1534 detectMissingValues)); 1476 1535 1477 1536 selfReferenceFilter->connectOutput(temporalFilter, 0); 1478 temporalFilter->output_field_id = this->getId();1479 1537 temporalFilter->tag = buildWorkflowGraph; 1480 // std::cout<<"=====9============= output_field_id = "<<this->getId()<<" =========== tag="<<temporalFilter->tag<<std::endl;1538 temporalFilter->field = this; 1481 1539 1482 1540 return temporalFilter ;
Note: See TracChangeset
for help on using the changeset viewer.