Ignore:
Timestamp:
05/16/17 17:54:30 (7 years ago)
Author:
yushan
Message:

branch merged with trunk r1130

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan_merged/src/node/context.cpp

    r1091 r1134  
    1818namespace xios { 
    1919 
    20   shared_ptr<CContextGroup> CContext::root; 
     20  //shared_ptr<CContextGroup> CContext::root; 
     21  shared_ptr<CContextGroup> * CContext::root_ptr = 0; 
    2122 
    2223   /// ////////////////////// Définitions ////////////////////// /// 
     
    5455   CContextGroup* CContext::getRoot(void) 
    5556   { 
    56       if (root.get()==NULL) root=shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
    57       return root.get(); 
     57      //if (root.get()==NULL) root=shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
     58      //return root.get(); 
     59 
     60      //static shared_ptr<CContextGroup> *root_ptr; 
     61      if(root_ptr == 0) //root_ptr = new shared_ptr<CContextGroup>; 
     62      // if (root_ptr->get()==NULL)  
     63      root_ptr = new shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
     64      return root_ptr->get(); 
    5865   } 
    5966 
     
    236243 
    237244   //! Initialize client side 
    238    void CContext::initClient(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtServer /*= 0*/) 
     245   void CContext::initClient(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtServer /*= 0*/) 
    239246   { 
    240247     hasClient=true; 
    241      client = new CContextClient(this,intraComm, interComm, cxtServer); 
     248     client = new CContextClient(this, intraComm, interComm, cxtServer); 
     249 
     250     int tmp_rank; 
     251     MPI_Comm_rank(intraComm, &tmp_rank); 
     252     MPI_Barrier(intraComm); 
     253      
     254 
    242255     registryIn=new CRegistry(intraComm); 
    243256     registryIn->setPath(getId()) ; 
     
    248261     registryOut->setPath(getId()) ; 
    249262 
    250      MPI_Comm intraCommServer, interCommServer; 
     263     ep_lib::MPI_Comm intraCommServer, interCommServer; 
    251264     if (cxtServer) // Attached mode 
    252265     { 
     
    311324 
    312325   //! Initialize server 
    313    void CContext::initServer(MPI_Comm intraComm,MPI_Comm interComm, CContext* cxtClient /*= 0*/) 
     326   void CContext::initServer(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtClient /*= 0*/) 
    314327   { 
    315328     hasServer=true; 
     
    323336     registryOut->setPath(getId()) ; 
    324337 
    325      MPI_Comm intraCommClient, interCommClient; 
     338     ep_lib::MPI_Comm intraCommClient, interCommClient; 
    326339     if (cxtClient) // Attached mode 
    327340     { 
     
    372385        } 
    373386 
    374         for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 
     387        for (std::list<ep_lib::MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 
    375388          MPI_Comm_free(&(*it)); 
    376389        comms.clear(); 
     
    812825   void CContext::postProcessing() 
    813826   { 
     827     int myRank; 
     828     MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 
     829 
    814830     if (isPostProcessed) return; 
    815831 
     
    11911207   void CContext::updateCalendar(int step) 
    11921208   { 
    1193       info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 
    11941209      calendar->update(step); 
    1195       info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 
    11961210 
    11971211      if (hasClient) 
     
    12411255    CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 
    12421256    getRoot(); 
    1243     if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 
     1257    //if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 
     1258    if (!hasctxt) CGroupFactory::AddChild(*root_ptr, context->getShared()); 
    12441259 
    12451260#define DECLARE_NODE(Name_, name_) \ 
Note: See TracChangeset for help on using the changeset viewer.