Changeset 2027 for XIOS


Ignore:
Timestamp:
02/01/21 12:42:26 (3 years ago)
Author:
yushan
Message:

Graph intermediate commit to a tmp branch. Integrate latest modifications of branch coupling

Location:
XIOS/dev/dev_trunk_graph/src
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_graph/src/context_server.cpp

    r2019 r2027  
    5252    CXios::getContextsManager()->getContextInfo(context->getId(), contextInfo, intraComm) ; 
    5353 
    54     if (contextInfo.serviceType != CServicesManager::CLIENT) // we must have an event scheduler => to be retrieve from the associated services 
    55     { 
     54    //if (contextInfo.serviceType != CServicesManager::CLIENT) // we must have an event scheduler => to be retrieve from the associated services 
     55    //{ 
    5656      if (!isAttachedModeEnabled()) eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ; 
    57     } 
     57    //} 
    5858 
    5959 
     
    323323        else if (!eventScheduler_ || eventScheduler_->queryEvent(currentTimeLine,hashId) ) 
    324324        { 
     325          MPI_Barrier(intraComm) ; 
    325326         // When using attached mode, synchronise the processes to avoid that differents event be scheduled by differents processes 
    326327         // The best way to properly solve this problem will be to use the event scheduler also in attached mode 
     
    332333         isProcessingEvent_=true ; 
    333334         CTimer::get("Process events").resume(); 
     335         info(100)<<"Received Event "<<currentTimeLine<<" of class "<<event->classId<<" of type "<<event->type<<endl ; 
    334336         dispatchEvent(*event); 
    335337         CTimer::get("Process events").suspend(); 
  • XIOS/dev/dev_trunk_graph/src/event_scheduler.cpp

    r2019 r2027  
    7676  { 
    7777    registerEvent(timeLine, contextHashId, level) ; 
     78    checkEvent() ; 
    7879  } 
    7980   
     
    9495  bool CEventScheduler::queryEvent(const size_t timeLine, const size_t contextHashId) 
    9596  { 
    96  
     97    checkEvent() ; 
    9798    if (! eventStack.empty() && eventStack.front().first==timeLine && eventStack.front().second==contextHashId) 
    9899    { 
  • XIOS/dev/dev_trunk_graph/src/filter/client_from_client_source_filter.cpp

    r2019 r2027  
    3535    CDataPacketPtr packet(new CDataPacket); 
    3636    packet->date = date; 
     37    packet->status = CDataPacket::NO_ERROR; 
     38    for (auto& subEvent : event.subEvents) (*subEvent.buffer) >> packet->timestamp  ; // better management of time lien later... 
    3739    packet->timestamp = date; 
    38     packet->status = CDataPacket::NO_ERROR; 
    3940 
    4041    grid_->getClientFromClientConnector()->transfer(event,packet->data) ; 
  • XIOS/dev/dev_trunk_graph/src/filter/client_to_server_store_filter.cpp

    r2021 r2027  
    1616  { 
    1717    if (!field) 
    18       ERROR("CFileWriterFilter::CFileWriterFilter(CField* field)", 
     18      ERROR("CClientToServerStoreFilter::CClientToServerStoreFilter(CGarbageCollector& gc, CField* field, CContextClient* client)", 
    1919            "The field cannot be null."); 
    2020  } 
     
    4545      CWorkflowGraph::addEdge(data[0]->graphPackage->fromFilter, this->graphPackage->filterId, data[0]); 
    4646      // flux can be redirected to other filters. So don't change the 'from' parameter 
    47       //data[0]->graphPackage->fromFilter = this->graphPackage->filterId; 
    4847      data[0]->graphPackage->currentField = this->graphPackage->inFields[0]; 
    4948    } 
  • XIOS/dev/dev_trunk_graph/src/node/axis.cpp

    r2019 r2027  
    451451 
    452452    } 
     453   
     454  string CAxis::getCouplingAlias(const string& fieldId, int posInGrid) 
     455  { 
     456    return "_axis["+std::to_string(posInGrid)+"]_of_"+fieldId ; 
     457  } 
    453458 
    454459  void CAxis::makeAliasForCoupling(const string& fieldId, int posInGrid) 
    455460  { 
    456     const string axisId = "_axis["+std::to_string(posInGrid)+"]_of_"+fieldId ; 
     461    const string axisId = getCouplingAlias(fieldId,posInGrid) ; 
    457462    this->createAlias(axisId) ; 
    458463  } 
  • XIOS/dev/dev_trunk_graph/src/node/axis.hpp

    r2019 r2027  
    175175      public: 
    176176         void makeAliasForCoupling(const string& fieldId, int posInGrid) ; 
     177         string getCouplingAlias(const string& fieldId, int posInGrid) ; 
    177178 
    178179 
  • XIOS/dev/dev_trunk_graph/src/node/context.cpp

    r2019 r2027  
    2626#include "coupler_in.hpp" 
    2727#include "coupler_out.hpp" 
    28  
    29 namespace xios { 
     28#include "servers_ressource.hpp" 
     29#include "pool_ressource.hpp" 
     30#include "services.hpp" 
     31#include "contexts_manager.hpp" 
     32#include <chrono> 
     33#include <random> 
     34 
     35namespace xios 
     36{ 
    3037 
    3138  std::shared_ptr<CContextGroup> CContext::root; 
     
    6673 
    6774   //---------------------------------------------------------------- 
    68  
     75   void CContext::initEventScheduler(void) 
     76   { 
     77     SRegisterContextInfo contextInfo ; 
     78     CXios::getContextsManager()->getContextInfo(this->getId(), contextInfo, getIntraComm()) ; 
     79 
     80     eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ; 
     81  
     82     // generate unique hash for server 
     83     auto time=chrono::system_clock::now().time_since_epoch().count() ; 
     84     std::default_random_engine rd(time); // not reproducible from a run to another 
     85     std::uniform_int_distribution<size_t> dist; 
     86     hashId_=dist(rd) ; 
     87     MPI_Bcast(&hashId_,1,MPI_SIZE_T,0,getIntraComm()) ; // Bcast to all server of the context 
     88   } 
     89  
    6990   /*! 
    7091   \brief Get context group (context root) 
     
    497518     else 
    498519       initServer(intraComm, serviceType) ; 
     520     initEventScheduler() ; 
    499521    } 
    500522    CATCH_DUMP_ATTR 
     
    695717 
    696718    
    697  
    698719  bool CContext::eventLoop(bool enableEventsProcessing) 
    699720  { 
    700721    bool finished=true;  
    701  
    702     if (client!=nullptr && !finalized) client->checkBuffers(); 
     722    bool out;  
     723    size_t timeLine=timeLine_ ; 
     724    if (serviceType_==CServicesManager::CLIENT) 
     725    { 
     726      timeLine_++ ; 
     727      eventScheduler_->registerEvent(timeLine, hashId_) ; 
     728    } 
     729 
     730    do 
     731    {  
     732      if (client!=nullptr && !finalized) client->checkBuffers(); 
    703733     
    704     for (int i = 0; i < clientPrimServer.size(); ++i) 
    705     { 
    706       if (!finalized) clientPrimServer[i]->checkBuffers(); 
    707       if (!finalized) finished &= serverPrimServer[i]->eventLoop(enableEventsProcessing); 
    708     } 
    709  
    710     for (auto couplerOut : couplerOutClient_) 
    711       if (!finalized) couplerOut.second->checkBuffers(); 
     734      for (int i = 0; i < clientPrimServer.size(); ++i) 
     735      { 
     736        if (!finalized) clientPrimServer[i]->checkBuffers(); 
     737        if (!finalized) finished &= serverPrimServer[i]->eventLoop(enableEventsProcessing); 
     738      } 
     739 
     740      for (auto couplerOut : couplerOutClient_) 
     741        if (!finalized) couplerOut.second->checkBuffers(); 
    712742     
    713     for (auto couplerIn : couplerInClient_) 
    714       if (!finalized) couplerIn.second->checkBuffers(); 
     743      for (auto couplerIn : couplerInClient_) 
     744        if (!finalized) couplerIn.second->checkBuffers(); 
    715745     
    716     for (auto couplerOut : couplerOutServer_) 
    717       if (!finalized) couplerOut.second->eventLoop(enableEventsProcessing); 
    718  
    719     for (auto couplerIn : couplerInServer_) 
    720       if (!finalized) couplerIn.second->eventLoop(enableEventsProcessing); 
     746      for (auto couplerOut : couplerOutServer_) 
     747        if (!finalized) couplerOut.second->eventLoop(enableEventsProcessing); 
     748 
     749      for (auto couplerIn : couplerInServer_) 
     750        if (!finalized) couplerIn.second->eventLoop(enableEventsProcessing); 
    721751     
    722     if (server!=nullptr) if (!finalized) finished &= server->eventLoop(enableEventsProcessing); 
     752      if (server!=nullptr) if (!finalized) finished &= server->eventLoop(enableEventsProcessing); 
    723753   
     754      if (serviceType_==CServicesManager::CLIENT) out = eventScheduler_->queryEvent(timeLine,hashId_) ; 
     755      else out=true ; 
     756    }  while(!out) ; 
    724757    return finalized && finished ; 
    725758  } 
     
    10241057          couplersReady &= ready ; 
    10251058        } 
    1026         if (!couplersReady) this->eventLoop() ; 
     1059        this->eventLoop() ; 
    10271060      } while (!couplersReady) ; 
    10281061 
  • XIOS/dev/dev_trunk_graph/src/node/context.hpp

    r2019 r2027  
    1414#include "services_manager.hpp" 
    1515#include "server_context.hpp" 
    16  
    17  
    18 namespace xios { 
     16#include "event_scheduler.hpp" 
     17 
     18namespace xios 
     19{ 
    1920   class CContextClient; 
    2021   class CContextServer; 
     
    339340         
    340341      private: 
     342         CEventScheduler* eventScheduler_ ; //! The local event scheduler for context 
     343         size_t hashId_ ; //! the local hashId for scheduler 
     344         size_t timeLine_=0 ; 
     345         void initEventScheduler(void) ; 
     346 
    341347         bool isPostProcessed; 
    342348         bool allProcessed; 
  • XIOS/dev/dev_trunk_graph/src/node/domain.cpp

    r2019 r2027  
    17801780   } 
    17811781 
    1782  
     1782  string CDomain::getCouplingAlias(const string& fieldId, int posInGrid) 
     1783  { 
     1784    return "_domain["+std::to_string(posInGrid)+"]_of_"+fieldId ; 
     1785  } 
    17831786    
    17841787  /* to be removed later when coupling will be reimplemented, just to  not forget */ 
     
    17881791    else sendDomainToFileServer_done_.insert(client) ; 
    17891792     
    1790     const string domainId = "_domain["+std::to_string(posInGrid)+"]_of_"+fieldId ; 
     1793    const string domainId = getCouplingAlias(fieldId, posInGrid) ; 
    17911794     
    17921795    if (!domain_ref.isEmpty()) 
     
    18051808  void CDomain::makeAliasForCoupling(const string& fieldId, int posInGrid) 
    18061809  { 
    1807     const string domainId = "_domain["+std::to_string(posInGrid)+"]_of_"+fieldId ; 
     1810     const string domainId = getCouplingAlias(fieldId, posInGrid); 
    18081811    this->createAlias(domainId) ; 
    18091812  } 
  • XIOS/dev/dev_trunk_graph/src/node/domain.hpp

    r2019 r2027  
    240240       public: 
    241241        void makeAliasForCoupling(const string& fieldId, int posInGrid) ; 
     242        string getCouplingAlias(const string& fieldId, int posInGrid) ; 
    242243 
    243244       private: 
  • XIOS/dev/dev_trunk_graph/src/node/field.cpp

    r2026 r2027  
    13081308    if (sendFieldToCouplerOut_done_) return ; 
    13091309    else sendFieldToCouplerOut_done_=true ; 
    1310     grid_->sendGridToCouplerOut(client, this->getId()); 
     1310    sentGrid_ = grid_-> duplicateSentGrid() ; 
     1311    sentGrid_->sendGridToCouplerOut(client, this->getId()); 
    13111312    this->sendGridCompleted(); 
    13121313 
     
    13551356 
    13561357 
     1358   bool CField::isGridCompleted(void) 
     1359   TRY 
     1360   {  
     1361     bool isFullCompleted ; 
     1362     MPI_Allreduce(&isGridCompleted_,&isFullCompleted,1,MPI_C_BOOL, MPI_LAND, CContext::getCurrent()->getIntraComm() ) ; 
     1363     if ( (isGridCompleted_==false && isFullCompleted==true) ) ERROR("bool CField::isGridCompleted(void)",<< "incoherecy in MPI_AllReduce") ; 
     1364     return isFullCompleted ;  
     1365   } 
     1366   CATCH_DUMP_ATTR 
     1367 
     1368 
    13571369  void CField::sendAddAllVariables(CContextClient* client) 
    13581370  TRY 
  • XIOS/dev/dev_trunk_graph/src/node/field.hpp

    r2019 r2027  
    236236          bool isGridCompleted_ = true ; 
    237237      public: 
    238           bool isGridCompleted() { return isGridCompleted_ ;}  
     238          bool isGridCompleted() { }  
    239239          void setGridCompleted(void) { isGridCompleted_= true; } 
    240240          void unsetGridCompleted(void) { isGridCompleted_ = false ;} 
  • XIOS/dev/dev_trunk_graph/src/node/grid.cpp

    r2026 r2027  
    12071207    gridPtr->sendCreateChild(this->getId(),client); 
    12081208    this->sendAllAttributesToServer(client); 
    1209     distributeGridToFileServer(client) ; 
    1210   } 
    1211  
    1212  
    1213   void CGrid::distributeGridToFileServer(CContextClient* client) 
     1209    distributeGridToServer(client) ; 
     1210  } 
     1211 
     1212  void CGrid::sendGridToCouplerOut(CContextClient* client, const string& fieldId) 
     1213  { 
     1214    if (sendGridToCouplerOut_done_.count(client)!=0) return ; 
     1215    else sendGridToCouplerOut_done_.insert(client) ; 
     1216    this->sendAllAttributesToServer(client, getCouplingAlias(fieldId)); 
     1217    distributeGridToServer(client,fieldId) ; 
     1218  } 
     1219 
     1220  void CGrid::distributeGridToServer(CContextClient* client, const string& fieldId) 
    12141221  { 
    12151222    CContext* context = CContext::getCurrent(); 
     1223    bool isCoupling = !fieldId.empty() ; 
    12161224    // simple Distribution for now  
    12171225    // distribute over the fisrt element except if it is a scalar 
     
    12611269      if (elements[i].type==TYPE_DOMAIN)  
    12621270      {  
    1263          CDomain* domain = (CDomain*) elements[i].ptr ; 
    1264          sendAddDomain(domain->getId(),client) ; 
    1265          domain->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 
    1266          scattererConnectors.push_back(scattererConnector) ; 
     1271        CDomain* domain = (CDomain*) elements[i].ptr ; 
     1272        if (isCoupling) domain->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector,  domain->getCouplingAlias(fieldId,i)) ; 
     1273        else  
     1274        { 
     1275          sendAddDomain(domain->getId(),client) ; 
     1276          domain->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 
     1277        } 
     1278        scattererConnectors.push_back(scattererConnector) ; 
    12671279      } 
    12681280      else if (elements[i].type==TYPE_AXIS) 
    12691281      { 
    12701282        CAxis* axis = (CAxis*) elements[i].ptr ; 
    1271         sendAddAxis(axis->getId(),client) ; 
    1272         axis->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 
     1283        if (isCoupling) axis->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector,  axis->getCouplingAlias(fieldId,i)) ; 
     1284        else  
     1285        { 
     1286          sendAddAxis(axis->getId(),client) ; 
     1287          axis->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 
     1288        } 
    12731289        scattererConnectors.push_back(scattererConnector) ; 
    12741290      } 
     
    12761292      { 
    12771293        CScalar* scalar = (CScalar*) elements[i].ptr ; 
    1278         sendAddScalar(scalar->getId(),client) ; 
    1279         scalar->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 
     1294        if (isCoupling) scalar->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector,  scalar->getCouplingAlias(fieldId,i)) ; 
     1295        else  
     1296        { 
     1297          sendAddScalar(scalar->getId(),client) ; 
     1298          scalar->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 
     1299        } 
    12801300        scattererConnectors.push_back(scattererConnector) ; 
    12811301      } 
     
    12911311    CEventClient event(getType(), EVENT_ID_SEND_MASK); 
    12921312    CMessage message ; 
    1293     message<<getId() ;  
     1313    if (isCoupling) message<<getCouplingAlias(fieldId) ; 
     1314    else message<<getId() ; 
    12941315    gridScattererConnector.transfer(maskOut, client, event, message) ; 
    12951316    for(auto& it : scattererConnectors) delete it ; 
     
    13741395 
    13751396 
    1376   void CGrid::sendGridToCouplerOut(CContextClient* client, const string& fieldId) 
    1377   { 
    1378 /*    if (sendGridToCouplerOut_done_.count(client)!=0) return ; 
    1379     else sendGridToCouplerOut_done_.insert(client) ; 
    1380   
    1381     CContext* context = CContext::getCurrent(); 
    1382     // simple Distribution for now  
    1383     // distribute over the fisrt element except if it is a scalar 
     1397  string CGrid::getCouplingAlias(const string& fieldId) 
     1398  { 
     1399    return "_grid_of_"+fieldId; 
     1400  } 
     1401 
     1402 
     1403  void CGrid::makeAliasForCoupling(const string& fieldId) 
     1404  { 
     1405    string gridId=getCouplingAlias(fieldId) ; 
     1406    createAlias(gridId) ; 
     1407 
    13841408    auto& elements = getElements() ; 
    1385     int posDistributed = 0 ; 
    1386     for(auto& element : elements) 
    1387     { 
    1388       if (element.type==TYPE_DOMAIN) break ; 
    1389       else if (element.type==TYPE_AXIS) break ; 
    1390       else if (element.type==TYPE_SCALAR) posDistributed++ ; 
    1391     } 
    1392      
    1393     vector<CLocalView*> localViews ; 
    1394     vector<CDistributedView*> remoteViews ; 
    1395  
    13961409    for(int i=0 ; i<elements.size() ; i++) 
    13971410    { 
    1398       if (elements[i].type==TYPE_DOMAIN)  
    1399       {  
    1400          CDomain* domain = (CDomain*) elements[i].ptr ; 
    1401          domain->computeRemoteElement(client, posDistributed==i ? EDistributionType::BANDS : EDistributionType::NONE) ; 
    1402          remoteViews.push_back(domain->getRemoteElement(client)->getView(CElementView::FULL)) ; 
    1403          localViews.push_back(domain->getLocalView(CElementView::FULL)) ; 
    1404       } 
    1405       else if (elements[i].type==TYPE_AXIS) 
    1406       { 
    1407         CAxis* axis = (CAxis*) elements[i].ptr ; 
    1408         axis->computeRemoteElement(client, posDistributed==i ? EDistributionType::BANDS : EDistributionType::NONE) ; 
    1409         remoteViews.push_back(axis->getRemoteElement(client)->getView(CElementView::FULL)) ; 
    1410         localViews.push_back(axis->getLocalView(CElementView::FULL)) ; 
    1411       } 
    1412       else if (elements[i].type==TYPE_SCALAR) 
    1413       { 
    1414         CScalar* scalar = (CScalar*) elements[i].ptr ; 
    1415         scalar->computeRemoteElement(client, posDistributed==i ? EDistributionType::BANDS : EDistributionType::NONE) ; 
    1416         remoteViews.push_back(scalar->getRemoteElement(client)->getView(CElementView::FULL)) ; 
    1417         localViews.push_back(scalar->getLocalView(CElementView::FULL)) ; 
    1418       } 
    1419     } 
    1420     CGridRemoteConnector gridRemoteConnector(localViews, remoteViews, context->getIntraComm(), client->getRemoteSize()) ; 
    1421     gridRemoteConnector.computeConnector() ; 
    1422      
    1423     vector<CScattererConnector*> clientToClientConnectors ; 
    1424     for(int i=0 ; i<elements.size() ; i++) 
    1425     { 
    1426       if (elements[i].type==TYPE_DOMAIN)  
    1427       {  
    1428          CDomain* domain = (CDomain*) elements[i].ptr ; 
    1429          sendAddDomain(domain->getId(),client) ; 
    1430          domain->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i)) ; 
    1431          clientToClientConnectors.push_back(domain->getClientToServerConnector(client)) ; 
    1432       } 
    1433       else if (elements[i].type==TYPE_AXIS) 
    1434       { 
    1435         CAxis* axis = (CAxis*) elements[i].ptr ; 
    1436         sendAddAxis(axis->getId(),client) ; 
    1437         axis->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i)) ; 
    1438         clientToClientConnectors.push_back(axis->getClientToServerConnector(client)) ; 
    1439       } 
    1440       else if (elements[i].type==TYPE_SCALAR) 
    1441       { 
    1442         CScalar* scalar = (CScalar*) elements[i].ptr ; 
    1443         sendAddScalar(scalar->getId(),client) ; 
    1444         scalar->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i)) ; 
    1445         clientToClientConnectors.push_back(scalar->getClientToServerConnector(client)) ; 
    1446       } 
    1447     } 
    1448      
    1449     // compute the grid clientToServerConnector to send flux from client to servers 
    1450     clientToClientConnector_[client] = new CGridScattererConnector(clientToClientConnectors) ;*/ 
    1451   } 
    1452  
    1453   void CGrid::makeAliasForCoupling(const string& fieldId) 
    1454   { 
    1455     string gridId="_grid_of_"+fieldId ; 
    1456     createAlias(gridId) ; 
    1457      
    1458     const auto& domVect = getDomains() ; 
    1459     for (int pos=0; pos<domVect.size();pos++) domVect[pos]->makeAliasForCoupling(fieldId, pos); 
    1460  
    1461     const auto& axisVect=getAxis() ; 
    1462     for (int pos=0; pos<axisVect.size();pos++) axisVect[pos]->makeAliasForCoupling(fieldId, pos); 
    1463  
    1464     const auto& scalVect=getScalars() ; 
    1465     for (int pos=0; pos<scalVect.size();pos++) scalVect[pos]->makeAliasForCoupling(fieldId, pos); 
     1411      if (elements[i].type==TYPE_DOMAIN) elements[i].domain->makeAliasForCoupling(fieldId, i); 
     1412      else if (elements[i].type==TYPE_AXIS) elements[i].axis->makeAliasForCoupling(fieldId, i); 
     1413      else if (elements[i].type==TYPE_SCALAR) elements[i].scalar->makeAliasForCoupling(fieldId, i); 
     1414    } 
    14661415  } 
    14671416 
  • XIOS/dev/dev_trunk_graph/src/node/grid.hpp

    r2026 r2027  
    174174      public: 
    175175         void makeAliasForCoupling(const string& fieldId) ; 
     176         string getCouplingAlias(const string& fieldId) ; 
    176177 
    177178      public: 
     
    341342 
    342343      public: //?  
    343         void distributeGridToFileServer(CContextClient* client); 
     344        void distributeGridToServer(CContextClient* client, const string& fieldId=""); 
    344345       
    345346             
  • XIOS/dev/dev_trunk_graph/src/node/scalar.cpp

    r2019 r2027  
    197197    else sendScalarToCouplerOut_done_.insert(client) ; 
    198198 
    199     string scalarId="_scalar["+std::to_string(posInGrid)+"]_of_"+fieldId ; 
     199    string scalarId = getCouplingAlias(fieldId, posInGrid) ; 
    200200 
    201201    this->sendAllAttributesToServer(client, scalarId); 
    202202  }   
     203   
     204  string CScalar::getCouplingAlias(const string& fieldId, int posInGrid) 
     205  { 
     206    return "_scalar["+std::to_string(posInGrid)+"]_of_"+fieldId ; 
     207  } 
    203208 
    204209  void CScalar::makeAliasForCoupling(const string& fieldId, int posInGrid) 
    205210  { 
    206     const string scalarId = "_scalar["+std::to_string(posInGrid)+"]_of_"+fieldId ; 
     211    const string scalarId = getCouplingAlias(fieldId, posInGrid) ; 
    207212    this->createAlias(scalarId) ; 
    208213  } 
  • XIOS/dev/dev_trunk_graph/src/node/scalar.hpp

    r2019 r2027  
    9494    public: 
    9595      void makeAliasForCoupling(const string& fieldId, int posInGrid) ; 
     96      string getCouplingAlias(const string& fieldId, int posInGrid) ; 
    9697 
    9798      //////////////////////////////// 
  • XIOS/dev/dev_trunk_graph/src/test/generic_testcase.f90

    r2019 r2027  
    368368    pressure=1e20 
    369369    DO j=0,z-1 
    370       pressure(:,j)=axis_value(j) ; 
     370      pressure(:,j)=axis_value(j)*100000 ; ! Pa  
    371371      DO i=0,xy-1 
    372372        IF (domain_index(i)/=-1) THEN 
     
    576576    ENDDO 
    577577          
    578     pressure=1e20 
     578    other_pressure=1e20 
    579579    DO j=0,z-1 
    580       pressure(:,j)=axis_value(j) ; 
     580      other_pressure(:,j)=axis_value(j)*100000 ; ! Pa 
    581581      DO i=0,xy-1 
    582582        IF (domain_index(i)/=-1) THEN 
  • XIOS/dev/dev_trunk_graph/src/transformation/algo_types.hpp

    r2019 r2027  
    2222#include "axis_algorithm_reduce_domain.hpp" 
    2323#include "axis_algorithm_reduce_axis.hpp" 
    24 //#include "axis_algorithm_transformation.hpp" 
    2524#include "axis_algorithm_extract_domain.hpp" 
    2625#include "axis_algorithm_temporal_splitting.hpp" 
  • XIOS/dev/dev_trunk_graph/src/transformation/generic_algorithm_transformation.hpp

    r2023 r2027  
    4141    virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, const vector<CArray<double,1>>& auxData, CArray<double,1>& dataOut) { abort() ;} //=0 
    4242    virtual bool isGenerateTransformation(void) { return false ;} 
    43      
    4443    virtual StdString getAlgoName() { return "\\nGeneric algorithm transformation";} 
    4544 
Note: See TracChangeset for help on using the changeset viewer.