Changeset 2386 for XIOS3/trunk/src/node/domain.cpp
- Timestamp:
- 07/26/22 15:26:52 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk/src/node/domain.cpp
r2343 r2386 1770 1770 CATCH_DUMP_ATTR 1771 1771 1772 int CDomain::computeAttributesHash( MPI_Comm comm ) 1773 { 1774 int domain_hash = 0; 1775 1776 // Compute the hash of distributed attributs (value ...) 1777 int globalSize = this->ni_glo.getValue()*this->nj_glo.getValue(); 1778 CArray<size_t,1> globalIndex; // No redundancy globalIndex will be computed with the connector 1779 shared_ptr<CGridTransformConnector> gridTransformConnector; 1780 // Compute a without redundancy element FULL view to enable a consistent hash computation 1781 this->getLocalView(CElementView::FULL)->createWithoutRedundancyFullViewConnector( globalSize, comm, gridTransformConnector, globalIndex ); 1782 int localSize = globalIndex.numElements(); 1783 1784 CArray<double,1> lon_distributedValue, lat_distributedValue ; 1785 gridTransformConnector->transfer(this->lonvalue, lon_distributedValue ); 1786 gridTransformConnector->transfer(this->latvalue, lat_distributedValue ); 1787 1788 // Compute the distributed hash (v0) of the element 1789 // it will be associated to the default element name (= map key), and to the name really written 1790 int localHash = 0; 1791 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 ); 1794 1795 // Compute the hash of global attributs (unit, prec ...) 1796 vector<StdString> excludedAttr; 1797 //excludedAttr.push_back("name"); 1798 // internal attributs 1799 excludedAttr.insert(excludedAttr.end(), { "ibegin", "jbegin", "ni", "nj", "i_index", "j_index" }); 1800 excludedAttr.insert(excludedAttr.end(), { "data_ni", "data_nj", "data_ibegin", "data_jbegin" }); 1801 excludedAttr.insert(excludedAttr.end(), { "data_i_index", "data_j_index", "domain_ref" }); 1802 // in distributed through lonvalue and latvalue 1803 excludedAttr.insert(excludedAttr.end(), { "lonvalue_1d", "latvalue_1d", "lonvalue_2d", "latvalue_2d" }); 1804 // should be considered in distributed 1805 excludedAttr.insert(excludedAttr.end(), { "mask_1d", "mask_2d" }); // ??? 1806 excludedAttr.insert(excludedAttr.end(), { "bounds_lon_1d", "bounds_lat_1d", "bounds_lon_2d", "bounds_lat_2d" }); 1807 excludedAttr.insert(excludedAttr.end(), { "area" }); 1808 // private 1809 excludedAttr.insert(excludedAttr.end(), { "lon_start", "lon_end", "lat_start", "lat_end" }); 1810 excludedAttr.insert(excludedAttr.end(), { "bounds_lon_start", "bounds_lon_end", "bounds_lat_start", "bounds_lat_end" }); 1811 excludedAttr.insert(excludedAttr.end(), { "has_lat_in_read_file", "has_lon_in_read_file", "has_bounds_lat_in_read_file", "has_bounds_lon_in_read_file" }); 1812 excludedAttr.insert(excludedAttr.end(), { "lonvalue_rectilinear_read_from_file", "latvalue_rectilinear_read_from_file", "lonvalue_curvilinear_read_from_file", "latvalue_curvilinear_read_from_file" }); 1813 excludedAttr.insert(excludedAttr.end(), { "bounds_lonvalue_curvilinear_read_from_file", "bounds_latvalue_curvilinear_read_from_file", "lonvalue_unstructured_read_from_file", "latvalue_unstructured_read_from_file" }); 1814 excludedAttr.insert(excludedAttr.end(), { "bounds_lonvalue_unstructured_read_from_file", "bounds_latvalue_unstructured_read_from_file" }); 1815 1816 int globalHash = this->computeGlobalAttributesHash( excludedAttr ); 1817 1818 return distributedHash + globalHash; 1819 } 1772 1820 1773 1821 void CDomain::initializeLocalElement(void)
Note: See TracChangeset
for help on using the changeset viewer.