Ignore:
Timestamp:
11/16/17 16:20:41 (6 years ago)
Author:
yushan
Message:

dev_omp

File:
1 edited

Legend:

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

    r1328 r1331  
    2323namespace xios { 
    2424 
    25   shared_ptr<CContextGroup> CContext::root; 
    26  
    27    /// ////////////////////// Définitions ////////////////////// /// 
     25  shared_ptr<CContextGroup> * CContext::root_ptr = 0; 
     26 
     27   /// ////////////////////// Dfinitions ////////////////////// /// 
    2828 
    2929   CContext::CContext(void) 
     
    5959   CContextGroup* CContext::getRoot(void) 
    6060   { 
    61       if (root.get()==NULL) root=shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
    62       return root.get(); 
     61      //std::cout<<omp_get_thread_num()<<" get root name = "<<xml::CXMLNode::GetRootName()<<std::endl; 
     62      if (root_ptr==0) root_ptr = new shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
     63      return root_ptr->get(); 
    6364   } 
    6465 
     
    182183      if (!this->hasChild()) 
    183184      { 
    184          //oss << "<!-- No definition -->" << std::endl; // fait planter l'incrémentation 
     185         //oss << "<!-- No definition -->" << std::endl; // fait planter l'incrmentation 
    185186      } 
    186187      else 
     
    555556   void CContext::solveAllInheritance(bool apply) // default : apply = true 
    556557   { 
    557      // Résolution des héritages descendants (càd des héritages de groupes) 
     558     // Rsolution des hritages descendants (cd des hritages de groupes) 
    558559     // pour chacun des contextes. 
    559560      solveDescInheritance(apply); 
    560561 
    561      // Résolution des héritages par référence au niveau des fichiers. 
     562     // Rsolution des hritages par rfrence au niveau des fichiers. 
    562563      const vector<CFile*> allFiles=CFile::getAll(); 
    563564      const vector<CGrid*> allGrids= CGrid::getAll(); 
     
    583584 
    584585      for (unsigned int i = 0; i < allFiles.size(); i++) 
    585          if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est défini. 
     586         if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est dfini. 
    586587         { 
    587             if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixé à vrai. 
     588            if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fix  vrai. 
    588589            { 
    589590              if ((initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 
     
    610611 
    611612      if (enabledFiles.size() == 0) 
    612          DEBUG(<<"Aucun fichier ne va être sorti dans le contexte nommé \"" 
     613         DEBUG(<<"Aucun fichier ne va tre sorti dans le contexte nomm \"" 
    613614               << getId() << "\" !"); 
    614615   } 
     
    847848      prepareTimeseries(); 
    848849 
    849       //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers à sortir. 
     850      //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers sortir. 
    850851      this->findEnabledFiles(); 
    851852      this->findEnabledReadModeFiles(); 
     
    12571258    CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 
    12581259    getRoot(); 
    1259     if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 
     1260    if (!hasctxt) CGroupFactory::AddChild(*root_ptr, context->getShared()); 
    12601261 
    12611262#define DECLARE_NODE(Name_, name_) \ 
Note: See TracChangeset for help on using the changeset viewer.