ENH: use List containers for Pstream read/write calls

- using the List containers, and not their low-level data_bytes(),
  size_bytes() methods is more convenient and allows future
  adjustments to be centralized

ENH: trivial intptr_t wrapper for MPI_Win

STYLE: minor adjustments to mpirunDebug
This commit is contained in:
Mark Olesen 2025-01-30 09:27:06 +01:00
parent 0adc745b50
commit 0ba4f36c60
32 changed files with 461 additions and 190 deletions

View File

@ -24,7 +24,6 @@
. "${WM_PROJECT_DIR:?}"/bin/tools/RunFunctions # Run functions
printHelp() {
exec 1>&2
cat<<USAGE
Usage: ${0##*/} [OPTION] -np <N> <executable> <args>
@ -203,7 +202,7 @@ do
# Processing application arguments
case "$1" in
(-help* | --help*) usage ;;
(-help* | --help*) printHelp ;;
('') ;; ## Ignore junk
(-np)
@ -235,15 +234,16 @@ done
# Cleanup only
if [ -n "$optClean" ]
then
echo "Cleanup old mpirunDebug files..." 1>&2
rm -f gdbCommands mpirun.schema
rm -rf mpirun.log mpirun.files
exec 1>&2
echo "Cleanup old mpirunDebug files..."
rm -f gdbCommands mpirun.schema vgcore.*
rm -f processor*.log processor*.sh
echo " gdbCommands mpirun.schema" 1>&2
echo " mpirun.{files,log}/" 1>&2
echo " processor*.{log,sh}" 1>&2
echo "Done" 1>&2
exit 0
rm -rf mpirun.log mpirun.files
echo " gdbCommands mpirun.schema vgcore.*"
echo " processor*.{log,sh}"
echo " mpirun.{files,log}/"
echo "Done"
exit 0 # A clean exit
fi
@ -344,12 +344,15 @@ esac
echo "**sourceFoam: $sourceFoam" 1>&2
rm -f ./mpirun.schema
touch ./mpirun.schema
mkdir -p ./mpirun.files
mkdir -p ./mpirun.log
schema_file="$PWD/mpirun.files/mpirun.schema"
rm -f "$schema_file"
touch "$schema_file"
proc=0
xpos=0
ypos=0
@ -374,8 +377,8 @@ COMMANDS
# Add to the mpirun.schema
case "$method" in
(*xterm*) echo "${node}${xterm} -e ${procCmdFile}" >> "$PWD"/mpirun.schema ;;
(*) echo "${node}${procCmdFile}" >> "$PWD"/mpirun.schema ;;
(*xterm*) echo "${node}${xterm} -e ${procCmdFile}" >> "$schema_file" ;;
(*) echo "${node}${procCmdFile}" >> "$schema_file" ;;
esac
case "$method" in
@ -421,17 +424,33 @@ COMMANDS
fi
done
for ((proc=0; proc<$nProcs; proc++))
do
procLog="mpirun.log/processor${proc}.log"
echo " tail -f $procLog" 1>&2
done
if [ "$nProcs" -lt 10 ]
then
for ((proc = 0; proc < $nProcs; proc++))
do
procLog="mpirun.log/processor${proc}.log"
echo " tail -f $procLog" 1>&2
done
else
for ((proc = 0; proc < 4; proc++))
do
procLog="mpirun.log/processor${proc}.log"
echo " tail -f $procLog" 1>&2
done
echo " ..." 1>&2
for ((proc = $nProcs-2; proc < $nProcs; proc++))
do
procLog="mpirun.log/processor${proc}.log"
echo " tail -f $procLog" 1>&2
done
fi
unset cmd
case "$WM_MPLIB" in
*OPENMPI*)
cmd="mpirun --oversubscribe -app $PWD/mpirun.schema </dev/null"
cmd="mpirun --oversubscribe -app "$schema_file" </dev/null"
;;
MPICH)
cmd="mpiexec"
@ -448,7 +467,7 @@ MPICH)
cmd="${cmd} :"
fi
cmd="${cmd} -n 1 ${procXtermCmdFile}"
done < "$PWD"/mpirun.schema
done < "$schema_file"
;;
*)
die "Unsupported WM_MPLIB setting : $WM_MPLIB"
@ -456,7 +475,7 @@ MPICH)
esac
echo 1>&2
echo "Constructed $PWD/mpirun.schema file:" 1>&2
echo "Constructed $schema_file file:" 1>&2
echo 1>&2
echo " $cmd" 1>&2
echo 1>&2

