Skip to content

Commit 5ff83cd

Browse files
Merge pull request #3834 from bernhardmgruber/mp11
Replace mpl by mp11 (part 1/2)
2 parents 1e50e0c + 4291dea commit 5ff83cd

File tree

187 files changed

+728
-1341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+728
-1341
lines changed

docs/source/models/binary_collisions.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ To enable collisions between the Ions and Electrons with a constant coulomb loga
6868
*
6969
* the functors are called in order (from first to last functor)
7070
*/
71-
using CollisionPipeline = bmpl::
72-
vector<Collider<relativistic::RelativisticCollisionConstLog<Params>, Pairs> >;
71+
using CollisionPipeline = boost::mp11::
72+
mp_list<Collider<relativistic::RelativisticCollisionConstLog<Params>, Pairs> >;
7373
} // namespace collision
7474
} // namespace particles
7575
} // namespace picongpu
@@ -100,7 +100,7 @@ Here is an example with :math:`\Lambda = 5` for electron-ion collisions and :mat
100100
using Pairs1 = MakeSeq_t<Pair<Electrons, Ions>>;
101101
using Pairs2 = MakeSeq_t<Pair<Electrons, Electrons>, Pair<Ions, Ions>>;
102102
using CollisionPipeline =
103-
bmpl::vector<
103+
boost::mp11::mp_list<
104104
Collider<relativistic::RelativisticCollisionConstLog<Params1>, Pairs1>,
105105
Collider<relativistic::RelativisticCollisionConstLog<Params2>, Pairs2>
106106
>;
@@ -112,7 +112,7 @@ For example the previous setup with automatic calculation for the inter-species
112112
.. code:: c++
113113

114114
using CollisionPipeline =
115-
bmpl::vector<
115+
boost::mp11::mp_list<
116116
Collider<relativistic::RelativisticCollisionDynamicLog<>, Pairs1>,
117117
Collider<relativistic::RelativisticCollisionConstLog<Params2>, Pairs2>
118118
>;
@@ -137,7 +137,7 @@ You need to define your filters in ``particleFilters.param`` and than you can us
137137
using Pairs1 = MakeSeq_t<Pair<Electrons, Ions>>;
138138
using Pairs2 = MakeSeq_t<Pair<Electrons, Electrons>, Pair<Ions, Ions>>;
139139
using CollisionPipeline =
140-
bmpl::vector<
140+
boost::mp11::mp_list<
141141
Collider<
142142
relativistic::RelativisticCollisionConstLog<Params1>,
143143
Pairs1,
@@ -190,7 +190,7 @@ This debug output can be enabled per collider by setting the optional template p
190190
.. code:: c++
191191

192192
using CollisionPipeline =
193-
bmpl::vector<
193+
boost::mp11::mp_list<
194194
Collider<relativistic::RelativisticCollisionDynamicLog<true>, Pairs1>,
195195
Collider<relativistic::RelativisticCollisionConstLog<Params2, true>, Pairs2>
196196
>;

docs/source/pypicongpu/species.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ The operations result in this ``speciesInitialization.param``:
744744

745745
.. code:: c++
746746

747-
using InitPipeline = bmpl::vector<
747+
using InitPipeline = boost::mp11::mp_list<
748748
/**********************************/
749749
/* phase 1: create macroparticles */
750750
/**********************************/

docs/source/usage/workflows/probeParticles.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ and add it to ``VectorAllSpecies``:
8484

8585
.. code-block:: cpp
8686
87-
using InitPipeline = bmpl::vector<
87+
using InitPipeline = pmacc::mp_list<
8888
// ... ,
8989
CreateDensity<
9090
densityProfiles::ProbeEveryFourthCell,

