This commit is contained in:
Vladimir Z Tomov
2026-08-18 18:09:17 -07:00
parent 4513f40155
commit 6d70de1563
2 changed files with 10 additions and 31 deletions
-19
View File
@@ -1004,23 +1004,6 @@ void DeviceSharedDofCommunicator::Bcast<real_t>(Array<real_t> &x_ldof) const
Bcast(true_buf, x_ldof);
}
template <typename T>
void DeviceSharedDofCommunicator::ReduceAndBcast(Array<T> &x_ldof, Op op) const
{
Array<T> x_tdof(nbr_comm->LocalTDofToLDof().Size());
x_tdof.GetMemory().UseDevice(true);
Reduce(x_ldof, x_tdof, op);
Bcast(x_tdof, x_ldof);
}
template <>
void DeviceSharedDofCommunicator::ReduceAndBcast<real_t>(Array<real_t> &x_ldof,
Op op) const
{
Reduce(x_ldof, true_buf, op);
Bcast(true_buf, x_ldof);
}
template <class T>
void GroupCommunicator::Bcast(T *ldata) const
{
@@ -1862,8 +1845,6 @@ template void DeviceSharedDofCommunicator::Bcast<int>(
const Array<int> &, Array<int> &) const;
template void DeviceSharedDofCommunicator::Bcast<int>(
Array<int> &) const;
template void DeviceSharedDofCommunicator::ReduceAndBcast<int>(
Array<int> &, Op) const;
template void DeviceSharedDofCommunicator::ReduceBeginCopy<real_t>(
const Array<real_t> &, Array<real_t> &) const;
+10 -12
View File
@@ -595,7 +595,16 @@ class DeviceSharedDofCommunicator
public:
enum class Op { Sum, Min, Max };
protected:
explicit DeviceSharedDofCommunicator(const GroupCommunicator &gc);
~DeviceSharedDofCommunicator();
template <typename T>
void Reduce(Array<T> &x_ldof, Op op) const;
template <typename T>
void Bcast(Array<T> &x_ldof) const;
private:
mutable Array<real_t> shr_buf, ext_buf, true_buf;
internal::DeviceNeighborDofComm *nbr_comm;
@@ -614,22 +623,11 @@ protected:
template <typename T>
void BcastEndCopy(const Array<T> &ext_buf_t, Array<T> &x_ldof) const;
public:
explicit DeviceSharedDofCommunicator(const GroupCommunicator &gc);
~DeviceSharedDofCommunicator();
template <typename T>
void Reduce(const Array<T> &x_ldof, Array<T> &x_tdof, Op op) const;
template <typename T>
void Reduce(Array<T> &x_ldof, Op op) const;
template <typename T>
void Bcast(const Array<T> &x_tdof, Array<T> &x_ldof) const;
template <typename T>
void Bcast(Array<T> &x_ldof) const;
template <typename T>
void ReduceAndBcast(Array<T> &x_ldof, Op op) const;
};
/// General MPI message tags used by MFEM