View File

@ -182,8 +182,7 @@ void Foam::Pstream::listCombineGather
(
UPstream::commsTypes::scheduled,
belowID,
received.data_bytes(),
received.size_bytes(),
received,
tag,
comm
);
@ -239,8 +238,7 @@ void Foam::Pstream::listCombineGather
(
UPstream::commsTypes::scheduled,
myComm.above(),
values.cdata_bytes(),
values.size_bytes(),
values,
tag,
comm
);

View File

@ -80,8 +80,7 @@ void Foam::Pstream::gatherList
(
UPstream::commsTypes::scheduled,
belowID,
received.data_bytes(),
received.size_bytes(),
received,
tag,
comm
);
@ -155,8 +154,7 @@ void Foam::Pstream::gatherList
(
UPstream::commsTypes::scheduled,
myComm.above(),
sending.cdata_bytes(),
sending.size_bytes(),
sending,
tag,
comm
);
@ -231,8 +229,7 @@ void Foam::Pstream::scatterList
(
UPstream::commsTypes::scheduled,
myComm.above(),
received.data_bytes(),
received.size_bytes(),
received,
tag,
comm
);
@ -286,8 +283,7 @@ void Foam::Pstream::scatterList
(
UPstream::commsTypes::scheduled,
belowID,
sending.cdata_bytes(),
sending.size_bytes(),
sending,
tag,
comm
);

View File

