Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Checks: >
-modernize-macro-to-enum,
-modernize-return-braced-init-list,
-modernize-use-constraints,
-modernize-use-designated-initializers,
-modernize-use-integer-sign-comparison,
-modernize-use-ranges,
-modernize-use-starts-ends-with,
Expand Down Expand Up @@ -79,7 +78,6 @@ HeaderFileExtensions: ['', "H", 'h', 'hh', 'hpp', 'hxx']

# We will try to modernize this after switching to C++20
# -modernize-use-constraints
# -modernize-use-designated-initializers
# -modernize-use-std-numbers
# -modernize-use-ranges
# -modernize-use-integer-sign-comparison
Expand Down
4 changes: 2 additions & 2 deletions Src/Amr/AMReX_StateData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ std::map<std::string, Vector<char> > *StateData::faHeaderMap;

StateData::StateData ()
:
new_time{INVALID_TIME,INVALID_TIME},
old_time{INVALID_TIME,INVALID_TIME}
new_time{.start = INVALID_TIME, .stop = INVALID_TIME},
old_time{.start = INVALID_TIME, .stop = INVALID_TIME}

{
}
Expand Down
12 changes: 6 additions & 6 deletions Src/AmrCore/AMReX_FluxRegister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ FluxRegister::CrseInit (const MultiFab& mflx,
auto dfab = bndry[face].array(mfi);
#ifdef AMREX_USE_GPU
if (Gpu::inLaunchRegion()) {
tags.push_back({dfab, sfab, bx});
tags.push_back(Tag{.dfab = dfab, .sfab = sfab, .dbox = bx});
} else
#endif
{
Expand Down Expand Up @@ -675,7 +675,7 @@ FluxRegister::ClearInternalBorders (const Geometry& geom)
auto const& frarr = frlo[fsi].array();
for (auto const& is : isects) {
if (Gpu::inLaunchRegion()) {
tags.emplace_back(Array4BoxTag<Real>{frarr, is.second});
tags.emplace_back(Array4BoxTag<Real>{.dfab = frarr, .dbox = is.second});
} else {
frlo[fsi].setVal<RunOn::Host>(0.0, is.second, 0, nc);
}
Expand All @@ -687,7 +687,7 @@ FluxRegister::ClearInternalBorders (const Geometry& geom)
for (auto const& is : isects2) {
const Box& bx2 = amrex::shift(is.second, dir, -domain.length(dir));
if (Gpu::inLaunchRegion()) {
tags.emplace_back(Array4BoxTag<Real>{frarr, bx2});
tags.emplace_back(Array4BoxTag<Real>{.dfab = frarr, .dbox = bx2});
} else {
frlo[fsi].setVal<RunOn::Host>(0.0, bx2, 0, nc);
}
Expand All @@ -702,7 +702,7 @@ FluxRegister::ClearInternalBorders (const Geometry& geom)
auto const& frarr = frhi[fsi].array();
for (auto const& is : isects) {
if (Gpu::inLaunchRegion()) {
tags.emplace_back(Array4BoxTag<Real>{frarr, is.second});
tags.emplace_back(Array4BoxTag<Real>{.dfab = frarr, .dbox = is.second});
} else {
frhi[fsi].setVal<RunOn::Host>(0.0, is.second, 0, nc);
}
Expand All @@ -714,7 +714,7 @@ FluxRegister::ClearInternalBorders (const Geometry& geom)
for (auto const& is : isects2) {
const Box& bx2 = amrex::shift(is.second, dir, domain.length(dir));
if (Gpu::inLaunchRegion()) {
tags.emplace_back(Array4BoxTag<Real>{frarr, bx2});
tags.emplace_back(Array4BoxTag<Real>{.dfab = frarr, .dbox = bx2});
} else {
frhi[fsi].setVal<RunOn::Host>(0.0, bx2, 0, nc);
}
Expand Down Expand Up @@ -813,7 +813,7 @@ FluxRegister::OverwriteFlux (Array<MultiFab*,AMREX_SPACEDIM> const& crse_fluxes,
Box const& b = is.second-iv;
#ifdef AMREX_USE_GPU
if (run_on_gpu) {
tags.push_back({fab,b});
tags.push_back(Array4BoxTag<int>{.dfab = fab, .dbox = b});
} else
#endif
{
Expand Down
8 changes: 5 additions & 3 deletions Src/AmrCore/AMReX_InterpFaceRegister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void InterpFaceRegister::define (BoxArray const& fba, DistributionMapping const&
? crse_fine_face : fine_fine_face;
#ifdef AMREX_USE_GPU
if (Gpu::inLaunchRegion()) {
tags.emplace_back(Array4BoxValTag<int>{fab.array(),dbox,value});
tags.emplace_back(Array4BoxValTag<int>{.dfab = fab.array(), .dbox = dbox, .val = value});
} else
#endif
{
Expand Down Expand Up @@ -143,8 +143,10 @@ InterpFaceRegister::interp (Array<MultiFab*, AMREX_SPACEDIM> const& fine, // NOL
auto const& chi_arr = chidata.const_array(mfi);
auto const& mlo_arr = mlo_mf.const_array(mfi);
auto const& mhi_arr = mhi_mf.const_array(mfi);
tags.push_back(IFRTag{fine_arr, slo_arr, clo_arr, mlo_arr, domlo});
tags.push_back(IFRTag{fine_arr, shi_arr, chi_arr, mhi_arr, domhi});
tags.push_back(IFRTag{.fine = fine_arr, .slope = slo_arr, .crse = clo_arr,
.mask = mlo_arr, .domface = domlo});
tags.push_back(IFRTag{.fine = fine_arr, .slope = shi_arr, .crse = chi_arr,
.mask = mhi_arr, .domface = domhi});
}

ParallelFor(tags, [=] AMREX_GPU_DEVICE (int i, int j, int k, IFRTag const& tag) noexcept
Expand Down
4 changes: 2 additions & 2 deletions Src/AmrCore/AMReX_TagBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ TagBox::coarsen (const IntVect& ratio, const Box& cbox) noexcept
Array4<char> const& carr = cfab.array();

Box fdomain = domain;
Dim3 r{1,1,1};
Dim3 r{.x = 1, .y = 1, .z = 1};
AMREX_D_TERM(r.x = ratio[0];, r.y = ratio[1];, r.z = ratio[2]);

AMREX_HOST_DEVICE_FOR_3D(cbox, i, j, k,
Expand Down Expand Up @@ -694,7 +694,7 @@ TagBoxArray::setVal (const BoxArray& ba, TagBox::TagVal val)
Box const& b = is.second;
#ifdef AMREX_USE_GPU
if (run_on_gpu) {
tags.push_back({arr,b});
tags.push_back(Array4BoxTag<char>{.dfab = arr, .dbox = b});
} else
#endif
{
Expand Down
6 changes: 3 additions & 3 deletions Src/Base/AMReX_Array.H
Original file line number Diff line number Diff line change
Expand Up @@ -1092,11 +1092,11 @@ namespace amrex
inline XDim3 makeXDim3 (const Array<Real,AMREX_SPACEDIM>& a) noexcept
{
#if (AMREX_SPACEDIM == 1)
return XDim3{a[0], 0., 0.};
return XDim3{.x = a[0], .y = 0., .z = 0.};
#elif (AMREX_SPACEDIM == 2)
return XDim3{a[0], a[1], 0.};
return XDim3{.x = a[0], .y = a[1], .z = 0.};
#else
return XDim3{a[0], a[1], a[2]};
return XDim3{.x = a[0], .y = a[1], .z = a[2]};
#endif
}
}
Expand Down
8 changes: 5 additions & 3 deletions Src/Base/AMReX_Array4.H
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ namespace amrex {
[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Dim3 lbound (Array4<T> const& a) noexcept
{
return Dim3{a.begin.vect[0],a.begin.vect[1],a.begin.vect[2]};
return Dim3{.x = a.begin.vect[0], .y = a.begin.vect[1], .z = a.begin.vect[2]};
}

/**
Expand All @@ -1330,7 +1330,7 @@ namespace amrex {
[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Dim3 ubound (Array4<T> const& a) noexcept
{
return Dim3{a.end.vect[0]-1,a.end.vect[1]-1,a.end.vect[2]-1};
return Dim3{.x = a.end.vect[0]-1, .y = a.end.vect[1]-1, .z = a.end.vect[2]-1};
}

/**
Expand All @@ -1344,7 +1344,9 @@ namespace amrex {
[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Dim3 length (Array4<T> const& a) noexcept
{
return Dim3{a.end.vect[0]-a.begin.vect[0],a.end.vect[1]-a.begin.vect[1],a.end.vect[2]-a.begin.vect[2]};
return Dim3{.x = a.end.vect[0]-a.begin.vect[0],
.y = a.end.vect[1]-a.begin.vect[1],
.z = a.end.vect[2]-a.begin.vect[2]};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Src/Base/AMReX_AsyncOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ WriteInfo GetWriteInfo (int rank)
nspots = nmaxspots - 1;
}

return WriteInfo{ifile, ispot, nspots};
return WriteInfo{.ifile = ifile, .ispot = ispot, .nspots = nspots};
}

void Submit (std::function<void()>&& a_f)
Expand Down
28 changes: 14 additions & 14 deletions Src/Base/AMReX_BaseFab.H
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ BaseFab<T>::copy (const BaseFab<T>& src, const Box& srcbox, int srccomp,
Array4<T const> const& s = src.const_array();
const auto dlo = amrex::lbound(destbox);
const auto slo = amrex::lbound(srcbox);
const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
const Dim3 offset{.x = slo.x-dlo.x, .y = slo.y-dlo.y, .z = slo.z-dlo.z};

AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(run_on, destbox, numcomp, i, j, k, n,
{
Expand Down Expand Up @@ -2504,7 +2504,7 @@ BaseFab<T>::saxpy (T a, const BaseFab<T>& x, const Box& srcbox, const Box& destb
Array4<T const> const& s = x.const_array();
const auto dlo = amrex::lbound(destbox);
const auto slo = amrex::lbound(srcbox);
const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
const Dim3 offset{.x = slo.x-dlo.x, .y = slo.y-dlo.y, .z = slo.z-dlo.z};
AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(run_on, destbox, numcomp, i, j, k, n,
{
d(i,j,k,n+destcomp) += a * s(i+offset.x,j+offset.y,k+offset.z,n+srccomp);
Expand Down Expand Up @@ -2542,7 +2542,7 @@ BaseFab<T>::xpay (T a, const BaseFab<T>& x,
Array4<T const> const& s = x.const_array();
const auto dlo = amrex::lbound(destbox);
const auto slo = amrex::lbound(srcbox);
const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
const Dim3 offset{.x = slo.x-dlo.x, .y = slo.y-dlo.y, .z = slo.z-dlo.z};
AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(run_on, destbox, numcomp, i, j, k, n,
{
d(i,j,k,n+destcomp) = s(i+offset.x,j+offset.y,k+offset.z,n+srccomp) + a*d(i,j,k,n+destcomp);
Expand Down Expand Up @@ -2601,8 +2601,8 @@ BaseFab<T>::linComb (const BaseFab<T>& f1, const Box& b1, int comp1,
const auto dlo = amrex::lbound(b);
const auto slo1 = amrex::lbound(b1);
const auto slo2 = amrex::lbound(b2);
const Dim3 off1{slo1.x-dlo.x,slo1.y-dlo.y,slo1.z-dlo.z};
const Dim3 off2{slo2.x-dlo.x,slo2.y-dlo.y,slo2.z-dlo.z};
const Dim3 off1{.x = slo1.x-dlo.x, .y = slo1.y-dlo.y, .z = slo1.z-dlo.z};
const Dim3 off2{.x = slo2.x-dlo.x, .y = slo2.y-dlo.y, .z = slo2.z-dlo.z};

AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(run_on, b, numcomp, i, j, k, n,
{
Expand Down Expand Up @@ -2630,7 +2630,7 @@ BaseFab<T>::dot (const Box& xbx, int xcomp,

const auto xlo = amrex::lbound(xbx);
const auto ylo = amrex::lbound(ybx);
const Dim3 offset{ylo.x-xlo.x,ylo.y-xlo.y,ylo.z-xlo.z};
const Dim3 offset{.x = ylo.x-xlo.x, .y = ylo.y-xlo.y, .z = ylo.z-xlo.z};
Array4<T const> const& xa = this->const_array();
Array4<T const> const& ya = y.const_array();

Expand Down Expand Up @@ -2680,7 +2680,7 @@ BaseFab<T>::dotmask (const BaseFab<int>& mask, const Box& xbx, int xcomp,

const auto xlo = amrex::lbound(xbx);
const auto ylo = amrex::lbound(ybx);
const Dim3 offset{ylo.x-xlo.x,ylo.y-xlo.y,ylo.z-xlo.z};
const Dim3 offset{.x = ylo.x-xlo.x, .y = ylo.y-xlo.y, .z = ylo.z-xlo.z};

Array4<T const> const& xa = this->const_array();
Array4<T const> const& ya = y.const_array();
Expand Down Expand Up @@ -2836,7 +2836,7 @@ BaseFab<T>::plus (const BaseFab<T>& src, const Box& srcbox, const Box& destbox,
Array4<T const> const& s = src.const_array();
const auto dlo = amrex::lbound(destbox);
const auto slo = amrex::lbound(srcbox);
const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
const Dim3 offset{.x = slo.x-dlo.x, .y = slo.y-dlo.y, .z = slo.z-dlo.z};
AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(run_on, destbox, numcomp, i, j, k, n,
{
d(i,j,k,n+destcomp) += s(i+offset.x,j+offset.y,k+offset.z,n+srccomp);
Expand All @@ -2858,7 +2858,7 @@ void basefab_atomic_add (BaseFab<T>& dfab, const BaseFab<T>& sfab,
Array4<T const> const& s = sfab.const_array();
const auto dlo = amrex::lbound(destbox);
const auto slo = amrex::lbound(srcbox);
const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
const Dim3 offset{.x = slo.x-dlo.x, .y = slo.y-dlo.y, .z = slo.z-dlo.z};
AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(run_on, destbox, numcomp, i, j, k, n,
{
T* p = d.ptr(i,j,k,n+destcomp);
Expand Down Expand Up @@ -2920,7 +2920,7 @@ BaseFab<T>::lockAdd (const BaseFab<T>& src, const Box& srcbox, const Box& destbo
auto const& dhi = amrex::ubound(destbox);
auto const& len = amrex::length(destbox);
auto const& slo = amrex::lbound(srcbox);
Dim3 const offset{slo.x-dlo.x, slo.y-dlo.y, slo.z-dlo.z};
Dim3 const offset{.x = slo.x-dlo.x, .y = slo.y-dlo.y, .z = slo.z-dlo.z};

int planedim;
int nplanes;
Expand Down Expand Up @@ -3034,7 +3034,7 @@ BaseFab<T>::minus (const BaseFab<T>& src, const Box& srcbox, const Box& destbox,
Array4<T const> const& s = src.const_array();
const auto dlo = amrex::lbound(destbox);
const auto slo = amrex::lbound(srcbox);
const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
const Dim3 offset{.x = slo.x-dlo.x, .y = slo.y-dlo.y, .z = slo.z-dlo.z};
AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(run_on, destbox, numcomp, i, j, k, n,
{
d(i,j,k,n+destcomp) -= s(i+offset.x,j+offset.y,k+offset.z,n+srccomp);
Expand Down Expand Up @@ -3092,7 +3092,7 @@ BaseFab<T>::mult (const BaseFab<T>& src, const Box& srcbox, const Box& destbox,
Array4<T const> const& s = src.const_array();
const auto dlo = amrex::lbound(destbox);
const auto slo = amrex::lbound(srcbox);
const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
const Dim3 offset{.x = slo.x-dlo.x, .y = slo.y-dlo.y, .z = slo.z-dlo.z};
AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(run_on, destbox, numcomp, i, j, k, n,
{
d(i,j,k,n+destcomp) *= s(i+offset.x,j+offset.y,k+offset.z,n+srccomp);
Expand Down Expand Up @@ -3150,7 +3150,7 @@ BaseFab<T>::divide (const BaseFab<T>& src, const Box& srcbox, const Box& destbox
Array4<T const> const& s = src.const_array();
const auto dlo = amrex::lbound(destbox);
const auto slo = amrex::lbound(srcbox);
const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
const Dim3 offset{.x = slo.x-dlo.x, .y = slo.y-dlo.y, .z = slo.z-dlo.z};
AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(run_on, destbox, numcomp, i, j, k, n,
{
d(i,j,k,n+destcomp) /= s(i+offset.x,j+offset.y,k+offset.z,n+srccomp);
Expand Down Expand Up @@ -3208,7 +3208,7 @@ BaseFab<T>::protected_divide (const BaseFab<T>& src, const Box& srcbox, const Bo
Array4<T const> const& s = src.const_array();
const auto dlo = amrex::lbound(destbox);
const auto slo = amrex::lbound(srcbox);
const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
const Dim3 offset{.x = slo.x-dlo.x, .y = slo.y-dlo.y, .z = slo.z-dlo.z};
AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(run_on, destbox, numcomp, i, j, k, n,
{
if (s(i+offset.x,j+offset.y,k+offset.z,n+srccomp) != 0) {
Expand Down
8 changes: 4 additions & 4 deletions Src/Base/AMReX_Box.H
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public:
template <int N=dim, std::enable_if_t<( 1<=N && N<=3 ), int> = 0>
[[nodiscard]] AMREX_GPU_HOST_DEVICE
bool contains (int i, int j, int k) const noexcept {
Dim3 p3d{i, j, k};
Dim3 p3d{.x = i, .y = j, .z = k};
return contains(p3d);
}

Expand Down Expand Up @@ -268,7 +268,7 @@ public:
template <int N=dim, std::enable_if_t<( 1<=N && N<=3 ), int> = 0>
[[nodiscard]] AMREX_GPU_HOST_DEVICE
bool strictly_contains (int i, int j, int k) const noexcept {
Dim3 p3d{i, j, k};
Dim3 p3d{.x = i, .y = j, .z = k};
return strictly_contains(p3d);
}

Expand Down Expand Up @@ -2133,7 +2133,7 @@ AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
BoxND<dim> makeSingleCellBox (int i, int j, int k, IndexTypeND<dim> typ = IndexTypeND<dim>::TheCellType())
{
Dim3 p3d{i, j, k};
Dim3 p3d{.x = i, .y = j, .z = k};
IntVectND<dim> vect{p3d};
return BoxND<dim>{vect, vect, typ};
}
Expand Down Expand Up @@ -2214,7 +2214,7 @@ struct BoxIndexerND<1>
[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Dim3 operator() (std::uint64_t icell) const
{
return {int(icell)+lo, 0, 0};
return Dim3{.x = int(icell)+lo, .y = 0, .z = 0};
}

[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Expand Down
8 changes: 4 additions & 4 deletions Src/Base/AMReX_CudaGraph.H
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ struct CopyMemory
{
void* src = nullptr;
void* dst = nullptr;
Dim3 src_begin = {0,0,0};
Dim3 src_end = {0,0,0};
Dim3 dst_begin = {0,0,0};
Dim3 dst_end = {0,0,0};
Dim3 src_begin{.x = 0, .y = 0, .z = 0};
Dim3 src_end{.x = 0, .y = 0, .z = 0};
Dim3 dst_begin{.x = 0, .y = 0, .z = 0};
Dim3 dst_end{.x = 0, .y = 0, .z = 0};
int scomp = 0;
int ncomp = 0;

Expand Down
6 changes: 3 additions & 3 deletions Src/Base/AMReX_Dim3.H
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ Real dot_product (XDim3 const& a, XDim3 const& b)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
XDim3 cross_product (XDim3 const& a, XDim3 const& b)
{
return {a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x};
return XDim3{.x = a.y*b.z-a.z*b.y, .y = a.z*b.x-a.x*b.z, .z = a.x*b.y-a.y*b.x};
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
XDim3 operator+ (XDim3 const& a, XDim3 const& b)
{
return {a.x + b.x, a.y + b.y, a.z + b.z};
return XDim3{.x = a.x + b.x, .y = a.y + b.y, .z = a.z + b.z};
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
XDim3 operator- (XDim3 const& a, XDim3 const& b)
{
return {a.x - b.x, a.y - b.y, a.z - b.z};
return XDim3{.x = a.x - b.x, .y = a.y - b.y, .z = a.z - b.z};
}

template <typename T,
Expand Down
9 changes: 6 additions & 3 deletions Src/Base/AMReX_DistributionMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,9 @@ knapsack (const std::vector<Long>& wgts,
for (int i = 0; i < nprocs; ++i)
{
raii_vwb[i] = std::make_unique<Vector<WeightedBox> >();
wblq.push(WeightedBoxList({raii_vwb[i].get(),Long(0),-1}));
wblq.push(WeightedBoxList{.m_lb = raii_vwb[i].get(),
.m_weight = Long(0),
.m_rank = -1});
}
Vector<WeightedBoxList> wblv;
wblv.reserve(nprocs);
Expand Down Expand Up @@ -949,8 +951,9 @@ DistributionMapping::KnapSackProcessorMap (const DistributionMapping& olddm,
Vector<std::unique_ptr<Vector<WeightedBox>>> raii_vwb(nprocs);
for (int iproc = 0; iproc < nprocs; ++iproc) {
raii_vwb[iproc] = std::make_unique<Vector<WeightedBox>>();
wblq.push(WeightedBoxList({raii_vwb[iproc].get(), base_weight[iproc],
iproc}));
wblq.push(WeightedBoxList{.m_lb = raii_vwb[iproc].get(),
.m_weight = base_weight[iproc],
.m_rank = iproc});
}
Vector<WeightedBoxList> wblv;
wblv.reserve(nprocs);
Expand Down
Loading
Loading