docs/source/usage/workflows/quasiNeutrality.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For fully ionized ions, just use ``ManipulateDerive`` in :ref:`speciesInitializa
1515

1616
.. code-block:: cpp
1717
18-
using InitPipeline = bmpl::vector<
18+
using InitPipeline = pmacc::mp_list<
1919
/* density profile from density.param and
2020
* start position from particle.param */
2121
CreateDensity<
@@ -72,7 +72,7 @@ Then again in :ref:`speciesInitialization.param <usage-params-core>` set your in
7272

7373
.. code-block:: cpp
7474
75-
using InitPipeline = bmpl::vector<
75+
using InitPipeline = pmacc::mp_list<
7676
/* density profile from density.param and
7777
* start position from particle.param */
7878
CreateDensity<

include/picongpu/algorithms/ShiftCoordinateSystem.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@
2020

2121
#pragma once
2222

23-
#include <pmacc/math/vector/Int.hpp>
24-
#include <pmacc/meta/AllCombinations.hpp>
2523
#include <pmacc/meta/ForEach.hpp>
2624
#include <pmacc/types.hpp>
2725

28-
#include <boost/mpl/range_c.hpp>
29-
#include <boost/mpl/vector.hpp>
26+
#include <boost/mpl/placeholders.hpp>
3027

3128
namespace picongpu
3229
{

include/picongpu/fields/EMFieldBase.tpp

+21-16
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,25 @@
3737
#include <pmacc/particles/traits/FilterByFlag.hpp>
3838
#include <pmacc/traits/GetUniqueTypeId.hpp>
3939

40-
#include <boost/mpl/accumulate.hpp>
41-
4240
#include <cstdint>
4341
#include <memory>
4442
#include <type_traits>
4543

46-
4744
namespace picongpu
4845
{
4946
namespace fields
5047
{
48+
template<typename A, typename B>
49+
using LowerMarginInterpolationOp =
50+
typename pmacc::math::CT::max<A, typename GetLowerMargin<typename GetInterpolation<B>::type>::type>::type;
51+
template<typename A, typename B>
52+
using UpperMarginInterpolationOp =
53+
typename pmacc::math::CT::max<A, typename GetUpperMargin<typename GetInterpolation<B>::type>::type>::type;
54+
template<typename A, typename B>
55+
using LowerMarginOp = typename pmacc::math::CT::max<A, typename GetLowerMarginPusher<B>::type>::type;
56+
template<typename A, typename B>
57+
using UpperMarginOp = typename pmacc::math::CT::max<A, typename GetUpperMarginPusher<B>::type>::type;
58+
5159
template<typename T_DerivedField>
5260
EMFieldBase<T_DerivedField>::EMFieldBase(MappingDesc const& cellDescription, pmacc::SimulationDataId const& id)
5361
: SimulationFieldHelper<MappingDesc>(cellDescription)
@@ -57,14 +65,15 @@ namespace picongpu
5765

5866
using VectorSpeciesWithInterpolation =
5967
typename pmacc::particles::traits::FilterByFlag<VectorAllSpecies, interpolation<>>::type;
60-
using LowerMarginInterpolation = bmpl::accumulate<
68+
69+
using LowerMarginInterpolation = pmacc::mp_fold<
6170
VectorSpeciesWithInterpolation,
6271
typename pmacc::math::CT::make_Int<simDim, 0>::type,
63-
pmacc::math::CT::max<bmpl::_1, GetLowerMargin<GetInterpolation<bmpl::_2>>>>::type;
64-
using UpperMarginInterpolation = bmpl::accumulate<
72+
LowerMarginInterpolationOp>;
73+
using UpperMarginInterpolation = pmacc::mp_fold<
6574
VectorSpeciesWithInterpolation,
6675
typename pmacc::math::CT::make_Int<simDim, 0>::type,
67-
pmacc::math::CT::max<bmpl::_1, GetUpperMargin<GetInterpolation<bmpl::_2>>>>::type;
76+
UpperMarginInterpolationOp>;
6877

6978
/* Calculate the maximum Neighbors we need from MAX(ParticleShape, FieldSolver) */
7079
using LowerMarginSolver = typename traits::GetLowerMargin<fields::Solver, DerivedField>::type;
@@ -80,15 +89,11 @@ namespace picongpu
8089
*/
8190
using VectorSpeciesWithPusherAndInterpolation = typename pmacc::particles::traits::
8291
FilterByFlag<VectorSpeciesWithInterpolation, particlePusher<>>::type;
83-
using LowerMargin = typename bmpl::accumulate<
84-
VectorSpeciesWithPusherAndInterpolation,
85-
LowerMarginInterpolationAndSolver,
86-
pmacc::math::CT::max<bmpl::_1, GetLowerMarginPusher<bmpl::_2>>>::type;
87-
88-
using UpperMargin = typename bmpl::accumulate<
89-
VectorSpeciesWithPusherAndInterpolation,
90-
UpperMarginInterpolationAndSolver,
91-
pmacc::math::CT::max<bmpl::_1, GetUpperMarginPusher<bmpl::_2>>>::type;
92+
93+
using LowerMargin = pmacc::
94+
mp_fold<VectorSpeciesWithPusherAndInterpolation, LowerMarginInterpolationAndSolver, LowerMarginOp>;
95+
using UpperMargin = pmacc::
96+
mp_fold<VectorSpeciesWithPusherAndInterpolation, UpperMarginInterpolationAndSolver, UpperMarginOp>;
9297

9398
const DataSpace<simDim> originGuard(LowerMargin().toRT());
9499
const DataSpace<simDim> endGuard(UpperMargin().toRT());

include/picongpu/fields/FieldJ.tpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
#include <pmacc/traits/GetUniqueTypeId.hpp>
4040
#include <pmacc/traits/Resolve.hpp>
4141

42-
#include <boost/mpl/accumulate.hpp>
43-
4442
#include <algorithm>
4543
#include <cstdint>
4644
#include <iostream>
@@ -52,6 +50,13 @@ namespace picongpu
5250
{
5351
using namespace pmacc;
5452

53+
template<typename A, typename B>
54+
using LowerMarginShapesOp =
55+
typename pmacc::math::CT::max<A, typename GetLowerMargin<typename GetCurrentSolver<B>::type>::type>::type;
56+
template<typename A, typename B>
57+
using UpperMarginShapesOp =
58+
typename pmacc::math::CT::max<A, typename GetUpperMargin<typename GetCurrentSolver<B>::type>::type>::type;
59+
5560
FieldJ::FieldJ(MappingDesc const& cellDescription)
5661
: SimulationFieldHelper<MappingDesc>(cellDescription)
5762
, buffer(cellDescription.getGridLayout())
@@ -63,15 +68,10 @@ namespace picongpu
6368
using AllSpeciesWithCurrent =
6469
typename pmacc::particles::traits::FilterByFlag<VectorAllSpecies, current<>>::type;
6570

66-
using LowerMarginShapes = bmpl::accumulate<
67-
AllSpeciesWithCurrent,
68-
typename pmacc::math::CT::make_Int<simDim, 0>::type,
69-
pmacc::math::CT::max<bmpl::_1, GetLowerMargin<GetCurrentSolver<bmpl::_2>>>>::type;
70-
71-
using UpperMarginShapes = bmpl::accumulate<
72-
AllSpeciesWithCurrent,
73-
typename pmacc::math::CT::make_Int<simDim, 0>::type,
74-
pmacc::math::CT::max<bmpl::_1, GetUpperMargin<GetCurrentSolver<bmpl::_2>>>>::type;
71+
using LowerMarginShapes = pmacc::
72+
mp_fold<AllSpeciesWithCurrent, typename pmacc::math::CT::make_Int<simDim, 0>::type, LowerMarginShapesOp>;
73+
using UpperMarginShapes = pmacc::
74+
mp_fold<AllSpeciesWithCurrent, typename pmacc::math::CT::make_Int<simDim, 0>::type, UpperMarginShapesOp>;
7575

7676
/* margins are always positive, also for lower margins
7777
* additional current interpolations and current filters on FieldJ might

include/picongpu/fields/FieldTmp.tpp

+20-15
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,25 @@
3939
#include <pmacc/particles/traits/FilterByFlag.hpp>
4040
#include <pmacc/traits/GetUniqueTypeId.hpp>
4141

42-
#include <boost/mpl/accumulate.hpp>
43-
4442
#include <memory>
4543
#include <string>
4644

47-
4845
namespace picongpu
4946
{
5047
using namespace pmacc;
5148

49+
template<typename A, typename B>
50+
using SpeciesLowerMarginOp =
51+
typename pmacc::math::CT::max<A, typename GetLowerMargin<typename GetInterpolation<B>::type>::type>::type;
52+
template<typename A, typename B>
53+
using SpeciesUpperMarginOp =
54+
typename pmacc::math::CT::max<A, typename GetUpperMargin<typename GetInterpolation<B>::type>::type>::type;
55+
56+
template<typename A, typename B>
57+
using FieldTmpLowerMarginOp = typename pmacc::math::CT::max<A, typename GetLowerMargin<B>::type>::type;
58+
template<typename A, typename B>
59+
using FieldTmpUpperMarginOp = typename pmacc::math::CT::max<A, typename GetUpperMargin<B>::type>::type;
60+
5261
FieldTmp::FieldTmp(MappingDesc const& cellDescription, uint32_t slotId)
5362
: SimulationFieldHelper<MappingDesc>(cellDescription)
5463
, m_slotId(slotId)
@@ -79,15 +88,13 @@ namespace picongpu
7988
typename pmacc::particles::traits::FilterByFlag<VectorAllSpecies, interpolation<>>::type;
8089

8190
/* ------------------ lower margin ----------------------------------*/
82-
using SpeciesLowerMargin = bmpl::accumulate<
91+
using SpeciesLowerMargin = pmacc::mp_fold<
8392
VectorSpeciesWithInterpolation,
8493
typename pmacc::math::CT::make_Int<simDim, 0>::type,
85-
pmacc::math::CT::max<bmpl::_1, GetLowerMargin<GetInterpolation<bmpl::_2>>>>::type;
94+
SpeciesLowerMarginOp>;
8695

87-
using FieldTmpLowerMargin = bmpl::accumulate<
88-
FieldTmpSolvers,
89-
typename pmacc::math::CT::make_Int<simDim, 0>::type,
90-
pmacc::math::CT::max<bmpl::_1, GetLowerMargin<bmpl::_2>>>::type;
96+
using FieldTmpLowerMargin = pmacc::
97+
mp_fold<FieldTmpSolvers, typename pmacc::math::CT::make_Int<simDim, 0>::type, FieldTmpLowerMarginOp>;
9198

9299
using SpeciesFieldTmpLowerMargin = pmacc::math::CT::max<SpeciesLowerMargin, FieldTmpLowerMargin>::type;
93100

@@ -98,15 +105,13 @@ namespace picongpu
98105

99106
/* ------------------ upper margin -----------------------------------*/
100107

101-
using SpeciesUpperMargin = bmpl::accumulate<
108+
using SpeciesUpperMargin = pmacc::mp_fold<
102109
VectorSpeciesWithInterpolation,
103110
typename pmacc::math::CT::make_Int<simDim, 0>::type,
104-
pmacc::math::CT::max<bmpl::_1, GetUpperMargin<GetInterpolation<bmpl::_2>>>>::type;
111+
SpeciesUpperMarginOp>;
105112

106-
using FieldTmpUpperMargin = bmpl::accumulate<
107-
FieldTmpSolvers,
108-
typename pmacc::math::CT::make_Int<simDim, 0>::type,
109-
pmacc::math::CT::max<bmpl::_1, GetUpperMargin<bmpl::_2>>>::type;
113+
using FieldTmpUpperMargin = pmacc::
114+
mp_fold<FieldTmpSolvers, typename pmacc::math::CT::make_Int<simDim, 0>::type, FieldTmpUpperMarginOp>;
110115

111116
using SpeciesFieldTmpUpperMargin = pmacc::math::CT::max<SpeciesUpperMargin, FieldTmpUpperMargin>::type;
112117

include/picongpu/fields/MaxwellSolver/Substepping/Substepping.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ namespace picongpu
261261
typename pmacc::particles::traits::FilterByFlag<VectorAllSpecies, current<>>::type;
262262
//! Whether the simulation has any current sources
263263
static constexpr auto existsCurrent
264-
= (bmpl::size<SpeciesWithCurrentSolver>::type::value > 0) || FieldBackgroundJ::activated;
264+
= (pmacc::mp_size<SpeciesWithCurrentSolver>::value > 0) || FieldBackgroundJ::activated;
265265

266266
/** Whether previousJ is initialized with data of J from previous time step
267267
*

include/picongpu/fields/absorber/exponential/Exponential.kernel

+2-10
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
#include <pmacc/memory/shared/Allocate.hpp>
2626
#include <pmacc/meta/ForEach.hpp>
2727

28-
#include <boost/mpl/integral_c.hpp>
29-
#include <boost/mpl/range_c.hpp>
30-
31-
3228
namespace picongpu
3329
{
3430
namespace fields
@@ -41,7 +37,7 @@ namespace picongpu
4137
{
4238
/** damp each field component at exchange the border
4339
*
44-
* @tparam T_Axis, boost::mpl::integral_c axis of the coordinate system
40+
* @tparam T_Axis, std::integral_constant axis of the coordinate system
4541
* (0 = x, 1 = y, 2 = z)
4642
*/
4743
template<typename T_Axis>
@@ -160,11 +156,7 @@ namespace picongpu
160156
DataSpace<simDim> const relExchangeDir
161157
= Mask::getRelativeDirections<simDim>(mapper.getExchangeType());
162158

163-
/* create a sequence with int values [0;simDim)
164-
* MakeSeq_t allows to use the result of mpl::range_c
165-
* within the PMacc ForEach
166-
*/
167-
using SimulationDimensions = MakeSeq_t<boost::mpl::range_c<int, 0, int(simDim)>>;
159+
using SimulationDimensions = pmacc::mp_iota<pmacc::mp_int<simDim>>;
168160

169161
meta::ForEach<SimulationDimensions, detail::AbsorbInOneDirection<boost::mpl::_1>>
170162
absorbInAllDirections;

include/picongpu/fields/incidentField/DerivativeCoefficients.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ namespace picongpu
105105
//! Number of coefficients: T_neighbors along T_axis, 1 along other axes
106106
using Size = typename pmacc::math::CT::Assign<
107107
pmacc::math::CT::make_Int<3, 1>::type::vector_type,
108-
bmpl::integral_c<int, T_axis>,
109-
bmpl::integral_c<int, T_neighbors>>::type;
108+
std::integral_constant<int, T_axis>,
109+
std::integral_constant<int, T_neighbors>>::type;
110110

111111
//! Normalized coefficient values, actual coefficient = value[...] / step[T_axis]
112112
float_X value[Size::x::value][Size::y::value][Size::z::value];
@@ -189,8 +189,8 @@ namespace picongpu
189189
//! Number of coefficients: 2 along T_cherenkovFreeDirection, 1 along other axes
190190
using Size = typename pmacc::math::CT::Assign<
191191
pmacc::math::CT::make_Int<3, 1>::type::vector_type,
192-
bmpl::integral_c<int, T_cherenkovFreeDirection>,
193-
bmpl::integral_c<int, 2>>::type;
192+
std::integral_constant<int, T_cherenkovFreeDirection>,
193+
std::integral_constant<int, 2>>::type;
194194

195195
//! Normalized coefficient values, actual coefficient = value[...] / step[T_axis]
196196
float_X value[Size::x::value][Size::y::value][Size::z::value];

include/picongpu/fields/incidentField/Solver.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ namespace picongpu
302302
constexpr int blockSizeAlongAxis = std::min(sizeAlongAxis, supercellSizeAlongAxis);
303303
using BlockSize = typename pmacc::math::CT::AssignIfInRange<
304304
typename SuperCellSize::vector_type,
305-
bmpl::integral_c<uint32_t, T_axis>,
306-
bmpl::integral_c<int, blockSizeAlongAxis>>::type;
305+
std::integral_constant<uint32_t, T_axis>,
306+
std::integral_constant<int, blockSizeAlongAxis>>::type;
307307
auto const superCellSize = SuperCellSize::toRT();
308308
auto const gridBlocks
309309
= (endLocalUserIdx - beginLocalUserIdx + superCellSize - Index::create(1)) / superCellSize;
@@ -633,10 +633,10 @@ namespace picongpu
633633
parameters.direction = 1.0_X;
634634
parameters.sourceTimeIteration = sourceTimeIteration;
635635
parameters.timeIncrement = maxwellSolver::getTimeStep();
636-
meta::ForEach<T_MinProfiles, ApplyUpdateE<bmpl::_1>> applyMinProfiles;
636+
meta::ForEach<T_MinProfiles, ApplyUpdateE<boost::mpl::_1>> applyMinProfiles;
637637
applyMinProfiles(parameters);
638638
parameters.direction = -1.0_X;
639-
meta::ForEach<T_MaxProfiles, ApplyUpdateE<bmpl::_1>> applyMaxProfiles;
639+
meta::ForEach<T_MaxProfiles, ApplyUpdateE<boost::mpl::_1>> applyMaxProfiles;
640640
applyMaxProfiles(parameters);
641641
}
642642

@@ -682,10 +682,10 @@ namespace picongpu
682682
parameters.direction = 1.0_X;
683683
parameters.sourceTimeIteration = sourceTimeIteration;
684684
parameters.timeIncrement = 0.5_X * maxwellSolver::getTimeStep();
685-
meta::ForEach<T_MinProfiles, ApplyUpdateB<bmpl::_1>> applyMinProfiles;
685+
meta::ForEach<T_MinProfiles, ApplyUpdateB<boost::mpl::_1>> applyMinProfiles;
686686
applyMinProfiles(parameters);
687687
parameters.direction = -1.0_X;
688-
meta::ForEach<T_MaxProfiles, ApplyUpdateB<bmpl::_1>> applyMaxProfiles;
688+
meta::ForEach<T_MaxProfiles, ApplyUpdateB<boost::mpl::_1>> applyMaxProfiles;
689689
applyMaxProfiles(parameters);
690690
}
691691

0 commit comments

Comments
 (0)