@ -94,7 +94,7 @@ static List<int> getHostGroupIds(const label parentCommunicator)
(
myDigest.cdata_bytes(), // Send
digests.data_bytes(), // Recv
SHA1Digest::max_size(), // Num send/recv data per rank
SHA1Digest::size_bytes(), // Num send/recv data per rank
parentCommunicator
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2024 OpenCFD Ltd.
Copyright (C) 2015-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -99,6 +99,9 @@ public:
//- Wrapper for MPI_Request
class Request; // Forward Declaration
//- Wrapper for MPI_Win
class Window; // Forward Declaration
//- Structure for communicating between processors
class commsStruct
{
@ -1462,6 +1465,12 @@ UList<UPstream::commsStruct>::operator[](const label procID) const;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Traits, nested classes etc
#include "UPstreamTraits.H"
#include "UPstreamWindow.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "UPstreamTemplates.C"
#endif

View File

@ -0,0 +1,46 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
A set of traits associated with UPstream communication
SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef Foam_UPstreamTraits_H
#define Foam_UPstreamTraits_H
#include "UPstream.H"
#include <cstdint>
#include <ios> // For streamsize
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,152 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::UPstream::Window
Description
An opaque wrapper for MPI_Win with a vendor-independent
representation and without any \c <mpi.h> header dependency.
Note
The MPI standard states that MPI_Win is always an opaque object.
Generally it is either an integer (eg, mpich) or a pointer (eg, openmpi).
SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef Foam_UPstreamWindow_H
#define Foam_UPstreamWindow_H
#include "UPstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class UPstream::Window Declaration
\*---------------------------------------------------------------------------*/
class UPstream::Window
{
public:
// Public Types
//- Storage for MPI_Win (as integer or pointer)
typedef std::intptr_t value_type;
private:
// Private Data
//- The MPI_Win (as wrapped value)
value_type value_;
public:
// Generated Methods
//- Copy construct
Window(const Window&) noexcept = default;
//- Move construct
Window(Window&&) noexcept = default;
//- Copy assignment
Window& operator=(const Window&) noexcept = default;
//- Move assignment
Window& operator=(Window&&) noexcept = default;
// Member Operators
//- Test for equality
bool operator==(const Window& rhs) const noexcept
{
return (value_ == rhs.value_);
}
//- Test for inequality
bool operator!=(const Window& rhs) const noexcept
{
return (value_ != rhs.value_);
}
// Constructors
//- Default construct as MPI_WIN_NULL
Window() noexcept;
//- Construct from MPI_Win (as pointer type)
explicit Window(const void* p) noexcept
:
value_(reinterpret_cast<value_type>(p))
{}
//- Construct from MPI_Win (as integer type)
explicit Window(value_type val) noexcept
:
value_(val)
{}
// Member Functions
// Basic handling
//- Return raw value
value_type value() const noexcept { return value_; }
//- Return as pointer value
const void* pointer() const noexcept
{
return reinterpret_cast<const void*>(value_);
}
//- True if not equal to MPI_WIN_NULL
bool good() const noexcept;
//- Reset to default constructed value (MPI_WIN_NULL)
void reset() noexcept;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020-2023 OpenCFD Ltd.
Copyright (C) 2020-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -113,8 +113,7 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
(
commsType,
procPatch_.neighbProcNo(),
recvBuf_.data_bytes(),
recvBuf_.size_bytes(),
recvBuf_,
procPatch_.tag(),
procPatch_.comm()
);
@ -123,8 +122,7 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
(
commsType,
procPatch_.neighbProcNo(),
sendBuf_.cdata_bytes(),
sendBuf_.size_bytes(),
sendBuf_,
procPatch_.tag(),
procPatch_.comm()
);
@ -150,8 +148,7 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
(
commsType,
procPatch_.neighbProcNo(),
recvBuf_.data_bytes(),
recvBuf_.size_bytes(),
recvBuf_,
procPatch_.tag(),
procPatch_.comm()
);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022-2023 OpenCFD Ltd.
Copyright (C) 2022-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -126,7 +126,7 @@ Foam::labelList Foam::fileOperation::getGlobalHostIORanks()
(
myDigest.cdata_bytes(), // Send
digests.data_bytes(), // Recv
SHA1Digest::max_size(), // Num send/recv per rank
SHA1Digest::size_bytes(), // Num send/recv per rank
UPstream::worldComm
);

View File

@ -80,6 +80,20 @@ struct Cast
return static_cast<Type>(arg.value());
}
}
//- Cast UPstream::Window to MPI_Win
template<typename Type = MPI_Win>
static Type to_mpi(UPstream::Window arg) noexcept
{
if constexpr (std::is_pointer_v<Type>)
{
return reinterpret_cast<Type>(arg.value());
}
else // std::is_integral_v<Type>
{
return static_cast<Type>(arg.value());
}
}
};

View File

@ -78,8 +78,7 @@ void Foam::LUscalarMatrix::solve
(
UPstream::commsTypes::nonBlocking,
proci,
procSlot.data_bytes(),
procSlot.size_bytes(),
procSlot,
tag,
comm_
);
@ -102,8 +101,7 @@ void Foam::LUscalarMatrix::solve
(
UPstream::commsTypes::nonBlocking,
UPstream::masterNo(),
x.cdata_bytes(),
x.size_bytes(),
x,
tag,
comm_
);
@ -142,8 +140,7 @@ void Foam::LUscalarMatrix::solve
(
UPstream::commsTypes::nonBlocking,
proci,
procSlot.cdata_bytes(),
procSlot.size_bytes(),
procSlot,
tag,
comm_
);
@ -166,8 +163,7 @@ void Foam::LUscalarMatrix::solve
(
UPstream::commsTypes::nonBlocking,
UPstream::masterNo(),
x.data_bytes(),
x.size_bytes(),
x,
tag,
comm_
);

View File

@ -114,8 +114,7 @@ void Foam::lduCalculatedProcessorField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
scalarRecvBuf_.data_bytes(),
scalarRecvBuf_.size_bytes(),
scalarRecvBuf_,
procInterface_.tag(),
procInterface_.comm()
);
@ -125,8 +124,7 @@ void Foam::lduCalculatedProcessorField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
scalarSendBuf_.cdata_bytes(),
scalarSendBuf_.size_bytes(),
scalarSendBuf_,
procInterface_.tag(),
procInterface_.comm()
);

View File

