Changeset 2002


Ignore:
Timestamp:
01/05/21 10:12:00 (9 months ago)
Author:
ymipsl
Message:

Some cleaning of old transformation dead code

YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src
Files:
2 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp

    r1875 r2002  
    5050      { 
    5151        CField* fieldAuxInput = CField::get(auxInputs[idx]); 
    52         fieldAuxInput->buildFilterGraph(gc, false); 
     52       //ym fieldAuxInput->buildFilterGraph(gc, false); 
    5353        fieldAuxInput->getInstantDataFilter()->connectOutput(firstFilter,idx+1); 
    5454      } 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp

    r1988 r2002  
    12431243      for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i) 
    12441244        (void)this->enabledReadModeFiles[i]->readAttributesOfEnabledFieldsInReadMode(); 
    1245    } 
    1246    CATCH_DUMP_ATTR 
    1247  
    1248     /*! 
    1249       Go up the hierachical tree via field_ref and do check of attributes of fields 
    1250       This can be done in a client then all computed information will be sent from this client to others 
    1251       \param [in] sendToServer Flag to indicate whether calculated information will be sent 
    1252    */ 
    1253    void CContext::solveOnlyRefOfEnabledFields(void) 
    1254    TRY 
    1255    { 
    1256      int size = this->enabledFiles.size(); 
    1257      for (int i = 0; i < size; ++i) 
    1258      { 
    1259        this->enabledFiles[i]->solveOnlyRefOfEnabledFields(); 
    1260      } 
    1261  
    1262      for (int i = 0; i < size; ++i) 
    1263      { 
    1264        this->enabledFiles[i]->generateNewTransformationGridDest(); 
    1265      } 
    1266  
    1267      size = this->enabledCouplerOut.size(); 
    1268      for (int i = 0; i < size; ++i) 
    1269      { 
    1270        this->enabledCouplerOut[i]->solveOnlyRefOfEnabledFields(); 
    1271      } 
    1272  
    1273      for (int i = 0; i < size; ++i) 
    1274      { 
    1275        this->enabledCouplerOut[i]->generateNewTransformationGridDest(); 
    1276      } 
    1277    } 
    1278    CATCH_DUMP_ATTR 
    1279  
    1280     /*! 
    1281       Go up the hierachical tree via field_ref and do check of attributes of fields. 
    1282       The transformation can be done in this step. 
    1283       All computed information will be sent from this client to others. 
    1284       \param [in] sendToServer Flag to indicate whether calculated information will be sent 
    1285    */ 
    1286    void CContext::solveAllRefOfEnabledFieldsAndTransform(void) 
    1287    TRY 
    1288    { 
    1289      int size = this->enabledFiles.size(); 
    1290      for (int i = 0; i < size; ++i) 
    1291      { 
    1292        this->enabledFiles[i]->solveAllRefOfEnabledFieldsAndTransform(); 
    1293      } 
    1294  
    1295      size = this->enabledCouplerOut.size(); 
    1296      for (int i = 0; i < size; ++i) 
    1297      { 
    1298        this->enabledCouplerOut[i]->solveAllRefOfEnabledFieldsAndTransform(); 
    1299      } 
    1300  
    13011245   } 
    13021246   CATCH_DUMP_ATTR 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp

    r1984 r2002  
    138138         void initReadFiles(void); 
    139139         void prepareTimeseries(void); 
    140          void solveOnlyRefOfEnabledFields(void);          
    141140         void postProcessFilterGraph(); 
    142141         void startPrefetchingOfEnabledReadModeFiles(); 
     
    145144         void findFieldsWithReadAccess(void); 
    146145         void triggerLateFields(void) ; 
    147          void solveAllRefOfEnabledFieldsAndTransform(void); 
    148   
     146           
    149147         std::map<int, StdSize> getAttributesBufferSize(std::map<int, StdSize>& maxEventSize, CContextClient* contextClient, bool bufferForWriting = false); 
    150148         std::map<int, StdSize> getDataBufferSize(std::map<int, StdSize>& maxEventSize, CContextClient* contextClient, bool bufferForWriting = false); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.cpp

    r1875 r2002  
    161161   CATCH_DUMP_ATTR 
    162162 
    163    
    164    void CCouplerOut::solveOnlyRefOfEnabledFields(void) 
    165    TRY 
    166    { 
    167      int size = this->enabledFields.size(); 
    168      for (int i = 0; i < size; ++i) 
    169      { 
    170        this->enabledFields[i]->solveOnlyReferenceEnabledField(); 
    171      } 
    172    } 
    173    CATCH_DUMP_ATTR 
    174  
    175    void CCouplerOut::generateNewTransformationGridDest(void) 
    176    TRY 
    177    { 
    178      int size = this->enabledFields.size(); 
    179      for (int i = 0; i < size; ++i) 
    180      { 
    181        this->enabledFields[i]->generateNewTransformationGridDest(); 
    182      } 
    183    } 
    184    CATCH_DUMP_ATTR 
    185  
    186    void CCouplerOut::solveAllRefOfEnabledFieldsAndTransform(void) 
    187    TRY 
    188    { 
    189      int size = this->enabledFields.size(); 
    190      for (int i = 0; i < size; ++i) 
    191      {        
    192       this->enabledFields[i]->solveAllEnabledFieldsAndTransform(); 
    193      } 
    194    } 
    195    CATCH_DUMP_ATTR 
    196  
    197    /*! 
    198     * Constructs the filter graph for each active field. 
    199     * 
    200     * \param gc the garbage collector to use when building the filter graph 
    201     */ 
    202    void CCouplerOut::buildFilterGraphOfEnabledFields(CGarbageCollector& gc) 
    203    TRY 
    204    { 
    205      int size = this->enabledFields.size(); 
    206      for (int i = 0; i < size; ++i) 
    207      { 
    208        this->enabledFields[i]->buildFilterGraph(gc, true); 
    209      } 
    210    } 
    211    CATCH_DUMP_ATTR 
    212163 
    213164   void CCouplerOut::checkGridOfEnabledFields(void) 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.hpp

    r1875 r2002  
    9191        void solveFieldRefInheritance(bool apply); 
    9292        void createInterCommunicator(void) ; 
    93         void solveOnlyRefOfEnabledFields(void); 
    94         void generateNewTransformationGridDest(void); 
    95         void solveAllRefOfEnabledFieldsAndTransform() ; 
    96         void buildFilterGraphOfEnabledFields(CGarbageCollector& gc); 
    9793        void checkGridOfEnabledFields(void) ; 
    9894        void assignContext(void) ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp

    r1999 r2002  
    394394  //---------------------------------------------------------------- 
    395395 
    396   /*! 
    397     Build up graph of grids which plays role of destination and source in grid transformation 
    398     This function should be called before \func solveGridReference() 
    399   */ 
    400   void CField::buildGridTransformationGraph() 
    401   TRY 
    402   { 
    403     CContext* context = CContext::getCurrent(); 
    404     if (context->getServiceType()==CServicesManager::CLIENT) 
    405     { 
    406       if (grid_ && !grid_->isTransformed() && hasDirectFieldReference() && grid_ != getDirectFieldReference()->grid_) 
    407       { 
    408         grid_->addTransGridSource(getDirectFieldReference()->grid_); 
    409       } 
    410     } 
    411   } 
    412   CATCH_DUMP_ATTR 
    413  
    414   /*! 
    415     Generate a new grid destination if there are more than one grid source pointing to a same grid destination 
    416   */ 
    417   void CField::generateNewTransformationGridDest() 
    418   TRY 
    419   { 
    420     CContext* context = CContext::getCurrent(); 
    421     if (context->getServiceType()==CServicesManager::CLIENT) 
    422     { 
    423       std::map<CGrid*,std::pair<bool,StdString> >& gridSrcMap = grid_->getTransGridSource(); 
    424       if (1 < gridSrcMap.size()) 
    425       { 
    426         // Search for grid source 
    427         CGrid* gridSrc = grid_; 
    428         CField* currField = this; 
    429         std::vector<CField*> hieraField; 
    430         while (currField->hasDirectFieldReference() && (gridSrc == grid_)) 
    431         { 
    432           hieraField.push_back(currField); 
    433           CField* tmp = currField->getDirectFieldReference(); 
    434           currField = tmp; 
    435           gridSrc = currField->grid_; 
    436         } 
    437  
    438         if (gridSrcMap.end() != gridSrcMap.find(gridSrc)) 
    439         { 
    440           CGrid* gridTmp; 
    441           std::pair<bool,StdString> newGridDest = gridSrcMap[gridSrc]; 
    442           if (newGridDest.first) 
    443           { 
    444             StdString newIdGridDest = newGridDest.second; 
    445             if (!CGrid::has(newIdGridDest)) 
    446             { 
    447               ERROR("CGrid* CGrid::generateNewTransformationGridDest()", 
    448                 << " Something wrong happened! Grid whose id " << newIdGridDest 
    449                 << "should exist "); 
    450             } 
    451             gridTmp = CGrid::get(newIdGridDest); 
    452           } 
    453           else 
    454           { 
    455             StdString newIdGridDest = CGrid::generateId(gridSrc, grid_); 
    456             gridTmp = CGrid::cloneGrid(newIdGridDest, grid_); 
    457  
    458             (gridSrcMap[gridSrc]).first = true; 
    459             (gridSrcMap[gridSrc]).second = newIdGridDest; 
    460           } 
    461  
    462           // Update all descendants 
    463           for (std::vector<CField*>::iterator it = hieraField.begin(); it != hieraField.end(); ++it) 
    464           { 
    465             (*it)->grid_ = gridTmp; 
    466             (*it)->updateRef((*it)->grid_); 
    467           } 
    468         } 
    469       } 
    470     } 
    471   } 
    472   CATCH_DUMP_ATTR 
    473  
    474396  void CField::updateRef(CGrid* grid) 
    475397  TRY 
     
    497419  CATCH_DUMP_ATTR 
    498420    
    499   /*! 
    500     Solve reference of all enabled fields even the source fields . 
    501     In this step, we do transformations. 
    502   */ 
    503   void CField::solveAllEnabledFieldsAndTransform() 
    504   TRY 
    505   { 
    506     CContext* context = CContext::getCurrent(); 
    507  
    508     if (!isReferenceSolvedAndTransformed) 
    509     { 
    510       isReferenceSolvedAndTransformed = true; 
    511  
    512       if (context->getServiceType()==CServicesManager::CLIENT) 
    513       { 
    514         solveRefInheritance(true); 
    515         if (hasDirectFieldReference()) getDirectFieldReference()->solveAllEnabledFieldsAndTransform(); 
    516       } 
    517  
    518       if (context->getServiceType()==CServicesManager::GATHERER || context->getServiceType()==CServicesManager::OUT_SERVER) 
    519         solveServerOperation(); 
    520  
    521       solveGridReference(); 
    522  
    523       if (context->getServiceType()==CServicesManager::CLIENT) 
    524       { 
    525         solveGenerateGrid(); 
    526         buildGridTransformationGraph(); 
    527       } 
    528  
    529       solveGridDomainAxisRef(false); 
    530  
    531       if (context->getServiceType()==CServicesManager::CLIENT) 
    532       { 
    533         solveTransformedGrid(); 
    534       } 
    535  
    536       solveGridDomainAxisRef(false); 
    537     } 
    538   } 
    539   CATCH_DUMP_ATTR 
    540421 
    541422  void CField::checkGridOfEnabledFields() 
     
    564445    solveCheckMaskIndex(true); 
    565446  }    
    566   CATCH_DUMP_ATTR 
    567  
    568   void CField::solveOnlyReferenceEnabledField(void) 
    569   TRY 
    570   { 
    571     CContext* context = CContext::getCurrent(); 
    572     if (!isReferenceSolved) 
    573     { 
    574       isReferenceSolved = true; 
    575  
    576       if (context->getServiceType()==CServicesManager::CLIENT) 
    577       { 
    578         solveRefInheritance(true); 
    579         if (hasDirectFieldReference()) getDirectFieldReference()->solveOnlyReferenceEnabledField(); 
    580       } 
    581  
    582       if (context->getServiceType()==CServicesManager::GATHERER || context->getServiceType()==CServicesManager::OUT_SERVER) 
    583         solveServerOperation(); 
    584  
    585       solveGridReference(); 
    586       grid_->solveElementsRefInheritance(true); // make it again to solve grid reading from file 
    587  
    588       if (context->getServiceType()==CServicesManager::CLIENT) 
    589       { 
    590         solveGenerateGrid(); 
    591         buildGridTransformationGraph(); 
    592       } 
    593     } 
    594   } 
    595   CATCH_DUMP_ATTR 
    596  
    597   void CField::solveAllReferenceEnabledField(bool doSending2Server) 
    598   TRY 
    599   { 
    600     CContext* context = CContext::getCurrent(); 
    601     solveOnlyReferenceEnabledField(); 
    602  
    603     if (!areAllReferenceSolved) 
    604     { 
    605       areAllReferenceSolved = true; 
    606        
    607       if (context->getServiceType()==CServicesManager::CLIENT) 
    608       { 
    609         solveRefInheritance(true); 
    610         if (hasDirectFieldReference()) getDirectFieldReference()->solveAllReferenceEnabledField(false); 
    611       } 
    612       else if (context->getServiceType()==CServicesManager::GATHERER || context->getServiceType()==CServicesManager::OUT_SERVER) 
    613         solveServerOperation(); 
    614  
    615       solveGridReference(); 
    616     } 
    617  
    618     solveGridDomainAxisRef(doSending2Server); 
    619  
    620     if (context->getServiceType()==CServicesManager::CLIENT) 
    621     { 
    622       solveTransformedGrid(); 
    623     } 
    624  
    625   } 
    626447  CATCH_DUMP_ATTR 
    627448 
     
    1013834  } 
    1014835 
    1015   /*! 
    1016    * Constructs the graph filter for the field, enabling or not the data output. 
    1017    * This method should not be called more than once with enableOutput equal to true. 
    1018    * 
    1019    * \param gc the garbage collector to use when building the filter graph 
    1020    * \param enableOutput must be true when the field data is to be 
    1021    *                     read by the client or/and written to a file 
    1022    */ 
    1023    // ym obselete : to be removed later.... 
    1024   void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput) 
    1025   TRY 
    1026   {      
    1027    //  ==> before removing, solving dependency in spatial_transform_filter.cpp about auxilairy field 
    1028 /* 
    1029     if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform(); 
    1030     if (!isGridChecked) checkGridOfEnabledFields(); 
    1031  
    1032     const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    1033     const double defaultValue  = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
    1034  
    1035     CContext* context = CContext::getCurrent(); 
    1036     bool hasWriterServer = context->getServiceType()==CServicesManager::OUT_SERVER ; 
    1037     bool hasIntermediateServer = context->getServiceType()==CServicesManager::GATHERER ; 
    1038  
    1039     if (hasWriterServer) 
    1040     { 
    1041       if (!instantDataFilter) 
    1042         instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid_, true, false)); 
    1043  
    1044  
    1045       // If the field data is to be read by the client or/and written to a file 
    1046       if (enableOutput && !clientToModelStoreFilter_ && !fileWriterFilter) 
    1047       { 
    1048         if (getRelFile() && (getRelFile()->mode.isEmpty() || getRelFile()->mode == CFile::mode_attr::write)) 
    1049         { 
    1050           fileServerWriterFilter = std::shared_ptr<CFileServerWriterFilter>(new CFileServerWriterFilter(gc, this)); 
    1051           instantDataFilter->connectOutput(fileServerWriterFilter, 0); 
    1052         } 
    1053       } 
    1054     } 
    1055     else if (hasIntermediateServer) 
    1056     { 
    1057       if (!instantDataFilter) 
    1058         instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid_, false, false)); 
    1059  
    1060       // If the field data is to be read by the client or/and written to a file 
    1061       if (enableOutput && !clientToModelStoreFilter_ && !fileWriterFilter) 
    1062       { 
    1063         if (getRelFile() && (getRelFile()->mode.isEmpty() || getRelFile()->mode == CFile::mode_attr::write)) 
    1064         { 
    1065           fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, getRelFile()->getContextClient())); 
    1066           instantDataFilter->connectOutput(fileWriterFilter, 0); 
    1067         } 
    1068       } 
    1069     } 
    1070     else 
    1071     { 
    1072       // Start by building a filter which can provide the field's instant data 
    1073       if (!instantDataFilter) 
    1074       { 
    1075         // Check if we have an expression to parse 
    1076         if (hasExpression()) 
    1077         { 
    1078           boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 
    1079           std::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 
    1080  
    1081           // Check if a spatial transformation is needed 
    1082           if (!field_ref.isEmpty()) 
    1083           { 
    1084             CGrid* gridRef = CField::get(field_ref)->grid_; 
    1085             if (grid_ && grid_ != gridRef && grid_->hasTransform()) 
    1086             { 
    1087                 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid_, detectMissingValues, defaultValue);  
    1088  
    1089               filter->connectOutput(filters.first, 0); 
    1090               filter = filters.second; 
    1091             } 
    1092           } 
    1093  
    1094           instantDataFilter = filter; 
    1095         } 
    1096         // Check if we have a reference on another field 
    1097         else if (!field_ref.isEmpty()) instantDataFilter = getFieldReference(gc); 
    1098         // Check if the data is to be read from a file 
    1099         else if (getRelFile() && !getRelFile()->mode.isEmpty() && getRelFile()->mode == CFile::mode_attr::read) 
    1100         { 
    1101           checkTimeAttributes(); 
    1102           instantDataFilter = serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid_, true, false, freq_offset, true, 
    1103                                                                                                        detectMissingValues, defaultValue)); 
    1104         } 
    1105         else // The data might be passed from the model 
    1106         { 
    1107           if (check_if_active.isEmpty()) check_if_active = false;  
    1108           instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid_, false, true, NoneDu, false, 
    1109                                                                                                       detectMissingValues, defaultValue)); 
    1110         } 
    1111       } 
    1112  
    1113       // If the field data is to be read by the client or/and written to a file 
    1114       if (enableOutput && !clientToModelStoreFilter_ && !fileWriterFilter) 
    1115       { 
    1116         if (!read_access.isEmpty() && read_access) 
    1117         { 
    1118           clientToModelStoreFilter_ = std::shared_ptr<CClientToModelStoreFilter>(new CClientToModelStoreFilter(gc, this)); 
    1119           instantDataFilter->connectOutput(clientToModelStoreFilter_, 0); 
    1120         } 
    1121  
    1122         if (getRelFile() && (getRelFile()->mode.isEmpty() || getRelFile()->mode == CFile::mode_attr::write)) 
    1123         { 
    1124           fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, getRelFile()->getContextClient())); 
    1125           getTemporalDataFilter(gc, getRelFile()->output_freq)->connectOutput(fileWriterFilter, 0); 
    1126         } 
    1127       } 
    1128     } 
    1129 */   
    1130   } 
    1131   CATCH_DUMP_ATTR 
    1132  
    1133   /*! 
    1134    * Returns the filter needed to handle the field reference. 
    1135    * This method should only be called when building the filter graph corresponding to the field. 
    1136    * 
    1137    * \param gc the garbage collector to use 
    1138    * \return the output pin corresponding to the field reference 
    1139    */ 
    1140   std::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc) 
    1141   TRY 
    1142   { 
    1143     if (instantDataFilter || field_ref.isEmpty()) 
    1144       ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)", 
    1145             "Impossible to get the field reference for a field which has already been parsed or which does not have a field_ref."); 
    1146  
    1147     CField* fieldRef = CField::get(field_ref); 
    1148     fieldRef->buildFilterGraph(gc, false); 
    1149  
    1150     std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters; 
    1151     // Check if a spatial transformation is needed 
    1152     if (grid_ && grid_ != fieldRef->grid_ && grid_->hasTransform()) 
    1153     {        
    1154       bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    1155       double defaultValue  = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);                                 
    1156       filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid_, grid_, hasMissingValue, defaultValue); 
    1157     } 
    1158     else 
    1159       filters.first = filters.second = std::shared_ptr<CFilter>(new CPassThroughFilter(gc)); 
    1160  
    1161     fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 
    1162  
    1163     return filters.second; 
    1164   } 
    1165   CATCH_DUMP_ATTR 
    1166  
     836   
     837   
    1167838  /*! 
    1168839   * Returns the filter needed to handle a self reference in the field's expression. 
     
    14631134  CATCH_DUMP_ATTR 
    14641135 
    1465   void CField::solveTransformedGrid() 
    1466   TRY 
    1467   { 
    1468     if (grid_ && !grid_->isTransformed() && hasDirectFieldReference() && grid_ != getDirectFieldReference()->grid_) 
    1469     { 
    1470       std::vector<CGrid*> grids; 
    1471       // Source grid 
    1472       grids.push_back(getDirectFieldReference()->grid_); 
    1473       auto gridPath = getGridPath() ; 
    1474       grids.insert(grids.begin(), gridPath.begin(), gridPath.end()); 
    1475  
    1476       for (size_t i = 0, count = grids.size() - 1; i < count; ++i) 
    1477       { 
    1478         CGrid *gridSrc  = grids[i]; 
    1479         CGrid *gridDest = grids[i + 1]; 
    1480         if (!gridDest->isTransformed()) gridDest->transformGrid(gridSrc); 
    1481       } 
    1482     } 
    1483     else if (grid_ && grid_->hasTransform() && !grid_->isTransformed()) 
    1484     { 
    1485       // Temporarily deactivate the self-transformation of grid 
    1486       // grid_->transformGrid(grid_); 
    1487     } 
    1488   } 
    1489   CATCH_DUMP_ATTR 
    1490  
    1491   void CField::solveGenerateGrid() 
    1492   TRY 
    1493   { 
    1494     if (grid_ && !grid_->isTransformed() && hasDirectFieldReference() && grid_ != getDirectFieldReference()->grid_) 
    1495       grid_->completeGrid(getDirectFieldReference()->grid_); 
    1496     else grid_->completeGrid(); 
    1497   } 
    1498   CATCH_DUMP_ATTR 
    1499  
     1136   
    15001137  void CField::solveGridDomainAxisBaseRef() 
    15011138  TRY 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp

    r1984 r2002  
    129129         void solveServerOperation(void); 
    130130         void solveCheckMaskIndex(bool doSendingIndex); 
    131          void solveAllReferenceEnabledField(bool doSending2Server); 
    132          void solveOnlyReferenceEnabledField(void); 
    133          void generateNewTransformationGridDest(); 
    134131         void updateRef(CGrid* grid); 
    135          void buildGridTransformationGraph(); 
    136132         void solveGridDomainAxisRef(bool checkAtt); 
    137          void solveTransformedGrid(); 
    138          void solveGenerateGrid(); 
    139133         void solveGridDomainAxisBaseRef(); 
    140134 
    141          void solveAllEnabledFieldsAndTransform(); 
    142135         void checkGridOfEnabledFields(); 
    143136         void sendGridOfEnabledFields(); 
     
    158151         void checkTimeAttributes(CDuration* freqOp=NULL); 
    159152 
    160          void buildFilterGraph(CGarbageCollector& gc, bool enableOutput); 
    161  
    162153         bool buildWorkflowGraph(CGarbageCollector& gc) ; 
    163154         bool buildWorkflowGraphDone_ = false ; 
     
    166157          
    167158          
    168          std::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc); 
    169159         std::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc); 
    170160         std::shared_ptr<COutputPin> getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.cpp

    r1962 r2002  
    734734 
    735735        // Now complete domain and axis associated with this field 
    736         enabledFields[idx]->solveGenerateGrid(); 
     736        
     737       //ym => this a problem in wich order are done the grid generation. Probably metadata are read in file and after the grid is ditributed by the filter 
     738       // => must be checked in detail. But solveGenerated grid is not existing any more with new transformation framework 
     739       // enabledFields[idx]->solveGenerateGrid(); 
    737740 
    738741        // Read necessary value from file 
     
    818821 
    819822   //---------------------------------------------------------------- 
    820  
    821    /*! 
    822    \brief Resolve all reference of active fields. 
    823       In order to know exactly which data each active field has, a search for all its 
    824    reference to find its parents or/and its base reference object must be done. Moreover 
    825    during this search, there are some information that can only be sent to server AFTER 
    826    all information of active fields are created on server side, e.g: checking mask or index 
    827    \param [in] sendToServer: Send all info to server (true) or only a part of it (false) 
    828    */ 
    829    void CFile::solveOnlyRefOfEnabledFields(void) 
    830    TRY 
    831    { 
    832      int size = this->enabledFields.size(); 
    833      for (int i = 0; i < size; ++i) 
    834      { 
    835        this->enabledFields[i]->solveOnlyReferenceEnabledField(); 
    836      } 
    837    } 
    838    CATCH_DUMP_ATTR 
    839823 
    840824   void CFile::checkGridOfEnabledFields() 
     
    927911   CATCH_DUMP_ATTR 
    928912 
    929    void CFile::generateNewTransformationGridDest() 
    930    TRY 
    931    { 
    932      int size = this->enabledFields.size(); 
    933      for (int i = 0; i < size; ++i) 
    934      { 
    935        this->enabledFields[i]->generateNewTransformationGridDest(); 
    936      } 
    937    } 
    938    CATCH_DUMP_ATTR 
    939  
    940    /*! 
    941    \brief Resolve all reference of active fields. 
    942       In order to know exactly which data each active field has, a search for all its 
    943    reference to find its parents or/and its base reference object must be done. Moreover 
    944    during this search, there are some information that can only be sent to server AFTER 
    945    all information of active fields are created on server side, e.g: checking mask or index 
    946    \param [in] sendToServer: Send all info to server (true) or only a part of it (false) 
    947    */ 
    948    void CFile::solveAllRefOfEnabledFieldsAndTransform(void) 
    949    TRY 
    950    { 
    951      int size = this->enabledFields.size(); 
    952      for (int i = 0; i < size; ++i) 
    953      {        
    954       this->enabledFields[i]->solveAllEnabledFieldsAndTransform(); 
    955      } 
    956    } 
    957    CATCH_DUMP_ATTR 
    958  
    959    /*! 
    960     * Constructs the filter graph for each active field. 
    961     * 
    962     * \param gc the garbage collector to use when building the filter graph 
    963     */ 
    964    void CFile::buildFilterGraphOfEnabledFields(CGarbageCollector& gc) 
    965    TRY 
    966    { 
    967      int size = this->enabledFields.size(); 
    968      for (int i = 0; i < size; ++i) 
    969      { 
    970        this->enabledFields[i]->buildFilterGraph(gc, true); 
    971      } 
    972    } 
    973    CATCH_DUMP_ATTR 
    974913 
    975914   /*! 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.hpp

    r1961 r2002  
    109109         void solveFieldRefInheritance(bool apply); 
    110110         void processEnabledFile(void); 
    111          void solveOnlyRefOfEnabledFields(void); 
    112          void generateNewTransformationGridDest(); 
    113111          
    114          void buildFilterGraphOfEnabledFields(CGarbageCollector& gc); 
    115112         void postProcessFilterGraph(); 
    116113         void prefetchEnabledReadModeFields(); 
     
    118115         void doPostTimestepOperationsForEnabledReadModeFields(); 
    119116 
    120          void solveAllRefOfEnabledFieldsAndTransform(void); 
    121117         void checkGridOfEnabledFields(); 
    122118         void sendGridOfEnabledFields(); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp

    r1999 r2002  
    1717#include "distribution_client.hpp" 
    1818#include "grid_transformation.hpp" 
    19 #include "grid_generate.hpp" 
    2019#include "server.hpp" 
    2120#include "distribution_type.hpp" 
     
    4645      , transformations_(0), isTransformed_(false) 
    4746      , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 
    48       , gridSrc_(), hasTransform_(false), isGenerated_(false), order_() 
     47      , gridSrc_(), hasTransform_(false), order_() 
    4948      , clients() 
    5049   { 
     
    6564      , transformations_(0), isTransformed_(false) 
    6665      , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 
    67       , gridSrc_(), hasTransform_(false), isGenerated_(false), order_() 
     66      , gridSrc_(), hasTransform_(false), order_() 
    6867      , clients() 
    6968   { 
     
    838837     if (this->isChecked) return; 
    839838     this->checkElementsAttributes(); 
    840  
    841      if (!(this->hasTransform() && !this->isTransformed())) 
    842       this->isChecked = true; 
    843  
    844      if (!(this->hasTransform() && (!this->isGenerated()))) 
    845       this->isChecked = true; 
     839     this->isChecked = true; 
    846840   } 
    847841   CATCH_DUMP_ATTR 
     
    938932 
    939933   
    940    /*! 
    941      Compute the global index of grid to send to server as well as the connected server of the current client. 
    942      First of all, from the local data on each element of grid, we can calculate their local index which also allows us to know 
    943      their global index. We can have a map of global index of grid and local index that each client holds 
    944      Then, each client holds a piece of information about the distribution of servers, which permits to compute the connected server(s) 
    945      of the current client. 
    946    */ 
    947    // ym obsolete : to be removed.... 
    948    void CGrid::computeIndex(void) 
    949    TRY 
    950    { 
    951     // old interface 
    952      CContext* context = CContext::getCurrent(); 
    953      if (isScalarGrid()) 
    954      { 
    955        //computeClientIndexScalarGrid(); 
    956        if (context->getServiceType()==CServicesManager::CLIENT || context->getServiceType()==CServicesManager::GATHERER) 
    957        { 
    958          // ym computeConnectedClientsScalarGrid(); 
    959        } 
    960      } 
    961      else 
    962      { 
    963        //computeClientIndex(); 
    964        if (context->getServiceType()==CServicesManager::CLIENT || context->getServiceType()==CServicesManager::GATHERER) 
    965        { 
    966          //computeConnectedClients(); 
    967        } 
    968      } 
    969 //ym     if (CServer::serverLevel==2) 
    970      if (context->getServiceType()==CServicesManager::OUT_SERVER) 
    971      { 
    972        if (clientDistribution_!=0) clientDistribution_->partialClear() ; 
    973      } 
    974    } 
    975    CATCH_DUMP_ATTR 
    976  
    977     
    978  
    979934 
    980935   CGrid* CGrid::cloneGrid(const StdString& idNewGrid, CGrid* gridSrc) 
     
    17301685  CATCH_DUMP_ATTR 
    17311686 
    1732   bool CGrid::isTransformed() 
    1733   TRY 
    1734   { 
    1735     return isTransformed_; 
    1736   } 
    1737   CATCH_DUMP_ATTR 
    1738  
    1739   void CGrid::setTransformed() 
    1740   TRY 
    1741   { 
    1742     isTransformed_ = true; 
    1743   } 
    1744   CATCH_DUMP_ATTR 
    1745  
    1746   CGridTransformation* CGrid::getTransformations() 
    1747   TRY 
    1748   { 
    1749     return transformations_; 
    1750   } 
    1751   CATCH_DUMP_ATTR 
    1752  
    1753   void CGrid::addTransGridSource(CGrid* gridSrc) 
    1754   TRY 
    1755   { 
    1756     if (gridSrc_.end() == gridSrc_.find(gridSrc)) 
    1757       gridSrc_.insert(make_pair(gridSrc,make_pair(false,""))); 
    1758   } 
    1759   CATCH_DUMP_ATTR 
    1760  
    1761   std::map<CGrid*,std::pair<bool,StdString> >& CGrid::getTransGridSource() 
    1762   TRY 
    1763   { 
    1764     return gridSrc_; 
    1765   } 
    1766   CATCH_DUMP_ATTR 
    1767  
    1768   /*! 
    1769      Complete all the necessary (and lacking) attributes of a grid 
    1770      This function is similar to gridTransformation but works only (till now) on generate_rectilinear_domain transformation 
    1771   */ 
    1772   void CGrid::completeGrid(CGrid* transformGridSrc) 
    1773   TRY 
    1774   { 
    1775     if (nullptr != transformGridSrc) 
    1776     { 
    1777       if (axis_domain_order.numElements() != transformGridSrc->axis_domain_order.numElements()) 
    1778       { 
    1779         ERROR("CGrid::completeGrid(CGrid* transformGridSrc)", 
    1780              << "Two grids have different number of elements. " << std::endl 
    1781              << "Number of element of grid destination " << this->getId() << " is " << axis_domain_order.numElements() << std::endl 
    1782              << "Number of element of grid source " << transformGridSrc->getId() << " is " << transformGridSrc->axis_domain_order.numElements()); 
    1783       } 
    1784     } 
    1785  
    1786     if (isGenerated()) return; 
    1787     setGenerated(); 
    1788  
    1789     CGridGenerate gridGenerate(this, transformGridSrc); 
    1790     gridGenerate.completeGrid(); 
    1791   } 
    1792   CATCH_DUMP_ATTR 
    1793  
    1794   bool CGrid::isGenerated() 
    1795   TRY 
    1796   { 
    1797     return isGenerated_; 
    1798   } 
    1799   CATCH 
    1800  
    1801   void CGrid::setGenerated() 
    1802   TRY 
    1803   { 
    1804     isGenerated_ = true; 
    1805   } 
    1806   CATCH_DUMP_ATTR 
    1807  
    1808   void CGrid::transformGrid(CGrid* transformGridSrc) 
    1809   TRY 
    1810   { 
    1811     if (!transformGridSrc) 
    1812       ERROR("CGrid::transformGrid(CGrid* transformGridSrc)", 
    1813             << "Impossible to transform grid '" << getId() << "', the source grid is null."); 
    1814  
    1815     if (isTransformed()) return; 
    1816     setTransformed(); 
    1817     if (axis_domain_order.numElements() != transformGridSrc->axis_domain_order.numElements()) 
    1818     { 
    1819       ERROR("CGrid::transformGrid(CGrid* transformGridSrc)", 
    1820            << "Two grids have different number of elements. " << std::endl 
    1821            << "Number of element of grid destination " << this->getId() << " is " << axis_domain_order.numElements() << std::endl 
    1822            << "Number of element of grid source " << transformGridSrc->getId() << " is " << transformGridSrc->axis_domain_order.numElements()); 
    1823     } 
    1824     else 
    1825     { 
    1826     } 
    1827  
    1828     transformations_ = new CGridTransformation(this, transformGridSrc); 
    1829     transformations_->computeAll(); 
    1830     if (0 < transformations_->getNbAlgo()) hasTransform_ = true; 
    1831  
    1832  } 
    1833   CATCH_DUMP_ATTR 
    1834  
    1835  
    1836  
    1837  
    1838   void CGrid::prepareTransformGrid(CGrid* transformGridSrc) 
    1839   TRY 
    1840   { 
    1841     if (prepareTransformGrid_done_) return ; 
    1842  
    1843     if (!transformGridSrc) 
    1844       ERROR("CGrid::transformGrid(CGrid* transformGridSrc)", 
    1845             << "Impossible to transform grid '" << getId() << "', the source grid is null."); 
    1846  
    1847     if (isTransformed()) return; 
    1848     setTransformed(); 
    1849     if (axis_domain_order.numElements() != transformGridSrc->axis_domain_order.numElements()) 
    1850     { 
    1851       ERROR("CGrid::transformGrid(CGrid* transformGridSrc)", 
    1852            << "Two grids have different number of elements. " << std::endl 
    1853            << "Number of element of grid destination " << this->getId() << " is " << axis_domain_order.numElements() << std::endl 
    1854            << "Number of element of grid source " << transformGridSrc->getId() << " is " << transformGridSrc->axis_domain_order.numElements()); 
    1855     } 
    1856     else 
    1857     { 
    1858     } 
    1859  
    1860     transformations_ = new CGridTransformation(this, transformGridSrc); 
    1861     if (0 < transformations_->getNbAlgo()) hasTransform_ = true; 
    1862  
    1863     prepareTransformGrid_done_ = true;  
    1864   } 
    1865   CATCH_DUMP_ATTR 
    1866  
    1867  
    1868   void CGrid::makeTransformGrid(void) 
    1869   TRY 
    1870   { 
    1871     if (makeTransformGrid_done_) return ; 
    1872     transformations_->computeAll(); 
    1873  
    1874     makeTransformGrid_done_ = true ;  
    1875   } 
    1876   CATCH_DUMP_ATTR 
    1877  
     1687   
    18781688 
    18791689  vector<std::string> CGrid::getAuxInputTransformGrid(void) 
     
    18811691  { 
    18821692    if (transformations_ != nullptr) return transformations_->getAuxInputs() ; 
    1883   } 
    1884   CATCH_DUMP_ATTR 
    1885  
    1886  
    1887   bool CGrid::hasTransform() 
    1888   TRY 
    1889   { 
    1890     if (hasTransform_) return hasTransform_; 
    1891  
    1892     std::vector<CDomain*> domList = getDomains(); 
    1893     std::vector<CAxis*> axisList = getAxis(); 
    1894     std::vector<CScalar*> scalarList = getScalars(); 
    1895  
    1896     for (int idx = 0; idx < domList.size(); ++idx) hasTransform_ |= domList[idx]->hasTransformation(); 
    1897     for (int idx = 0; idx < axisList.size(); ++idx) hasTransform_ |= axisList[idx]->hasTransformation(); 
    1898     for (int idx = 0; idx < scalarList.size(); ++idx) hasTransform_ |= scalarList[idx]->hasTransformation(); 
    1899  
    1900     return hasTransform_; 
    19011693  } 
    19021694  CATCH_DUMP_ATTR 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp

    r1999 r2002  
    149149 
    150150      public:             
    151          void computeIndex(void); 
    152          void computeIndexScalarGrid(); 
    153151         void solveDomainAxisRef(bool areAttributesChecked); 
    154152         void checkElementsAttributes(void) ; 
     
    219217         CGridTransformation* getTransformations(); 
    220218 
    221          void transformGrid(CGrid* transformGridSrc); 
    222           
    223          void prepareTransformGrid(CGrid* transformGridSrc); 
    224          bool prepareTransformGrid_done_ = false ; 
    225  
    226          void makeTransformGrid(void);  
    227          bool makeTransformGrid_done_ = false ; 
    228           
    229219         std::vector<std::string> getAuxInputTransformGrid(void) ;  
    230          std::map<CGrid*, std::pair<bool,StdString> >& getTransGridSource(); 
    231          bool hasTransform(); 
    232          void addTransGridSource(CGrid* gridSrc); 
    233          void completeGrid(CGrid* transformGridSrc = 0); 
    234          bool isTransformed(); 
    235          void setTransformed(); 
    236          bool isGenerated(); 
    237          void setGenerated(); 
    238220         void setTransformationAlgorithms(); 
    239221         pair<shared_ptr<CFilter>, shared_ptr<CFilter> > buildTransformationGraph(CGarbageCollector& gc, bool isSource, CGrid* gridSrc, double detectMissingValues, 
     
    245227        CGridAlgorithm* getGridAlgorithm(void) { return gridAlgorithm_ ;} 
    246228      private: 
    247          bool isTransformed_, isGenerated_; 
     229         bool isTransformed_; 
    248230         CGridTransformation* transformations_; 
    249231         bool hasTransform_; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algo_types.hpp

    r1988 r2002  
    11/*! 
    2    \file grid_generate.hpp 
     2   \file algo_type.hpp 
    33   \author Ha NGUYEN 
    44   \since 28 Aug 2015 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_interpolate.cpp

    r1998 r2002  
    4848TRY 
    4949{ 
     50  cout<<"REGISTRED"<<endl ; 
    5051  return CGridTransformationFactory<CDomain>::registerTransformation(TRANS_INTERPOLATE_DOMAIN, create); 
    5152} 
     
    116117 
    117118  CContext* context = CContext::getCurrent(); 
    118   int clientRank = context->intraCommRank_; 
     119  int clientRank = context->intraCommRank_;  
    119120  int i, j, k, idx; 
    120121  std::vector<double> srcPole(3,0), dstPole(3,0); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_interpolate.hpp

    r1998 r2002  
    9595                                                std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    9696                                                std::map<int, int>& elementPositionInGridDst2DomainPosition); 
     97   
     98  CDomain* domainSrc_ ; 
     99  CDomain* domainDest_ ; 
     100 
     101public: 
    97102  static bool dummyRegistered_; 
    98103 
    99   CDomain* domainSrc_ ; 
    100   CDomain* domainDest_ ; 
    101104 
    102105}; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/transformation_path.hpp

    r1984 r2002  
    1515    private: 
    1616      TPath path_ ; 
    17       std::list<TPath> fullPath_ ;  
    1817      std::list<TPath> donePath_ ;  
    1918      TPath remainPath_ ;  
Note: See TracChangeset for help on using the changeset viewer.