Changeset 2613 for XIOS3/trunk/src/node
- Timestamp:
- 03/08/24 17:05:40 (4 months ago)
- Location:
- XIOS3/trunk/src/node
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk/src/node/axis.cpp
r2606 r2613 310 310 int sz(1); 311 311 MPI_Comm_size( comm, &sz ); 312 size_tdistributedHash = 0;312 unsigned long long distributedHash = 0; 313 313 if (sz!=1) // compute the connector only if the element is distributed 314 314 { … … 324 324 gridTransformConnector->transfer(this->value, distributedValue ); 325 325 326 size_tlocalHash = 0;327 for (int iloc=0; iloc<localSize ; iloc++ ) localHash+= globalIndex(iloc)*distributedValue(iloc);326 unsigned long long localHash = 0; 327 for (int iloc=0; iloc<localSize ; iloc++ ) localHash+=((unsigned long long)(abs(globalIndex(iloc)*distributedValue(iloc))))%LLONG_MAX; 328 328 distributedHash = 0; 329 MPI_Allreduce( &localHash, &distributedHash, 1, MPI_UNSIGNED_LONG , MPI_SUM, comm );329 MPI_Allreduce( &localHash, &distributedHash, 1, MPI_UNSIGNED_LONG_LONG, MPI_SUM, comm ); 330 330 } 331 331 else // if the element is not distributed, the local hash is valid … … 333 333 int globalSize = this->n_glo.getValue(); 334 334 int localSize = globalSize; 335 size_tlocalHash = 0;336 for (int iloc=0; iloc<localSize ; iloc++ ) localHash+= iloc*this->value(iloc);335 unsigned long long localHash = 0; 336 for (int iloc=0; iloc<localSize ; iloc++ ) localHash+=((unsigned long long)(abs(iloc*this->value(iloc))))%LLONG_MAX; 337 337 distributedHash = localHash; 338 338 } -
XIOS3/trunk/src/node/domain.cpp
r2606 r2613 1809 1809 int sz(1); 1810 1810 MPI_Comm_size( comm, &sz ); 1811 size_tdistributedHash = 0;1811 unsigned long long distributedHash = 0; 1812 1812 if (sz!=1) // compute the connector only if the element is distributed 1813 1813 { … … 1826 1826 // Compute the distributed hash (v0) of the element 1827 1827 // it will be associated to the default element name (= map key), and to the name really written 1828 size_t localHash = 0; 1829 for (int iloc=0; iloc<localSize ; iloc++ ) localHash+=globalIndex(iloc)*lon_distributedValue(iloc)*lat_distributedValue(iloc); 1828 unsigned long long localHash = 0; 1829 for (int iloc=0; iloc<localSize ; iloc++ ) 1830 { 1831 localHash+=((unsigned long long)(abs(globalIndex(iloc)*lon_distributedValue(iloc)*lat_distributedValue(iloc))))%LLONG_MAX; 1832 } 1830 1833 distributedHash = 0; 1831 MPI_Allreduce( &localHash, &distributedHash, 1, MPI_UNSIGNED_LONG , MPI_SUM, comm );1834 MPI_Allreduce( &localHash, &distributedHash, 1, MPI_UNSIGNED_LONG_LONG, MPI_SUM, comm ); 1832 1835 } 1833 1836 else // if the element is not distributed, the local hash is valid … … 1835 1838 int globalSize = this->ni_glo.getValue()*this->nj_glo.getValue(); 1836 1839 int localSize = globalSize; 1837 size_tlocalHash = 0;1838 for (int iloc=0; iloc<localSize ; iloc++ ) localHash+= iloc*this->lonvalue(iloc)*this->latvalue(iloc);1840 unsigned long long localHash = 0; 1841 for (int iloc=0; iloc<localSize ; iloc++ ) localHash+=((unsigned long long)(abs(iloc*this->lonvalue(iloc)*this->latvalue(iloc))))%LLONG_MAX; 1839 1842 distributedHash = localHash; 1840 1843 }
Note: See TracChangeset
for help on using the changeset viewer.