@ -56,8 +56,7 @@ void Foam::processorLduInterface::send
(
commsType,
neighbProcNo(),
fld.cdata_bytes(),
fld.size_bytes(),
fld,
tag(),
comm()
);
@ -133,8 +132,7 @@ void Foam::processorLduInterface::receive
(
commsType,
neighbProcNo(),
fld.data_bytes(),
fld.size_bytes(),
fld,
tag(),
comm()
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2023 OpenCFD Ltd.
Copyright (C) 2019-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -149,8 +149,7 @@ void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
scalarRecvBuf_.data_bytes(),
scalarRecvBuf_.size_bytes(),
scalarRecvBuf_,
procInterface_.tag(),
comm()
);
@ -160,8 +159,7 @@ void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
scalarSendBuf_.cdata_bytes(),
scalarSendBuf_.size_bytes(),
scalarSendBuf_,
procInterface_.tag(),
comm()
);

View File

@ -201,8 +201,7 @@ void Foam::mapDistributeBase::send
(
UPstream::commsTypes::nonBlocking,
proci,
subField.data_bytes(),
subField.size_bytes(),
subField,
tag,
comm
);
@ -244,8 +243,7 @@ void Foam::mapDistributeBase::send
(
UPstream::commsTypes::nonBlocking,
proci,
subField.cdata_bytes(),
subField.size_bytes(),
subField,
tag,
comm
);
@ -778,8 +776,7 @@ void Foam::mapDistributeBase::distribute
(
UPstream::commsTypes::nonBlocking,
proci,
subField.data_bytes(),
subField.size_bytes(),
subField,
tag,
comm
);
@ -806,8 +803,7 @@ void Foam::mapDistributeBase::distribute
(
UPstream::commsTypes::nonBlocking,
proci,
subField.cdata_bytes(),
subField.size_bytes(),
subField,
tag,
comm
);
@ -1218,8 +1214,7 @@ void Foam::mapDistributeBase::distribute
(
UPstream::commsTypes::nonBlocking,
proci,
subField.data_bytes(),
subField.size_bytes(),
subField,
tag,
comm
);
@ -1246,8 +1241,7 @@ void Foam::mapDistributeBase::distribute
(
UPstream::commsTypes::nonBlocking,
proci,
subField.cdata_bytes(),
subField.size_bytes(),
subField,
tag,
comm
);

View File

@ -1086,8 +1086,7 @@ void Foam::syncTools::syncBoundaryFaceList
(
UPstream::commsTypes::nonBlocking,
procPatch.neighbProcNo(),
fld.data_bytes(),
fld.size_bytes()
fld
);
}
}
@ -1112,8 +1111,7 @@ void Foam::syncTools::syncBoundaryFaceList
(
UPstream::commsTypes::nonBlocking,
procPatch.neighbProcNo(),
fld.cdata_bytes(),
fld.size_bytes()
fld
);
}
}

View File

@ -259,8 +259,7 @@ void Foam::globalIndex::gather
(
commsType,
procIDs[i],
procSlot.data_bytes(),
procSlot.size_bytes(),
procSlot,
tag,
comm
);
@ -283,8 +282,7 @@ void Foam::globalIndex::gather
(
commsType,
masterProci,
fld.cdata_bytes(),
fld.size_bytes(),
fld,
tag,
comm
);
@ -948,8 +946,7 @@ void Foam::globalIndex::scatter
(
commsType,
procIDs[i],
procSlot.cdata_bytes(),
procSlot.size_bytes(),
procSlot,
tag,
comm
);
@ -984,8 +981,7 @@ void Foam::globalIndex::scatter
(
commsType,
masterProci,
fld.data_bytes(),
fld.size_bytes(),
fld,
tag,
comm
);

View File

@ -5,6 +5,7 @@ UPstreamCommunicator.C
UPstreamGatherScatter.C
UPstreamReduce.C
UPstreamRequest.C
UPstreamWindow.C
UIPstreamRead.C
UOPstreamWrite.C

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "UPstream.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::UPstream::Window::Window() noexcept
:
UPstream::Window(nullptr)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::UPstream::Window::good() const noexcept
{
return false;
}
void Foam::UPstream::Window::reset() noexcept
{}
// ************************************************************************* //

