Skip to content
  • Mark OLESEN's avatar
    ENH: improved UPstream gather/scatter functionality · 5eebc758
    Mark OLESEN authored
    - added UPstream::allGatherValues() with a direct call to MPI_Allgather.
      This enables possible benefit from a variety of internal algorithms
      and simplifies the caller
    
        Old:
            labelList nPerProc
            (
                UPstream::listGatherValues<label>(patch_.size(), myComm)
            );
            Pstream::broadcast(nPerProc, myComm);
    
        New:
    
            const labelList nPerProc
            (
                UPstream::allGatherValues<label>(patch_.size(), myComm)
            );
    
    - Pstream::allGatherList uses MPI_Allgather for contiguous values
      instead of the hand-rolled tree walking involved with
      gatherList/scatterList.
    
    -
    - simplified the calling parameters for mpiGather/mpiScatter.
    
      Since send/recv data types are identical, the send/recv count
      is also always identical. Eliminates the possibility of any
      discrepancies.
    
      Since this is a low-level call, it does not affect much code.
      Currently just Foam::profilingPstream and a UPstream internal.
    
    BUG: call to MPI_Allgather had hard-coded MPI_BYTE (not the data type)
    
    - a latent bug since it is currently only passed char data anyhow
    5eebc758