Ignore:
Timestamp:
03/08/24 17:05:40 (4 months ago)
Author:
jderouillat
Message:

Fix the attached mode for scalar output, and some bugs revealed by the adastra porting in debug mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/node/axis.cpp

    r2606 r2613  
    310310     int sz(1); 
    311311     MPI_Comm_size( comm, &sz ); 
    312      size_t distributedHash = 0; 
     312     unsigned long long distributedHash = 0; 
    313313     if (sz!=1) // compute the connector only if the element is distributed 
    314314     { 
     
    324324       gridTransformConnector->transfer(this->value, distributedValue ); 
    325325           
    326        size_t localHash = 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; 
    328328       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  ); 
    330330     } 
    331331     else // if the element is not distributed, the local hash is valid 
     
    333333       int globalSize = this->n_glo.getValue(); 
    334334       int localSize = globalSize; 
    335        size_t localHash = 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; 
    337337       distributedHash = localHash; 
    338338     } 
Note: See TracChangeset for help on using the changeset viewer.