View File

@ -6,6 +6,7 @@ UPstreamCommunicator.C
UPstreamGatherScatter.C
UPstreamReduce.C
UPstreamRequest.C
UPstreamWindow.C
UIPstreamRead.C
UOPstreamWrite.C

View File

@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "PstreamGlobals.H"
#include "profilingPstream.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::UPstream::Window::Window() noexcept
:
UPstream::Window(MPI_WIN_NULL)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::UPstream::Window::good() const noexcept
{
return MPI_WIN_NULL != PstreamUtils::Cast::to_mpi(*this);
}
void Foam::UPstream::Window::reset() noexcept
{
*this = UPstream::Window(MPI_WIN_NULL);
}
// ************************************************************************* //

View File

@ -217,8 +217,7 @@ void Foam::ensightOutput::Detail::writeFieldComponents
(
UPstream::commsTypes::scheduled,
proci,
slot.data_bytes(),
slot.size_bytes()
slot
);
}
}
@ -244,8 +243,7 @@ void Foam::ensightOutput::Detail::writeFieldComponents
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
scratch.cdata_bytes(),
scratch.size_bytes()
scratch
);
}
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2016-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -155,8 +155,7 @@ void Foam::vtk::writeListParallel
(
UPstream::commsTypes::scheduled,
proci,
recvData.data_bytes(),
recvData.size_bytes()
recvData
);
// With value offset
@ -176,8 +175,7 @@ void Foam::vtk::writeListParallel
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
values.cdata_bytes(),
values.size_bytes()
values
);
}
}

View File

@ -193,8 +193,7 @@ void Foam::vtk::writeListParallel
(
UPstream::commsTypes::scheduled,
proci,
recvData.data_bytes(),
recvData.size_bytes()
recvData
);
vtk::writeList(fmt, recvData);
}
@ -208,8 +207,7 @@ void Foam::vtk::writeListParallel
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
values.cdata_bytes(),
values.size_bytes()
values
);
}
}
@ -262,8 +260,7 @@ void Foam::vtk::writeListParallel
(
UPstream::commsTypes::scheduled,
proci,
recvData.data_bytes(),
recvData.size_bytes()
recvData
);
vtk::writeList(fmt, recvData);
}
@ -277,8 +274,7 @@ void Foam::vtk::writeListParallel
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
sendData.cdata_bytes(),
sendData.size_bytes()
sendData
);
}
}
@ -332,8 +328,7 @@ void Foam::vtk::writeListParallel
(
UPstream::commsTypes::scheduled,
proci,
recvData.data_bytes(),
recvData.size_bytes()
recvData
);
vtk::writeList(fmt, recvData);
}
@ -347,8 +342,7 @@ void Foam::vtk::writeListParallel
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
sendData.cdata_bytes(),
sendData.size_bytes()
sendData
);
}
}
@ -401,8 +395,7 @@ void Foam::vtk::writeListsParallel
(
UPstream::commsTypes::scheduled,
proci,
recvData.data_bytes(),
recvData.size_bytes()
recvData
);
vtk::writeList(fmt, recvData);
}
@ -417,8 +410,7 @@ void Foam::vtk::writeListsParallel
(
UPstream::commsTypes::scheduled,
proci,
recvData.data_bytes(),
recvData.size_bytes()
recvData
);
vtk::writeList(fmt, recvData);
}
@ -432,8 +424,7 @@ void Foam::vtk::writeListsParallel
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
values1.cdata_bytes(),
values1.size_bytes()
values1
);
}
@ -443,8 +434,7 @@ void Foam::vtk::writeListsParallel
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
values2.cdata_bytes(),
values2.size_bytes()
values2
);
}
}
@ -506,8 +496,7 @@ void Foam::vtk::writeListsParallel
(
UPstream::commsTypes::scheduled,
proci,
recvData.data_bytes(),
recvData.size_bytes()
recvData
);
vtk::writeList(fmt, recvData);
}
@ -522,8 +511,7 @@ void Foam::vtk::writeListsParallel
(
UPstream::commsTypes::scheduled,
proci,
recvData.data_bytes(),
recvData.size_bytes()
recvData
);
vtk::writeList(fmt, recvData);
}
@ -537,8 +525,7 @@ void Foam::vtk::writeListsParallel
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
values1.cdata_bytes(),
values1.size_bytes()
values1
);
}
@ -548,8 +535,7 @@ void Foam::vtk::writeListsParallel
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
sendData2.cdata_bytes(),
sendData2.size_bytes()
sendData2
);
}
}

