Changeset 2388


Ignore:
Timestamp:
07/27/22 09:47:30 (2 years ago)
Author:
jderouillat
Message:

Manage hash values with size_t in hash tables of elements associated to output files

Location:
XIOS3/trunk/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/attribute.hpp

    r2386 r2388  
    4444            virtual StdString dumpGraph(void) const = 0; 
    4545            virtual bool isEqual(const CAttribute& ) = 0; 
    46             virtual int computeHash(void) = 0; 
     46            virtual size_t computeHash(void) = 0; 
    4747 
    4848            //! Returns true if and only if the attribute should be publicly exposed in the API 
  • XIOS3/trunk/src/attribute_array.hpp

    r2386 r2388  
    4444                         
    4545            bool isEqual(const CAttribute& attr); 
    46             int computeHash(void); 
     46            size_t computeHash(void); 
    4747 
    4848            /// Destructeur /// 
  • XIOS3/trunk/src/attribute_array_impl.hpp

    r2386 r2388  
    119119   
    120120    template <typename T_numtype, int N_rank> 
    121     int CAttributeArray<T_numtype,N_rank>::computeHash(void) 
     121    size_t CAttributeArray<T_numtype,N_rank>::computeHash(void) 
    122122    { 
    123123      ERROR("CAttributeArray::computeHash(void)", 
  • XIOS3/trunk/src/attribute_enum.hpp

    r2386 r2388  
    5252             
    5353            bool isEqual(const CAttribute& attr ); 
    54             int computeHash(void); 
     54            size_t computeHash(void); 
    5555 
    5656            /// Destructeur /// 
  • XIOS3/trunk/src/attribute_enum_impl.hpp

    r2386 r2388  
    127127 
    128128  template <class T> 
    129   int CAttributeEnum<T>::computeHash(void) 
     129  size_t CAttributeEnum<T>::computeHash(void) 
    130130  { 
    131131    // Basic hash computation through string 
  • XIOS3/trunk/src/attribute_map.cpp

    r2386 r2388  
    273273        \param [in] excludedAttrs attribute to be excluded from hash computation 
    274274      */ 
    275       int CAttributeMap::computeGlobalAttributesHash(const vector<StdString>& excludedAttrs) 
    276       { 
    277          int attrs_hash( 0 ); 
     275      size_t CAttributeMap::computeGlobalAttributesHash(const vector<StdString>& excludedAttrs) 
     276      { 
     277         size_t attrs_hash( 0 ); 
    278278         typedef std::pair<StdString, CAttribute*> StdStrAttPair; 
    279279 
  • XIOS3/trunk/src/attribute_map.hpp

    r2386 r2388  
    3737            void setAttributes(const CAttributeMap * const _parent, bool apply=true); 
    3838            void duplicateAttributes(const CAttributeMap* const _parent); 
    39             int computeGlobalAttributesHash(const vector<StdString>& excludedAttrs); 
     39            size_t computeGlobalAttributesHash(const vector<StdString>& excludedAttrs); 
    4040            void clearAllAttributes(void); 
    4141            StdString dumpXiosAttributes(void) const; 
  • XIOS3/trunk/src/attribute_template.hpp

    r2386 r2388  
    6161             
    6262            bool isEqual(const CAttribute& attr ); 
    63             int computeHash(void); 
     63            size_t computeHash(void); 
    6464 
    6565            /// Destructeur /// 
  • XIOS3/trunk/src/attribute_template_impl.hpp

    r2386 r2388  
    171171 
    172172    template <class T> 
    173     int CAttributeTemplate<T>::computeHash(void) 
     173    size_t CAttributeTemplate<T>::computeHash(void) 
    174174    { 
    175175      // Basic hash computation through string 
  • XIOS3/trunk/src/io/nc4_data_output.hpp

    r2384 r2388  
    129129            bool hasTimeCentered ; 
    130130         
    131             std::multimap< StdString, pair<int,StdString> > relElements_; 
    132             std::multimap< StdString, pair<int,CDomain*> > relDomains_; 
     131            std::multimap< StdString, pair<size_t,StdString> > relElements_; 
     132            std::multimap< StdString, pair<size_t,CDomain*> > relDomains_; 
    133133 
    134134      }; // class CNc4DataOutput 
  • XIOS3/trunk/src/node/axis.cpp

    r2386 r2388  
    304304   } 
    305305 
    306    int CAxis::computeAttributesHash( MPI_Comm comm ) 
    307    { 
    308      int axis_hash = 0; 
    309       
     306   size_t CAxis::computeAttributesHash( MPI_Comm comm ) 
     307   { 
    310308     // Compute the hash of distributed attributs (value ...) 
    311309     int globalSize = this->n_glo.getValue(); 
     
    319317     gridTransformConnector->transfer(this->value, distributedValue ); 
    320318         
    321      int localHash = 0; 
     319     size_t localHash = 0; 
    322320     for (int iloc=0; iloc<localSize ; iloc++ ) localHash+=globalIndex(iloc)*distributedValue(iloc); 
    323      int distributedHash = 0; 
    324      MPI_Allreduce( &localHash, &distributedHash, 1, MPI_INT, MPI_SUM, comm  ); 
     321     size_t distributedHash = 0; 
     322     MPI_Allreduce( &localHash, &distributedHash, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm  ); 
    325323 
    326324     // Compute the hash of global attributs (unit, prec ...) 
     
    338336     excludedAttr.push_back("mask"); // ??? 
    339337 
    340      int globalHash = this->computeGlobalAttributesHash( excludedAttr ); 
     338     size_t globalHash = this->computeGlobalAttributesHash( excludedAttr ); 
    341339 
    342340     return distributedHash + globalHash; 
  • XIOS3/trunk/src/node/axis.hpp

    r2386 r2388  
    130130         void resetGeometricAttributes(void) ; 
    131131 
    132          int computeAttributesHash( MPI_Comm comm ); 
     132         size_t computeAttributesHash( MPI_Comm comm ); 
    133133 
    134134         size_t getGlobalWrittenSize(void) ; 
  • XIOS3/trunk/src/node/domain.cpp

    r2386 r2388  
    17701770   CATCH_DUMP_ATTR 
    17711771 
    1772    int CDomain::computeAttributesHash( MPI_Comm comm ) 
    1773    { 
    1774      int domain_hash = 0; 
    1775       
     1772   size_t CDomain::computeAttributesHash( MPI_Comm comm ) 
     1773   { 
    17761774     // Compute the hash of distributed attributs (value ...) 
    17771775     int globalSize = this->ni_glo.getValue()*this->nj_glo.getValue(); 
     
    17881786     // Compute the distributed hash (v0) of the element 
    17891787     // it will be associated to the default element name (= map key), and to the name really written 
    1790      int localHash = 0; 
     1788     size_t localHash = 0; 
    17911789     for (int iloc=0; iloc<localSize ; iloc++ ) localHash+=globalIndex(iloc)*lon_distributedValue(iloc)*lat_distributedValue(iloc); 
    1792      int distributedHash = 0; 
    1793      MPI_Allreduce( &localHash, &distributedHash, 1, MPI_INT, MPI_SUM, comm  ); 
     1790     size_t distributedHash = 0; 
     1791     MPI_Allreduce( &localHash, &distributedHash, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm  ); 
    17941792      
    17951793     // Compute the hash of global attributs (unit, prec ...) 
     
    18141812     excludedAttr.insert(excludedAttr.end(), { "bounds_lonvalue_unstructured_read_from_file", "bounds_latvalue_unstructured_read_from_file" }); 
    18151813      
    1816      int globalHash = this->computeGlobalAttributesHash( excludedAttr ); 
     1814     size_t globalHash = this->computeGlobalAttributesHash( excludedAttr ); 
    18171815 
    18181816     return distributedHash + globalHash; 
  • XIOS3/trunk/src/node/domain.hpp

    r2386 r2388  
    9191         bool checkAttributes_done_ = false ; 
    9292 
    93          int computeAttributesHash( MPI_Comm comm ); 
     93         size_t computeAttributesHash( MPI_Comm comm ); 
    9494          
    9595      ////////////////////////// 
Note: See TracChangeset for help on using the changeset viewer.