mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
UPstream: Added const_cast for OpenMPI versions < 1.7.4
Note
The const_cast used in this file is a temporary hack for to work around
bugs in OpenMPI for versions < 1.7.4
This commit is contained in:
@ -21,6 +21,10 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Note
|
||||
The const_cast used in this file is a temporary hack for to work around
|
||||
bugs in OpenMPI for versions < 1.7.4
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "UPstream.H"
|
||||
@ -332,8 +336,6 @@ void Foam::UPstream::allToAll
|
||||
(
|
||||
MPI_Alltoall
|
||||
(
|
||||
// NOTE: const_cast is a temporary hack for
|
||||
// backward-compatibility with versions of OpenMPI < 1.7.4
|
||||
const_cast<label*>(sendData.begin()),
|
||||
sizeof(label),
|
||||
MPI_BYTE,
|
||||
@ -403,13 +405,13 @@ void Foam::UPstream::allToAll
|
||||
(
|
||||
MPI_Alltoallv
|
||||
(
|
||||
sendData,
|
||||
sendSizes.begin(),
|
||||
sendOffsets.begin(),
|
||||
const_cast<char*>(sendData),
|
||||
const_cast<int*>(sendSizes.begin()),
|
||||
const_cast<int*>(sendOffsets.begin()),
|
||||
MPI_BYTE,
|
||||
recvData,
|
||||
recvSizes.begin(),
|
||||
recvOffsets.begin(),
|
||||
const_cast<int*>(recvSizes.begin()),
|
||||
const_cast<int*>(recvOffsets.begin()),
|
||||
MPI_BYTE,
|
||||
PstreamGlobals::MPICommunicators_[communicator]
|
||||
)
|
||||
@ -465,12 +467,12 @@ void Foam::UPstream::gather
|
||||
(
|
||||
MPI_Gatherv
|
||||
(
|
||||
sendData,
|
||||
const_cast<char*>(sendData),
|
||||
sendSize,
|
||||
MPI_BYTE,
|
||||
recvData,
|
||||
recvSizes.begin(),
|
||||
recvOffsets.begin(),
|
||||
const_cast<int*>(recvSizes.begin()),
|
||||
const_cast<int*>(recvOffsets.begin()),
|
||||
MPI_BYTE,
|
||||
0,
|
||||
MPI_Comm(PstreamGlobals::MPICommunicators_[communicator])
|
||||
@ -524,9 +526,9 @@ void Foam::UPstream::scatter
|
||||
(
|
||||
MPI_Scatterv
|
||||
(
|
||||
sendData,
|
||||
sendSizes.begin(),
|
||||
sendOffsets.begin(),
|
||||
const_cast<char*>(sendData),
|
||||
const_cast<int*>(sendSizes.begin()),
|
||||
const_cast<int*>(sendOffsets.begin()),
|
||||
MPI_BYTE,
|
||||
recvData,
|
||||
recvSize,
|
||||
|
||||
Reference in New Issue
Block a user