View File

@ -227,15 +227,15 @@ void Foam::processorFaPatchField<Type>::initEvaluate
}
// Receive straight into *this
this->resize_nocopy(sendBuf_.size());
Field<Type>& self = *this;
self.resize_nocopy(sendBuf_.size());
recvRequest_ = UPstream::nRequests();
UIPstream::read
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
this->data_bytes(),
this->size_bytes(),
self,
procPatch_.tag(),
procPatch_.comm()
);
@ -245,8 +245,7 @@ void Foam::processorFaPatchField<Type>::initEvaluate
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
sendBuf_.cdata_bytes(),
sendBuf_.size_bytes(),
sendBuf_,
procPatch_.tag(),
procPatch_.comm()
);
@ -328,8 +327,7 @@ void Foam::processorFaPatchField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
scalarRecvBuf_.data_bytes(),
scalarRecvBuf_.size_bytes(),
scalarRecvBuf_,
procPatch_.tag(),
procPatch_.comm()
);
@ -339,8 +337,7 @@ void Foam::processorFaPatchField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
scalarSendBuf_.cdata_bytes(),
scalarSendBuf_.size_bytes(),
scalarSendBuf_,
procPatch_.tag(),
procPatch_.comm()
);
@ -434,8 +431,7 @@ void Foam::processorFaPatchField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
recvBuf_.data_bytes(),
recvBuf_.size_bytes(),
recvBuf_,
procPatch_.tag(),
procPatch_.comm()
);
@ -445,8 +441,7 @@ void Foam::processorFaPatchField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
sendBuf_.cdata_bytes(),
sendBuf_.size_bytes(),
sendBuf_,
procPatch_.tag(),
procPatch_.comm()
);

View File

@ -138,15 +138,15 @@ void Foam::calculatedProcessorFvPatchField<Type>::initEvaluate
}
// Receive straight into *this
this->resize_nocopy(sendBuf_.size());
Field<Type>& self = *this;
self.resize_nocopy(sendBuf_.size());
recvRequest_ = UPstream::nRequests();
UIPstream::read
(
UPstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
this->data_bytes(),
this->size_bytes(),
self,
procInterface_.tag(),
procInterface_.comm()
);
@ -156,8 +156,7 @@ void Foam::calculatedProcessorFvPatchField<Type>::initEvaluate
(
UPstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
sendBuf_.cdata_bytes(),
sendBuf_.size_bytes(),
sendBuf_,
procInterface_.tag(),
procInterface_.comm()
);
@ -218,8 +217,7 @@ void Foam::calculatedProcessorFvPatchField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
scalarRecvBuf_.data_bytes(),
scalarRecvBuf_.size_bytes(),
scalarRecvBuf_,
procInterface_.tag(),
procInterface_.comm()
);
@ -229,8 +227,7 @@ void Foam::calculatedProcessorFvPatchField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
scalarSendBuf_.cdata_bytes(),
scalarSendBuf_.size_bytes(),
scalarSendBuf_,
procInterface_.tag(),
procInterface_.comm()
);

View File

