Ignore:
Timestamp:
11/15/17 12:14:34 (7 years ago)
Author:
yushan
Message:

dev_omp

Location:
XIOS/dev/branch_openmp/src/node
Files:
29 edited

Legend:

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

    r1205 r1328  
    4444   { /* Ne rien faire de plus */ } 
    4545 
    46    std::map<StdString, ETranformationType> *CAxis::transformationMapList_ptr = 0; //new std::map<StdString, ETranformationType>();   
    47    //bool CAxis::dummyTransformationMapList_ = CAxis::initializeTransformationMap(CAxis::transformationMapList_ptr); 
    48  
     46   //std::map<StdString, ETranformationType> CAxis::transformationMapList_ = std::map<StdString, ETranformationType>(); 
     47   std::map<StdString, ETranformationType> *CAxis::transformationMapList_ptr = 0; 
     48   //bool CAxis::dummyTransformationMapList_ = CAxis::initializeTransformationMap(CAxis::transformationMapList_); 
     49    
    4950   bool CAxis::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 
    5051   { 
     
    5556     m["extract_domain"] = TRANS_EXTRACT_DOMAIN_TO_AXIS; 
    5657   } 
    57  
    5858 
    5959   bool CAxis::initializeTransformationMap() 
     
    6666     (*CAxis::transformationMapList_ptr)["extract_domain"]   = TRANS_EXTRACT_DOMAIN_TO_AXIS; 
    6767   } 
    68  
    6968 
    7069   ///--------------------------------------------------------------- 
     
    500499        globalAxisZoom[nZoomCount] = globalZoomIndex; 
    501500        ++nZoomCount; 
    502       } 
     501      }  
    503502    } 
    504503 
     
    831830      CContextServer* server = CContext::getCurrent()->server; 
    832831      axis->numberWrittenIndexes_ = axis->indexesToWrite.size(); 
    833       ep_lib::MPI_Allreduce(&axis->numberWrittenIndexes_, &axis->totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm); 
    834       ep_lib::MPI_Scan(&axis->numberWrittenIndexes_, &axis->offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm); 
     832      MPI_Allreduce(&axis->numberWrittenIndexes_, &axis->totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm); 
     833      MPI_Scan(&axis->numberWrittenIndexes_, &axis->offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm); 
    835834      axis->offsetWrittenIndexes_ -= axis->numberWrittenIndexes_; 
    836835    } 
     
    978977        msg << ni << begin << end; 
    979978        msg << global_zoom_begin.getValue() << global_zoom_n.getValue(); 
    980         msg << isCompressible_; 
     979        msg << isCompressible_;         
    981980        msg << zoomIndex; 
    982981        if (zoomIndex) 
     
    11571156 
    11581157        nodeElementName = node.getElementName(); 
    1159  
     1158        //std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_.end(), it; 
    11601159        if(transformationMapList_ptr == 0) initializeTransformationMap(); 
    1161         //transformationMapList_ptr = new std::map<StdString, ETranformationType>(); 
    1162  
    1163         std::map<StdString, ETranformationType>::const_iterator ite = (*CAxis::transformationMapList_ptr).end(), it; 
    1164         it = (*CAxis::transformationMapList_ptr).find(nodeElementName); 
     1160        std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_ptr->end(), it; 
     1161        //it = transformationMapList_.find(nodeElementName); 
     1162        it = transformationMapList_ptr->find(nodeElementName); 
    11651163        if (ite != it) 
    11661164        { 
     
    11841182 
    11851183} // namespace xios 
    1186  
  • XIOS/dev/branch_openmp/src/node/axis.hpp

    r1205 r1328  
    172172       private: 
    173173         static bool initializeTransformationMap(std::map<StdString, ETranformationType>& m); 
    174          //static bool initializeTransformationMap(std::map<StdString, ETranformationType>* m); 
    175174         static bool initializeTransformationMap(); 
    176  
    177175         //static std::map<StdString, ETranformationType> transformationMapList_; 
    178           
    179176         static std::map<StdString, ETranformationType> *transformationMapList_ptr; 
    180          #pragma omp threadprivate(transformationMapList_ptr) 
    181  
    182          //static bool dummyTransformationMapList_; 
    183          //#pragma omp threadprivate(dummyTransformationMapList_) 
     177         static bool dummyTransformationMapList_; 
    184178 
    185179         DECLARE_REF_FUNC(Axis,axis) 
     
    193187 
    194188#endif // __XIOS_CAxis__ 
    195  
  • XIOS/dev/branch_openmp/src/node/compute_connectivity_domain.hpp

    r1134 r1328  
    6060      static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node); 
    6161      static bool _dummyRegistered; 
    62       #pragma omp threadprivate(_dummyRegistered) 
    63        
    6462  }; // class CComputeConnectivityDomain 
    6563 
  • XIOS/dev/branch_openmp/src/node/context.cpp

    r1287 r1328  
     1 
    12#include "context.hpp" 
    23#include "attribute_template.hpp" 
     
    1718#include "memtrack.hpp" 
    1819 
     20using namespace ep_lib; 
     21 
    1922 
    2023namespace xios { 
    2124 
    22   //shared_ptr<CContextGroup> CContext::root; 
    23   boost::shared_ptr<CContextGroup> * CContext::root_ptr = 0; 
    24  
    25    /// ////////////////////// Dfinitions ////////////////////// /// 
     25  shared_ptr<CContextGroup> CContext::root; 
     26 
     27   /// ////////////////////// Définitions ////////////////////// /// 
    2628 
    2729   CContext::CContext(void) 
     
    5759   CContextGroup* CContext::getRoot(void) 
    5860   { 
    59       //if (root.get()==NULL) root=shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
    60       //return root.get(); 
    61  
    62       //static shared_ptr<CContextGroup> *root_ptr; 
    63       if(root_ptr == 0) //root_ptr = new shared_ptr<CContextGroup>; 
    64       // if (root_ptr->get()==NULL)  
    65       root_ptr = new boost::shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
    66       return root_ptr->get(); 
     61      if (root.get()==NULL) root=shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
     62      return root.get(); 
    6763   } 
    6864 
     
    186182      if (!this->hasChild()) 
    187183      { 
    188          //oss << "<!-- No definition -->" << std::endl; // fait planter l'incrmentation 
     184         //oss << "<!-- No definition -->" << std::endl; // fait planter l'incrémentation 
    189185      } 
    190186      else 
     
    248244   { 
    249245     hasClient=true; 
    250      client = new CContextClient(this, intraComm, interComm, cxtServer); 
    251  
    252      int tmp_rank; 
    253      MPI_Comm_rank(intraComm, &tmp_rank); 
    254      MPI_Barrier(intraComm); 
    255       
    256  
     246     client = new CContextClient(this,intraComm, interComm, cxtServer); 
    257247     registryIn=new CRegistry(intraComm); 
    258248     registryIn->setPath(getId()) ; 
     
    271261     else 
    272262     { 
    273        MPI_Comm_dup(intraComm, &intraCommServer); 
     263       ep_lib::MPI_Comm_dup(intraComm, &intraCommServer); 
    274264       comms.push_back(intraCommServer); 
    275        MPI_Comm_dup(interComm, &interCommServer); 
     265       ep_lib::MPI_Comm_dup(interComm, &interCommServer); 
    276266       comms.push_back(interCommServer); 
    277267     } 
     
    353343     else 
    354344     { 
    355        MPI_Comm_dup(intraComm, &intraCommClient); 
     345       ep_lib::MPI_Comm_dup(intraComm, &intraCommClient); 
    356346       comms.push_back(intraCommClient); 
    357        MPI_Comm_dup(interComm, &interCommClient); 
     347       ep_lib::MPI_Comm_dup(interComm, &interCommClient); 
    358348       comms.push_back(interCommClient); 
    359349     } 
     
    395385 
    396386        for (std::list<ep_lib::MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 
    397           MPI_Comm_free(&(*it)); 
     387          ep_lib::MPI_Comm_free(&(*it)); 
    398388        comms.clear(); 
    399389      } 
     
    527517   } 
    528518 
    529    void CContext::checkPrefetchingOfEnabledReadModeFiles() 
     519   void CContext::doPostTimestepOperationsForEnabledReadModeFiles() 
    530520   { 
    531521     int size = enabledReadModeFiles.size(); 
    532522     for (int i = 0; i < size; ++i) 
    533523     { 
    534         enabledReadModeFiles[i]->prefetchEnabledReadModeFieldsIfNeeded(); 
     524        enabledReadModeFiles[i]->doPostTimestepOperationsForEnabledReadModeFields(); 
    535525     } 
    536526   } 
     
    563553  } 
    564554 
    565    void CContext::solveAllInheritance(bool apply) 
    566    { 
    567      // Rsolution des hritages descendants (cd des hritages de groupes) 
     555   void CContext::solveAllInheritance(bool apply) // default : apply = true 
     556   { 
     557     // Résolution des héritages descendants (càd des héritages de groupes) 
    568558     // pour chacun des contextes. 
    569559      solveDescInheritance(apply); 
    570560 
    571      // Rsolution des hritages par rfrence au niveau des fichiers. 
     561     // Résolution des héritages par référence au niveau des fichiers. 
    572562      const vector<CFile*> allFiles=CFile::getAll(); 
    573563      const vector<CGrid*> allGrids= CGrid::getAll(); 
     
    593583 
    594584      for (unsigned int i = 0; i < allFiles.size(); i++) 
    595          if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est dfini. 
     585         if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est défini. 
    596586         { 
    597             if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fix  vrai. 
     587            if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixé à vrai. 
    598588            { 
    599589              if ((initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 
     
    620610 
    621611      if (enabledFiles.size() == 0) 
    622          DEBUG(<<"Aucun fichier ne va tre sorti dans le contexte nomm \"" 
     612         DEBUG(<<"Aucun fichier ne va être sorti dans le contexte nommé \"" 
    623613               << getId() << "\" !"); 
    624614   } 
     
    836826   void CContext::postProcessing() 
    837827   { 
    838      int myRank; 
    839      MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 
    840  
    841828     if (isPostProcessed) return; 
    842829 
     
    860847      prepareTimeseries(); 
    861848 
    862       //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers sortir. 
     849      //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers à sortir. 
    863850      this->findEnabledFiles(); 
    864851      this->findEnabledReadModeFiles(); 
     
    12181205   void CContext::updateCalendar(int step) 
    12191206   { 
    1220       #pragma omp critical (_output) 
    1221       {info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl;} 
     1207      info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 
    12221208      calendar->update(step); 
    1223       #pragma omp critical (_output) 
    1224       {info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl;} 
     1209      info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 
    12251210#ifdef XIOS_MEMTRACK_LIGHT 
    1226       #pragma omp critical (_output) 
    1227       {info(50) << " Current memory used by XIOS : "<<  MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ;} 
     1211      info(50) << " Current memory used by XIOS : "<<  MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ; 
    12281212#endif 
    12291213      if (hasClient) 
    12301214      { 
    1231         checkPrefetchingOfEnabledReadModeFiles(); 
     1215        doPostTimestepOperationsForEnabledReadModeFiles(); 
    12321216        garbageCollector.invalidate(calendar->getCurrentDate()); 
    12331217      } 
     
    12731257    CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 
    12741258    getRoot(); 
    1275     if (!hasctxt) CGroupFactory::AddChild(*root_ptr, context->getShared()); 
     1259    if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 
    12761260 
    12771261#define DECLARE_NODE(Name_, name_) \ 
  • XIOS/dev/branch_openmp/src/node/context.hpp

    r1287 r1328  
    55#include "xios_spl.hpp" 
    66//#include "node_type.hpp" 
     7#include "mpi_std.hpp" 
    78#include "calendar_wrapper.hpp" 
    89 
     
    1314#include "garbage_collector.hpp" 
    1415#include "registry.hpp" 
    15 #include "mpi.hpp" 
    1616 
    1717 
     
    115115         void buildFilterGraphOfEnabledFields(); 
    116116         void startPrefetchingOfEnabledReadModeFiles(); 
    117          void checkPrefetchingOfEnabledReadModeFiles(); 
     117         void doPostTimestepOperationsForEnabledReadModeFiles(); 
    118118         void findFieldsWithReadAccess(void); 
    119119         void solveAllRefOfFieldsWithReadAccess(); 
     
    206206 
    207207         // Context root 
    208          //static shared_ptr<CContextGroup> root; 
    209  
    210          static boost::shared_ptr<CContextGroup> *root_ptr; 
    211          #pragma omp threadprivate(root_ptr) 
     208         static shared_ptr<CContextGroup> root; 
    212209 
    213210         // Determine context on client or not 
     
    222219         // Concrete contex client 
    223220         CContextClient* client; 
    224  
    225  
    226221         CRegistry* registryIn ;  //!< input registry which is read from file 
    227222         CRegistry* registryOut ; //!< output registry which will be wrote on file at the finalize 
    228           
    229223 
    230224      private: 
  • XIOS/dev/branch_openmp/src/node/domain.cpp

    r1138 r1328  
    2626namespace xios { 
    2727 
    28    /// ////////////////////// Dfinitions ////////////////////// /// 
     28   /// ////////////////////// Définitions ////////////////////// /// 
    2929 
    3030   CDomain::CDomain(void) 
     
    6666 
    6767   //std::map<StdString, ETranformationType> CDomain::transformationMapList_ = std::map<StdString, ETranformationType>(); 
     68   std::map<StdString, ETranformationType> *CDomain::transformationMapList_ptr = 0; 
    6869   //bool CDomain::_dummyTransformationMapList = CDomain::initializeTransformationMap(CDomain::transformationMapList_); 
    69  
    70    std::map<StdString, ETranformationType> *CDomain::transformationMapList_ptr = 0; 
    7170 
    7271   bool CDomain::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 
     
    8887     (*CDomain::transformationMapList_ptr)["expand_domain"] = TRANS_EXPAND_DOMAIN; 
    8988   } 
    90  
    9189 
    9290   const std::set<StdString> & CDomain::getRelFiles(void) const 
     
    445443      break; 
    446444     } 
     445     completeLonLatClient() ; 
    447446 
    448447   } 
     
    636635   { 
    637636          CContext* context = CContext::getCurrent(); 
    638           CContextClient* client = context->client; 
     637      CContextClient* client = context->client; 
    639638          lon_g.resize(ni_glo) ; 
    640639          lat_g.resize(nj_glo) ; 
     
    14951494 
    14961495      if (context->hasClient) 
    1497       { // Ct client uniquement 
     1496      { // CÃŽté client uniquement 
    14981497         this->checkMask(); 
    14991498         this->checkDomainData(); 
     
    15021501      } 
    15031502      else 
    1504       { // Ct serveur uniquement 
     1503      { // CÃŽté serveur uniquement 
    15051504      } 
    15061505 
     
    15351534 
    15361535      if (context->hasClient) 
    1537       { // Ct client uniquement 
     1536      { // CÃŽté client uniquement 
    15381537         this->checkMask(); 
    15391538         this->checkDomainData(); 
     
    15431542      } 
    15441543      else 
    1545       { // Ct serveur uniquement 
     1544      { // CÃŽté serveur uniquement 
    15461545      } 
    15471546 
     
    17261725                                                                                client->intraComm); 
    17271726    clientServerMap->computeServerIndexMapping(globalIndexDomain); 
    1728      
    17291727    const CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer(); 
    17301728 
     
    23652363        nodeElementName = node.getElementName(); 
    23662364        if(transformationMapList_ptr == 0) initializeTransformationMap(); 
    2367         std::map<StdString, ETranformationType>::const_iterator ite = (*transformationMapList_ptr).end(), it; 
    2368         it = (*transformationMapList_ptr).find(nodeElementName); 
     2365        //std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_.end(), it; 
     2366        std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_ptr->end(), it; 
     2367        //it = transformationMapList_.find(nodeElementName); 
     2368        it = transformationMapList_ptr->find(nodeElementName); 
    23692369        if (ite != it) 
    23702370        { 
  • XIOS/dev/branch_openmp/src/node/domain.hpp

    r1134 r1328  
    218218         static bool initializeTransformationMap(); 
    219219         //static std::map<StdString, ETranformationType> transformationMapList_; 
    220   
    221220         static std::map<StdString, ETranformationType> *transformationMapList_ptr; 
    222          #pragma omp threadprivate(transformationMapList_ptr) 
    223  
    224          //static bool _dummyTransformationMapList; 
    225          //#pragma omp threadprivate(_dummyTransformationMapList) 
     221         static bool _dummyTransformationMapList; 
    226222 
    227223         DECLARE_REF_FUNC(Domain,domain) 
  • XIOS/dev/branch_openmp/src/node/expand_domain.hpp

    r1134 r1328  
    6060      static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node); 
    6161      static bool _dummyRegistered; 
    62       #pragma omp threadprivate(_dummyRegistered) 
    63        
    6462  }; // class CExpandDomain 
    6563 
  • XIOS/dev/branch_openmp/src/node/extract_axis_to_scalar.hpp

    r1134 r1328  
    6060      static CTransformation<CScalar>* create(const StdString& id, xml::CXMLNode* node); 
    6161      static bool _dummyRegistered; 
    62       #pragma omp threadprivate(_dummyRegistered) 
    6362  }; // class CExtractAxisToScalar 
    6463 
  • XIOS/dev/branch_openmp/src/node/extract_domain_to_axis.hpp

    r1134 r1328  
    6060      static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node); 
    6161      static bool _dummyRegistered; 
    62       #pragma omp threadprivate(_dummyRegistered) 
    6362  }; // class CExtractDomainToAxis 
    6463 
  • XIOS/dev/branch_openmp/src/node/field.cpp

    r1209 r1328  
    2424#include "spatial_transform_filter.hpp" 
    2525 
     26#include <stdio.h> 
     27 
    2628namespace xios{ 
    2729 
    2830   /// ////////////////////// Dfinitions ////////////////////// /// 
     31 
     32  CField* CField::my_getDirectFieldReference(void) const 
     33  {                                                                       
     34    // if (this->field_ref.isEmpty())                                      
     35    // ERROR("C" #type "* C" #type "::getDirect" #type "Reference(void)",  
     36    //       << "The " #name_ " with id = '" << getId() << "'"             
     37    //       << " has no " #name_ "_ref.");                                
     38                                                                        
     39    // if (!C##type::has(this->name_##_ref))                                 
     40    // ERROR("C" #type "* C" #type "::getDirect" #type "Reference(void)",  
     41    //       << this->name_##_ref                                          
     42    //       << " refers to an unknown " #name_ " id.");                   
     43                                                                        
     44    return CField::get(this->field_ref);                               
     45  } 
     46 
    2947 
    3048   CField::CField(void) 
     
    3856      , hasTimeInstant(false) 
    3957      , hasTimeCentered(false) 
     58      , wasDataRequestedFromServer(false) 
    4059      , wasDataAlreadyReceivedFromServer(false) 
    4160      , isEOF(false) 
     
    5271      , hasTimeInstant(false) 
    5372      , hasTimeCentered(false) 
     73      , wasDataRequestedFromServer(false) 
    5474      , wasDataAlreadyReceivedFromServer(false) 
    5575      , isEOF(false) 
     
    261281    lastDataRequestedFromServer = tsDataRequested; 
    262282 
    263     if (!isEOF) // No need to send the request if we already know we are at EOF 
     283    // No need to send the request if we are sure that we are already at EOF 
     284    if (!isEOF || context->getCalendar()->getCurrentDate() <= dateEOF) 
    264285    { 
    265286      CEventClient event(getType(), EVENT_ID_READ_DATA); 
     
    277298    else 
    278299      serverSourceFilter->signalEndOfStream(tsDataRequested); 
     300 
     301    wasDataRequestedFromServer = true; 
    279302 
    280303    return !isEOF; 
     
    293316    while (currentDate >= lastDataRequestedFromServer) 
    294317    { 
    295       #pragma omp critical (_output) 
    296       { 
    297         info(20) << "currentDate : " << currentDate << endl ; 
    298         info(20) << "lastDataRequestedFromServer : " << lastDataRequestedFromServer << endl ; 
    299         info(20) << "file->output_freq.getValue() : " << file->output_freq.getValue() << endl ; 
    300         info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ; 
    301       } 
     318      info(20) << "currentDate : " << currentDate << endl ; 
     319      info(20) << "lastDataRequestedFromServer : " << lastDataRequestedFromServer << endl ; 
     320      info(20) << "file->output_freq.getValue() : " << file->output_freq.getValue() << endl ; 
     321      info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ; 
     322 
    302323      dataRequested |= sendReadDataRequest(lastDataRequestedFromServer + file->output_freq); 
    303324    } 
     
    435456  { 
    436457    CContext* context = CContext::getCurrent(); 
    437     int record; 
    438458    std::map<int, CArray<double,1> > data; 
     459    const bool wasEOF = isEOF; 
    439460 
    440461    for (int i = 0; i < ranks.size(); i++) 
    441462    { 
    442463      int rank = ranks[i]; 
     464      int record; 
    443465      *buffers[i] >> record; 
    444466      isEOF = (record == int(-1)); 
     
    459481 
    460482    if (isEOF) 
     483    { 
     484      if (!wasEOF) 
     485        dateEOF = lastDataReceivedFromServer; 
     486 
    461487      serverSourceFilter->signalEndOfStream(lastDataReceivedFromServer); 
     488    } 
    462489    else 
    463490      serverSourceFilter->streamDataFromServer(lastDataReceivedFromServer, data); 
     491  } 
     492 
     493  void CField::checkForLateDataFromServer(void) 
     494  { 
     495    CContext* context = CContext::getCurrent(); 
     496    const CDate& currentDate = context->getCalendar()->getCurrentDate(); 
     497 
     498    // Check if data previously requested has been received as expected 
     499    if (wasDataRequestedFromServer && (!isEOF || currentDate <= dateEOF)) 
     500    { 
     501      CTimer timer("CField::checkForLateDataFromServer"); 
     502 
     503      bool isDataLate; 
     504      do 
     505      { 
     506        const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + file->output_freq) : context->getCalendar()->getInitDate(); 
     507        isDataLate = nextDataDue < currentDate; 
     508 
     509        if (isDataLate) 
     510        { 
     511          timer.resume(); 
     512 
     513          context->checkBuffersAndListen(); 
     514 
     515          timer.suspend(); 
     516        } 
     517      } 
     518      while (isDataLate && timer.getCumulatedTime() < CXios::recvFieldTimeout); 
     519 
     520      if (isDataLate) 
     521        ERROR("void CField::checkForLateDataFromServer(void)", 
     522              << "Late data at timestep = " << currentDate); 
     523    } 
    464524  } 
    465525 
     
    694754     CContext* context = CContext::getCurrent(); 
    695755     solveOnlyReferenceEnabledField(doSending2Server); 
    696      int myRank; 
    697      MPI_Comm_rank(context->client->intraComm, &myRank); 
     756 
     757     //std::cout<<"Field "<<this->getId()<<" areAllReferenceSolved = "<<areAllReferenceSolved<<std::endl;  
    698758 
    699759     if (!areAllReferenceSolved) 
    700760     { 
    701761        areAllReferenceSolved = true; 
    702  
     762        //std::cout<<"Field "<<this->getId()<<" all reference solved"<<std::endl;  
    703763        if (context->hasClient) 
    704764        { 
     
    825885       // Check if the data is to be read from a file 
    826886       else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 
    827          instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 
    828                                                                                                      freq_offset.isEmpty() ? NoneDu : freq_offset, 
    829                                                                                                      true, 
     887       { 
     888         checkAttributes(); 
     889         instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, freq_offset, true, 
    830890                                                                                                     detectMissingValues, defaultValue)); 
     891       } 
    831892       else // The data might be passed from the model 
    832893       { 
     
    910971       { 
    911972         if (!serverSourceFilter) 
    912            serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 
    913                                                                                    freq_offset.isEmpty() ? NoneDu : freq_offset, 
    914                                                                                    true, 
     973         { 
     974           checkAttributes(); 
     975           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, freq_offset, true, 
    915976                                                                                   detectMissingValues, defaultValue)); 
     977         } 
    916978 
    917979         selfReferenceFilter = serverSourceFilter; 
     
    9581020               << "An operation must be defined for field \"" << getId() << "\"."); 
    9591021 
    960        if (freq_op.isEmpty()) 
    961          freq_op.setValue(TimeStep); 
    962        if (freq_offset.isEmpty()) 
    963          freq_offset.setValue(NoneDu); 
     1022       checkAttributes(); 
    9641023 
    9651024       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    966         
    9671025       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    9681026                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
     
    10001058               << "An operation must be defined for field \"" << getId() << "\"."); 
    10011059 
    1002        if (freq_op.isEmpty()) freq_op.setValue(TimeStep); 
    1003        if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu); 
     1060       checkAttributes(); 
    10041061 
    10051062       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    1006  
    10071063       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    10081064                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
     
    14501506 
    14511507   /*! 
     1508    * Check on freq_off and freq_op attributes. 
     1509    */ 
     1510   void CField::checkAttributes(void) 
     1511   { 
     1512     bool isFieldRead = file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read; 
     1513     if (isFieldRead && operation.getValue() != "instant") 
     1514       ERROR("void CField::checkAttributes(void)", 
     1515             << "Unsupported operation for field '" << getFieldOutputName() << "'." << std::endl 
     1516             << "Currently only \"instant\" is supported for fields read from file.") 
     1517 
     1518     if (freq_op.isEmpty()) 
     1519     { 
     1520       if (operation.getValue() == "instant") 
     1521         freq_op.setValue(file->output_freq.getValue()); 
     1522       else 
     1523         freq_op.setValue(TimeStep); 
     1524     } 
     1525     if (freq_offset.isEmpty()) 
     1526       freq_offset.setValue(isFieldRead ? NoneDu : (freq_op.getValue() - TimeStep)); 
     1527   } 
     1528 
     1529   /*! 
    14521530    * Returns string arithmetic expression associated to the field. 
    14531531    * \return if content is defined return content string, otherwise, if "expr" attribute is defined, return expr string. 
  • XIOS/dev/branch_openmp/src/node/field.hpp

    r1119 r1328  
    150150        static void recvReadDataReady(CEventServer& event); 
    151151        void recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers); 
     152        void checkForLateDataFromServer(void); 
    152153        void outputField(CArray<double,3>& fieldOut); 
    153154        void outputField(CArray<double,2>& fieldOut); 
     
    176177        void sendAddAllVariables(); 
    177178 
     179        /// Vérifications /// 
     180        void checkAttributes(void); 
    178181 
    179182        const std::vector<StdString>& getRefDomainAxisIds(); 
     
    181184        const string& getExpression(void); 
    182185        bool hasExpression(void) const; 
     186 
     187        CField* my_getDirectFieldReference(void) const; 
     188 
     189 
    183190 
    184191      public: 
     
    195202         bool isEOF; 
    196203         CDate lastlast_Write_srv, last_Write_srv, last_operation_srv; 
    197          CDate lastDataRequestedFromServer, lastDataReceivedFromServer; 
    198          bool wasDataAlreadyReceivedFromServer; 
     204         CDate lastDataRequestedFromServer, lastDataReceivedFromServer, dateEOF; 
     205         bool wasDataRequestedFromServer, wasDataAlreadyReceivedFromServer; 
    199206 
    200207         map<int,boost::shared_ptr<func::CFunctor> > foperation_srv; 
  • XIOS/dev/branch_openmp/src/node/file.cpp

    r1287 r1328  
    1818#include "timer.hpp" 
    1919 
     20 
    2021namespace xios { 
    2122 
     
    2425   CFile::CFile(void) 
    2526      : CObjectTemplate<CFile>(), CFileAttributes() 
    26       , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL) 
     27      , vFieldGroup(), data_out(), enabledFields() 
    2728      , allDomainEmpty(false), isOpen(false) 
    2829   { 
     
    3334   CFile::CFile(const StdString & id) 
    3435      : CObjectTemplate<CFile>(id), CFileAttributes() 
    35       , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL) 
     36      , vFieldGroup(), data_out(), enabledFields() 
    3637      , allDomainEmpty(false), isOpen(false) 
    3738    { 
     
    263264      // create sub communicator for file 
    264265      int color = allDomainEmpty ? 0 : 1; 
    265       MPI_Comm_split(server->intraComm, color, server->intraCommRank, &fileComm); 
    266       if (allDomainEmpty) MPI_Comm_free(&fileComm); 
     266      ep_lib::MPI_Comm_split(server->intraComm, color, server->intraCommRank, &fileComm); 
     267      if (allDomainEmpty) ep_lib::MPI_Comm_free(&fileComm); 
    267268 
    268269      // if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered); 
     
    461462         { 
    462463            int commSize, commRank; 
    463             MPI_Comm_size(fileComm, &commSize); 
    464             MPI_Comm_rank(fileComm, &commRank); 
     464            ep_lib::MPI_Comm_size(fileComm, &commSize); 
     465            ep_lib::MPI_Comm_rank(fileComm, &commRank); 
    465466 
    466467            if (server->intraCommSize > 1) 
     
    482483         if (isOpen) data_out->closeFile(); 
    483484 
    484         data_out = boost::shared_ptr<CDataOutput>(new CNc4DataOutput(this, oss.str(), append, useClassicFormat, useCFConvention, 
    485                                                               static_cast< ::MPI_Comm >(fileComm.mpi_comm), multifile, isCollective, time_counter_name)); 
     485        data_out = shared_ptr<CDataOutput>(new CNc4DataOutput(this, oss.str(), append, useClassicFormat, useCFConvention, 
     486                                                              fileComm, multifile, isCollective, time_counter_name)); 
    486487        isOpen = true; 
    487488 
     
    577578      { 
    578579        int commSize, commRank; 
    579         MPI_Comm_size(fileComm, &commSize); 
    580         MPI_Comm_rank(fileComm, &commRank); 
     580        ep_lib::MPI_Comm_size(fileComm, &commSize); 
     581        ep_lib::MPI_Comm_rank(fileComm, &commRank); 
    581582 
    582583        if (server->intraCommSize > 1) 
     
    596597      bool isCollective = par_access.isEmpty() || par_access == par_access_attr::collective; 
    597598 
    598       #ifdef _usingEP 
    599       //printf("multifile was %d\n", multifile); 
    600       multifile = true; 
    601599      if (isOpen) data_out->closeFile(); 
    602       if (time_counter_name.isEmpty()) data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), static_cast< ::MPI_Comm >(fileComm.mpi_comm), multifile, isCollective)); 
    603       else data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), static_cast< ::MPI_Comm >(fileComm.mpi_comm), multifile, isCollective, time_counter_name)); 
     600      if (time_counter_name.isEmpty()) data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective)); 
     601      else data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective, time_counter_name)); 
    604602      isOpen = true; 
    605       #else 
    606       if (isOpen) data_out->closeFile(); 
    607       if (time_counter_name.isEmpty()) data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), static_cast< ::MPI_Comm >(fileComm.mpi_comm), multifile, isCollective)); 
    608       else data_in = boost::shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), static_cast< ::MPI_Comm >(fileComm.mpi_comm), multifile, isCollective, time_counter_name)); 
    609       isOpen = true; 
    610       #endif 
    611  
    612        
    613603    } 
    614604  } 
     
    625615          this->data_in->closeFile(); 
    626616       } 
    627       if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm); 
     617//      if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm); 
     618      //if (fileComm.mpi_comm != ::MPI_COMM_NULL) MPI_Comm_free(&fileComm); 
    628619   } 
    629620   //---------------------------------------------------------------- 
     
    638629 
    639630     // It would probably be better to call initFile() somehow 
    640       
    641      MPI_Comm_dup(client->intraComm, &fileComm); 
     631     ep_lib::MPI_Comm_dup(client->intraComm, &fileComm); 
    642632     if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 
    643633 
    644      //#pragma omp critical (_readAttributesOfEnabledFieldsInReadMode_) 
    645      //{ 
    646      checkFile(); // calls nc_open 
     634     checkFile(); 
    647635 
    648636     for (int idx = 0; idx < enabledFields.size(); ++idx) 
     
    658646 
    659647        // Read necessary value from file 
    660         #pragma omp critical (_func) 
    661         { 
    662           //checkFile(); 
    663           this->data_in->readFieldAttributesValues(enabledFields[idx]); 
    664           //close(); 
    665         } 
    666          
     648        this->data_in->readFieldAttributesValues(enabledFields[idx]); 
     649 
    667650        // Fill attributes for base reference 
    668651        enabledFields[idx]->solveGridDomainAxisBaseRef(); 
     
    671654     // Now everything is ok, close it 
    672655     close(); 
    673      //} 
    674       
    675      //if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm); 
    676       
    677656   } 
    678657 
     
    806785 
    807786   /*! 
    808      Prefetching the data for enabled fields read from file whose data is out-of-date. 
    809    */ 
    810    void CFile::prefetchEnabledReadModeFieldsIfNeeded(void) 
     787     Do all post timestep operations for enabled fields in read mode: 
     788      - Prefetch the data read from file when needed 
     789      - Check that the data excepted from server has been received 
     790   */ 
     791   void CFile::doPostTimestepOperationsForEnabledReadModeFields(void) 
    811792   { 
    812793     if (mode.isEmpty() || mode.getValue() != mode_attr::read) 
     
    815796     int size = this->enabledFields.size(); 
    816797     for (int i = 0; i < size; ++i) 
     798     { 
     799       this->enabledFields[i]->checkForLateDataFromServer(); 
    817800       this->enabledFields[i]->sendReadDataRequestIfNeeded(); 
     801     } 
    818802   } 
    819803 
     
    11211105       CField* field = this->enabledFields[i]; 
    11221106       this->sendAddField(field->getId()); 
     1107       field->checkAttributes(); 
    11231108       field->sendAllAttributesToServer(); 
    11241109       field->sendAddAllVariables(); 
  • XIOS/dev/branch_openmp/src/node/file.hpp

    r1134 r1328  
    44/// XIOS headers /// 
    55#include "xios_spl.hpp" 
     6#include "mpi_std.hpp" 
    67#include "field.hpp" 
    78#include "data_output.hpp" 
     
    1112#include "attribute_enum.hpp" 
    1213#include "attribute_enum_impl.hpp" 
    13 #include "mpi.hpp" 
    14 #ifdef _usingEP 
    15 #include "ep_declaration.hpp" 
    16 #endif 
    1714 
    1815namespace xios { 
     
    110107         void buildFilterGraphOfEnabledFields(CGarbageCollector& gc); 
    111108         void prefetchEnabledReadModeFields(); 
    112          void prefetchEnabledReadModeFieldsIfNeeded(); 
     109         void doPostTimestepOperationsForEnabledReadModeFields(); 
    113110 
    114111         // Add component into file 
  • XIOS/dev/branch_openmp/src/node/generate_rectilinear_domain.hpp

    r1134 r1328  
    6060      static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node); 
    6161      static bool _dummyRegistered; 
    62       #pragma omp threadprivate(_dummyRegistered) 
    6362  }; // class CGenerateRectilinearDomain 
    6463 
  • XIOS/dev/branch_openmp/src/node/grid.cpp

    r1205 r1328  
    11141114          outLocalIndexToServer(idx) = itIndex->second; 
    11151115        } 
    1116  
     1116         
    11171117        const std::list<int>& ranks = client->getRanksServerLeader(); 
    11181118        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
     
    17501750        pDom->solveRefInheritance(apply); 
    17511751        pDom->solveInheritanceTransformation(); 
     1752        //cout<<"pDom check"<<endl; 
    17521753      } 
    17531754    } 
  • XIOS/dev/branch_openmp/src/node/interpolate_axis.hpp

    r1134 r1328  
    6262      static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node); 
    6363      static bool _dummyRegistered; 
    64       #pragma omp threadprivate(_dummyRegistered) 
    65        
    6664  }; // class CInterpolateAxis 
    6765 
  • XIOS/dev/branch_openmp/src/node/interpolate_domain.hpp

    r1134 r1328  
    6060      static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node); 
    6161      static bool _dummyRegistered; 
    62       #pragma omp threadprivate(_dummyRegistered) 
    6362  }; // class CInterpolateDomain 
    6463 
  • XIOS/dev/branch_openmp/src/node/inverse_axis.hpp

    r1134 r1328  
    5959      static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node); 
    6060      static bool _dummyRegistered; 
    61       #pragma omp threadprivate(_dummyRegistered) 
    6261 
    6362  }; // class CInverseAxis 
  • XIOS/dev/branch_openmp/src/node/mesh.cpp

    r1134 r1328  
    66 
    77#include "mesh.hpp" 
     8using namespace ep_lib; 
    89 
    910namespace xios { 
     
    3132  } 
    3233 
    33   std::map <StdString, CMesh> CMesh::meshList = std::map <StdString, CMesh>(); 
    34   std::map <StdString, vector<int> > CMesh::domainList = std::map <StdString, vector<int> >(); 
     34  //std::map <StdString, CMesh> CMesh::meshList = std::map <StdString, CMesh>(); 
     35  //std::map <StdString, vector<int> > CMesh::domainList = std::map <StdString, vector<int> >(); 
    3536 
    3637  std::map <StdString, CMesh> *CMesh::meshList_ptr = 0; 
    3738  std::map <StdString, vector<int> > *CMesh::domainList_ptr = 0; 
    38  
    3939 
    4040///--------------------------------------------------------------- 
     
    4545 * \param [in] nvertex Number of verteces (1 for nodes, 2 for edges, 3 and up for faces). 
    4646 */ 
    47  
    48 /* bkp 
    49   CMesh* CMesh::getMesh (StdString meshName, int nvertex) 
    50   { 
    51     CMesh::domainList[meshName].push_back(nvertex); 
    52  
    53     if ( CMesh::meshList.begin() != CMesh::meshList.end() ) 
    54     { 
    55       for (std::map<StdString, CMesh>::iterator it=CMesh::meshList.begin(); it!=CMesh::meshList.end(); ++it) 
    56       { 
    57         if (it->first == meshName) 
    58           return &meshList[meshName]; 
    59         else 
    60         { 
    61           CMesh newMesh; 
    62           CMesh::meshList.insert( make_pair(meshName, newMesh) ); 
    63           return &meshList[meshName]; 
    64         } 
    65       } 
    66     } 
    67     else 
    68     { 
    69       CMesh newMesh; 
    70       CMesh::meshList.insert( make_pair(meshName, newMesh) ); 
    71       return &meshList[meshName]; 
    72     } 
    73   } 
    74 */ 
    75  
    7647  CMesh* CMesh::getMesh (StdString meshName, int nvertex) 
    7748  { 
     
    7950    if(CMesh::meshList_ptr == NULL)   CMesh::meshList_ptr   = new std::map <StdString, CMesh>(); 
    8051 
    81     (*CMesh::domainList_ptr)[meshName].push_back(nvertex); 
    82  
    83     if ( (*CMesh::meshList_ptr).begin() != (*CMesh::meshList_ptr).end() ) 
    84     { 
    85       for (std::map<StdString, CMesh>::iterator it=(*CMesh::meshList_ptr).begin(); it!=(*CMesh::meshList_ptr).end(); ++it) 
     52    //CMesh::domainList[meshName].push_back(nvertex); 
     53    CMesh::domainList_ptr->at(meshName).push_back(nvertex); 
     54 
     55    //if ( CMesh::meshList.begin() != CMesh::meshList.end() ) 
     56    if ( CMesh::meshList_ptr->begin() != CMesh::meshList_ptr->end() ) 
     57    { 
     58      //for (std::map<StdString, CMesh>::iterator it=CMesh::meshList.begin(); it!=CMesh::meshList.end(); ++it) 
     59      for (std::map<StdString, CMesh>::iterator it=CMesh::meshList_ptr->begin(); it!=CMesh::meshList_ptr->end(); ++it) 
    8660      { 
    8761        if (it->first == meshName) 
    88           return &((*CMesh::meshList_ptr)[meshName]); 
     62          //return &meshList[meshName]; 
     63          return &meshList_ptr->at(meshName); 
    8964        else 
    9065        { 
    9166          CMesh newMesh; 
    92           (*CMesh::meshList_ptr).insert( make_pair(meshName, newMesh) ); 
    93           return &((*CMesh::meshList_ptr)[meshName]); 
     67          //CMesh::meshList.insert( make_pair(meshName, newMesh) ); 
     68          CMesh::meshList_ptr->insert( make_pair(meshName, newMesh) ); 
     69          //return &meshList[meshName]; 
     70          return &meshList_ptr->at(meshName); 
    9471        } 
    9572      } 
     
    9875    { 
    9976      CMesh newMesh; 
    100       (*CMesh::meshList_ptr).insert( make_pair(meshName, newMesh) ); 
    101       return &((*CMesh::meshList_ptr)[meshName]); 
     77      //CMesh::meshList.insert( make_pair(meshName, newMesh) ); 
     78      CMesh::meshList_ptr->insert( make_pair(meshName, newMesh) ); 
     79      //return &meshList[meshName]; 
     80      return &meshList_ptr->at(meshName); 
    10281    } 
    10382  } 
     
    524503 * \param [in] bounds_lat Array of boundary latitudes. Its size depends on the element type. 
    525504 */ 
    526   void CMesh::createMeshEpsilon(const ep_lib::MPI_Comm& comm, 
     505  void CMesh::createMeshEpsilon(const MPI_Comm& comm, 
    527506                                const CArray<double, 1>& lonvalue, const CArray<double, 1>& latvalue, 
    528507                                const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat) 
     
    17241703   */ 
    17251704 
    1726   void CMesh::getGloNghbFacesNodeType(const ep_lib::MPI_Comm& comm, const CArray<int, 1>& face_idx, 
     1705  void CMesh::getGloNghbFacesNodeType(const MPI_Comm& comm, const CArray<int, 1>& face_idx, 
    17271706                               const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 
    17281707                               CArray<int, 2>& nghbFaces) 
     
    18801859   */ 
    18811860 
    1882   void CMesh::getGloNghbFacesEdgeType(const ep_lib::MPI_Comm& comm, const CArray<int, 1>& face_idx, 
     1861  void CMesh::getGloNghbFacesEdgeType(const MPI_Comm& comm, const CArray<int, 1>& face_idx, 
    18831862                               const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 
    18841863                               CArray<int, 2>& nghbFaces) 
     
    20612040   */ 
    20622041 
    2063   void CMesh::getGlobalNghbFaces(const int nghbType, const ep_lib::MPI_Comm& comm, 
     2042  void CMesh::getGlobalNghbFaces(const int nghbType, const MPI_Comm& comm, 
    20642043                                 const CArray<int, 1>& face_idx, 
    20652044                                 const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 
  • XIOS/dev/branch_openmp/src/node/mesh.hpp

    r1134 r1328  
    8080      int nbFaces_; 
    8181 
    82       static std::map <StdString, CMesh> meshList; 
    83       static std::map <StdString, vector<int> > domainList; 
    84  
     82      //static std::map <StdString, CMesh> meshList; 
    8583      static std::map <StdString, CMesh> *meshList_ptr; 
     84      //static std::map <StdString, vector<int> > domainList; 
    8685      static std::map <StdString, vector<int> > *domainList_ptr; 
    87       #pragma omp threadprivate(meshList_ptr, domainList_ptr) 
    88     
    8986      CClientClientDHTSizet* pNodeGlobalIndex;                    // pointer to a map <nodeHash, nodeIdxGlo> 
    9087      CClientClientDHTSizet* pEdgeGlobalIndex;                    // pointer to a map <edgeHash, edgeIdxGlo> 
  • XIOS/dev/branch_openmp/src/node/reduce_axis_to_scalar.hpp

    r1134 r1328  
    5959      static CTransformation<CScalar>* create(const StdString& id, xml::CXMLNode* node); 
    6060      static bool _dummyRegistered; 
    61       #pragma omp threadprivate(_dummyRegistered) 
    6261  }; // class CReduceAxisToScalar 
    6362 
  • XIOS/dev/branch_openmp/src/node/reduce_domain_to_axis.hpp

    r1134 r1328  
    6060      static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node); 
    6161      static bool _dummyRegistered; 
    62       #pragma omp threadprivate(_dummyRegistered) 
    6362  }; // class CReduceDomainToAxis 
    6463 
  • XIOS/dev/branch_openmp/src/node/reduce_domain_to_scalar.hpp

    r1134 r1328  
    6060      static CTransformation<CScalar>* create(const StdString& id, xml::CXMLNode* node); 
    6161      static bool _dummyRegistered; 
    62       #pragma omp threadprivate(_dummyRegistered) 
    6362  }; // class CReduceDomainToScalar 
    6463 
  • XIOS/dev/branch_openmp/src/node/scalar.cpp

    r1134 r1328  
    2828 
    2929   //std::map<StdString, ETranformationType> CScalar::transformationMapList_ = std::map<StdString, ETranformationType>(); 
     30   std::map<StdString, ETranformationType> *CScalar::transformationMapList_ptr = 0; 
    3031   //bool CScalar::dummyTransformationMapList_ = CScalar::initializeTransformationMap(CScalar::transformationMapList_); 
    31  
    32    std::map<StdString, ETranformationType> *CScalar::transformationMapList_ptr = 0; 
    33     
    3432   bool CScalar::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 
    3533   { 
     
    175173 
    176174        nodeElementName = node.getElementName(); 
     175        //std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_.end(), it; 
    177176        if(CScalar::transformationMapList_ptr == 0) initializeTransformationMap(); 
    178         std::map<StdString, ETranformationType>::const_iterator ite = (*CScalar::transformationMapList_ptr).end(), it; 
    179         it = (*CScalar::transformationMapList_ptr).find(nodeElementName); 
     177        std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_ptr->end(), it; 
     178        //it = transformationMapList_.find(nodeElementName); 
     179        it = transformationMapList_ptr->find(nodeElementName); 
    180180        if (ite != it) 
    181181        { 
  • XIOS/dev/branch_openmp/src/node/scalar.hpp

    r1134 r1328  
    8888           static bool initializeTransformationMap(std::map<StdString, ETranformationType>& m); 
    8989           static bool initializeTransformationMap(); 
    90             
    91            //static bool dummyTransformationMapList_; 
    92  
     90           //static std::map<StdString, ETranformationType> transformationMapList_; 
    9391           static std::map<StdString, ETranformationType> *transformationMapList_ptr; 
    94            #pragma omp threadprivate(transformationMapList_ptr) 
     92           static bool dummyTransformationMapList_; 
    9593 
    9694 
  • XIOS/dev/branch_openmp/src/node/transformation.hpp

    r1138 r1328  
    3535      typedef std::map<ETranformationType, CreateTransformationCallBack> CallBackMap; 
    3636      static CallBackMap* transformationCreationCallBacks_; 
    37       //#pragma omp threadprivate(transformationCreationCallBacks_) 
    3837 
    3938      static bool registerTransformation(ETranformationType transType, CreateTransformationCallBack createFn); 
     
    6665    if (0 == transformationCreationCallBacks_) 
    6766      transformationCreationCallBacks_ = new CallBackMap(); 
     67 
    6868    return (*transformationCreationCallBacks_).insert(make_pair(transType, createFn)).second; 
    6969  } 
  • XIOS/dev/branch_openmp/src/node/zoom_axis.hpp

    r1134 r1328  
    6060      static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node); 
    6161      static bool _dummyRegistered; 
    62       #pragma omp threadprivate(_dummyRegistered) 
    6362  }; // class CZoomAxis 
    6463 
  • XIOS/dev/branch_openmp/src/node/zoom_domain.hpp

    r1134 r1328  
    6060      static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node); 
    6161      static bool _dummyRegistered; 
    62       #pragma omp threadprivate(_dummyRegistered) 
    63        
    6462  }; // class CZoomDomain 
    6563 
Note: See TracChangeset for help on using the changeset viewer.