@ -232,15 +232,15 @@ void Foam::processorFvPatchField<Type>::initEvaluate
}
// Receive straight into *this
this->resize_nocopy(sendBuf_.size());
Field<Type>& self = *this;
self.resize_nocopy(sendBuf_.size());
recvRequest_ = UPstream::nRequests();
UIPstream::read
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
this->data_bytes(),
this->size_bytes(),
self,
procPatch_.tag(),
procPatch_.comm()
);
@ -250,8 +250,7 @@ void Foam::processorFvPatchField<Type>::initEvaluate
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
sendBuf_.cdata_bytes(),
sendBuf_.size_bytes(),
sendBuf_,
procPatch_.tag(),
procPatch_.comm()
);
@ -353,8 +352,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
scalarRecvBuf_.data_bytes(),
scalarRecvBuf_.size_bytes(),
scalarRecvBuf_,
procPatch_.tag(),
procPatch_.comm()
);
@ -364,8 +362,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
scalarSendBuf_.cdata_bytes(),
scalarSendBuf_.size_bytes(),
scalarSendBuf_,
procPatch_.tag(),
procPatch_.comm()
);
@ -474,8 +471,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
recvBuf_.data_bytes(),
recvBuf_.size_bytes(),
recvBuf_,
procPatch_.tag(),
procPatch_.comm()
);
@ -485,8 +481,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
sendBuf_.cdata_bytes(),
sendBuf_.size_bytes(),
sendBuf_,
procPatch_.tag(),
procPatch_.comm()
);

View File

@ -143,8 +143,7 @@ bool Foam::ensightOutput::writeCloudPositions
(
UPstream::commsTypes::scheduled,
proci,
positions.data_bytes(),
positions.size_bytes()
positions
);
if (isBinaryOutput)
@ -166,8 +165,7 @@ bool Foam::ensightOutput::writeCloudPositions
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
positions.cdata_bytes(),
positions.size_bytes()
positions
);
}
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2024 OpenCFD Ltd.
Copyright (C) 2016-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -110,8 +110,7 @@ bool Foam::ensightOutput::writeCloudField
(
UPstream::commsTypes::scheduled,
proci,
recvData.data_bytes(),
recvData.size_bytes()
recvData
);
count = ensightOutput::Detail::writeCloudFieldContent
@ -137,8 +136,7 @@ bool Foam::ensightOutput::writeCloudField
(
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
field.cdata_bytes(),
field.size_bytes()
field
);
}
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2023 OpenCFD Ltd.
Copyright (C) 2023-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -194,13 +194,11 @@ void Foam::distributedDILUPreconditioner::receive
auto& recvBuf = recvBufs_[inti];
recvBuf.resize_nocopy(interfaceBouCoeffs[inti].size());
requests.push_back(UPstream::Request());
UIPstream::read
(
requests.back(),
requests.emplace_back(),
ppp->neighbProcNo(),
recvBuf.data_bytes(),
recvBuf.size_bytes(),
recvBuf,
ppp->tag()+70, // random offset
ppp->comm()
);
@ -232,13 +230,11 @@ void Foam::distributedDILUPreconditioner::send
sendBuf[face] = psiInternal[faceCells[face]];
}
requests.push_back(UPstream::Request());
UOPstream::write
(
requests.back(),
requests.emplace_back(),
ppp->neighbProcNo(),
sendBuf.cdata_bytes(),
sendBuf.size_bytes(),
sendBuf,
ppp->tag()+70, // random offset
ppp->comm()
);

View File

@ -139,8 +139,7 @@ void Foam::calculatedProcessorGAMGInterfaceField::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
scalarRecvBuf_.data_bytes(),
scalarRecvBuf_.size_bytes(),
scalarRecvBuf_,
procInterface_.tag(),
comm()
);
@ -150,8 +149,7 @@ void Foam::calculatedProcessorGAMGInterfaceField::initInterfaceMatrixUpdate
(
UPstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
scalarSendBuf_.cdata_bytes(),
scalarSendBuf_.size_bytes(),
scalarSendBuf_,
procInterface_.tag(),
comm()
);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2024 OpenCFD Ltd.
Copyright (C) 2017-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -100,8 +100,7 @@ Foam::label Foam::metisLikeDecomp::decomposeGeneral
(
commsType,
proci,
procSlot.data_bytes(),
procSlot.size_bytes(),
procSlot,
UPstream::msgType(),
UPstream::worldComm
);
@ -124,8 +123,7 @@ Foam::label Foam::metisLikeDecomp::decomposeGeneral
(
commsType,
UPstream::masterNo(),
procSlot.cdata_bytes(),
procSlot.size_bytes(),
procSlot,
UPstream::msgType(),
UPstream::worldComm
);