Skip to content

Commit

Permalink
replace use of mpl by mp11
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Dec 9, 2021
1 parent 7522718 commit 13889a6
Show file tree
Hide file tree
Showing 202 changed files with 755 additions and 1,376 deletions.
8 changes: 4 additions & 4 deletions docs/source/models/binary_collisions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ To enable collisions between the Ions and Electrons you would edit your param fi
static constexpr float_X coulombLog = 5.0_X;
};
using Pairs = MakeSeq_t<Pair<Electrons, Ions>>;
using CollisionPipeline = bmpl::
vector<Collider<binary::RelativisticBinaryCollision, Pairs, Params>>;
using CollisionPipeline = boost::mp11::
mp_list<Collider<binary::RelativisticBinaryCollision, Pairs, Params>>;
} // namespace collision
} // namespace particles
} // namespace picongpu
Expand Down Expand Up @@ -100,7 +100,7 @@ Here is an example with :math:`\Lambda = 5` for electron-ion collisions and :mat
using Pairs1 = MakeSeq_t<Pair<Electrons, Ions>>;
using Pairs2 = MakeSeq_t<Pair<Electrons, Electrons>, Pair<Ions, Ions>>;
using CollisionPipeline =
bmpl::vector<
boost::mp11::mp_list<
Collider<binary::RelativisticBinaryCollision, Pairs1, Params1>,
Collider<binary::RelativisticBinaryCollision, Pairs2, Params2>
>;
Expand All @@ -118,7 +118,7 @@ You need to define your filters in ``particleFilters.param`` and than you can us
using Pairs1 = MakeSeq_t<Pair<Electrons, Ions>>;
using Pairs2 = MakeSeq_t<Pair<Electrons, Electrons>, Pair<Ions, Ions>>;
using CollisionPipeline =
bmpl::vector<
boost::mp11::mp_list<
Collider<
binary::RelativisticBinaryCollision,
Pairs1,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/usage/workflows/probeParticles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ and add it to ``VectorAllSpecies``:

.. code-block:: cpp
using InitPipeline = bmpl::vector<
using InitPipeline = pmacc::mp_list<
// ... ,
CreateDensity<
densityProfiles::ProbeEveryFourthCell,
Expand Down
4 changes: 2 additions & 2 deletions docs/source/usage/workflows/quasiNeutrality.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For fully ionized ions, just use ``ManipulateDerive`` in :ref:`speciesInitializa

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

.. code-block:: cpp
using InitPipeline = bmpl::vector<
using InitPipeline = pmacc::mp_list<
/* density profile from density.param and
* start position from particle.param */
CreateDensity<
Expand Down
12 changes: 4 additions & 8 deletions include/picongpu/algorithms/ShiftCoordinateSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@

#pragma once

#include <pmacc/math/vector/Int.hpp>
#include <pmacc/meta/AllCombinations.hpp>
#include <pmacc/meta/ForEach.hpp>
#include <pmacc/types.hpp>

#include <boost/mpl/range_c.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/placeholders.hpp>

namespace picongpu
{
Expand All @@ -51,7 +48,7 @@ namespace picongpu
using Supports = T_Supports;
using Component = T_Component;

const uint32_t component = Component::x::value;
const uint32_t component = Component::value;
const uint32_t support = Supports::template at<component>::type::value;
const bool isEven = (support % 2) == 0;

Expand Down Expand Up @@ -93,10 +90,9 @@ namespace picongpu
* and does not waste registers */
const uint32_t dim = T_Vector::dim;

using Size = boost::mpl::vector1<boost::mpl::range_c<uint32_t, 0, dim>>;
using CombiTypes = typename AllCombinations<Size>::type;
using CombiTypes = pmacc::mp_iota_c<dim>;

meta::ForEach<CombiTypes, AssignToDim<bmpl::_1, T_supports>> shift;
meta::ForEach<CombiTypes, AssignToDim<boost::mpl::_1, T_supports>> shift;
shift(cursor, vector, fieldPos);
}
};
Expand Down
37 changes: 21 additions & 16 deletions include/picongpu/fields/EMFieldBase.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,25 @@
#include <pmacc/particles/traits/FilterByFlag.hpp>
#include <pmacc/traits/GetUniqueTypeId.hpp>

#include <boost/mpl/accumulate.hpp>

#include <cstdint>
#include <memory>
#include <type_traits>


namespace picongpu
{
namespace fields
{
template<typename A, typename B>
using LowerMarginInterpolationOp =
typename pmacc::math::CT::max<A, typename GetLowerMargin<typename GetInterpolation<B>::type>::type>::type;
template<typename A, typename B>
using UpperMarginInterpolationOp =
typename pmacc::math::CT::max<A, typename GetUpperMargin<typename GetInterpolation<B>::type>::type>::type;
template<typename A, typename B>
using LowerMarginOp = typename pmacc::math::CT::max<A, typename GetLowerMarginPusher<B>::type>::type;
template<typename A, typename B>
using UpperMarginOp = typename pmacc::math::CT::max<A, typename GetUpperMarginPusher<B>::type>::type;

template<typename T_DerivedField>
EMFieldBase<T_DerivedField>::EMFieldBase(MappingDesc const& cellDescription, pmacc::SimulationDataId const& id)
: SimulationFieldHelper<MappingDesc>(cellDescription)
Expand All @@ -58,14 +66,15 @@ namespace picongpu

using VectorSpeciesWithInterpolation =
typename pmacc::particles::traits::FilterByFlag<VectorAllSpecies, interpolation<>>::type;
using LowerMarginInterpolation = bmpl::accumulate<

using LowerMarginInterpolation = pmacc::mp_fold<
VectorSpeciesWithInterpolation,
typename pmacc::math::CT::make_Int<simDim, 0>::type,
pmacc::math::CT::max<bmpl::_1, GetLowerMargin<GetInterpolation<bmpl::_2>>>>::type;
using UpperMarginInterpolation = bmpl::accumulate<
LowerMarginInterpolationOp>;
using UpperMarginInterpolation = pmacc::mp_fold<
VectorSpeciesWithInterpolation,
typename pmacc::math::CT::make_Int<simDim, 0>::type,
pmacc::math::CT::max<bmpl::_1, GetUpperMargin<GetInterpolation<bmpl::_2>>>>::type;
UpperMarginInterpolationOp>;

/* Calculate the maximum Neighbors we need from MAX(ParticleShape, FieldSolver) */
using LowerMarginSolver = typename traits::GetLowerMargin<fields::Solver, DerivedField>::type;
Expand All @@ -81,15 +90,11 @@ namespace picongpu
*/
using VectorSpeciesWithPusherAndInterpolation = typename pmacc::particles::traits::
FilterByFlag<VectorSpeciesWithInterpolation, particlePusher<>>::type;
using LowerMargin = typename bmpl::accumulate<
VectorSpeciesWithPusherAndInterpolation,
LowerMarginInterpolationAndSolver,
pmacc::math::CT::max<bmpl::_1, GetLowerMarginPusher<bmpl::_2>>>::type;

using UpperMargin = typename bmpl::accumulate<
VectorSpeciesWithPusherAndInterpolation,
UpperMarginInterpolationAndSolver,
pmacc::math::CT::max<bmpl::_1, GetUpperMarginPusher<bmpl::_2>>>::type;

using LowerMargin = pmacc::
mp_fold<VectorSpeciesWithPusherAndInterpolation, LowerMarginInterpolationAndSolver, LowerMarginOp>;
using UpperMargin = pmacc::
mp_fold<VectorSpeciesWithPusherAndInterpolation, UpperMarginInterpolationAndSolver, UpperMarginOp>;

const DataSpace<simDim> originGuard(LowerMargin().toRT());
const DataSpace<simDim> endGuard(UpperMargin().toRT());
Expand Down
22 changes: 11 additions & 11 deletions include/picongpu/fields/FieldJ.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
#include <pmacc/traits/GetUniqueTypeId.hpp>
#include <pmacc/traits/Resolve.hpp>

#include <boost/mpl/accumulate.hpp>

#include <cstdint>
#include <iostream>
#include <memory>
Expand All @@ -52,6 +50,13 @@ namespace picongpu
{
using namespace pmacc;

template<typename A, typename B>
using LowerMarginShapesOp =
typename pmacc::math::CT::max<A, typename GetLowerMargin<typename GetCurrentSolver<B>::type>::type>::type;
template<typename A, typename B>
using UpperMarginShapesOp =
typename pmacc::math::CT::max<A, typename GetUpperMargin<typename GetCurrentSolver<B>::type>::type>::type;

FieldJ::FieldJ(MappingDesc const& cellDescription)
: SimulationFieldHelper<MappingDesc>(cellDescription)
, buffer(cellDescription.getGridLayout())
Expand All @@ -63,15 +68,10 @@ namespace picongpu
using AllSpeciesWithCurrent =
typename pmacc::particles::traits::FilterByFlag<VectorAllSpecies, current<>>::type;

using LowerMarginShapes = bmpl::accumulate<
AllSpeciesWithCurrent,
typename pmacc::math::CT::make_Int<simDim, 0>::type,
pmacc::math::CT::max<bmpl::_1, GetLowerMargin<GetCurrentSolver<bmpl::_2>>>>::type;

using UpperMarginShapes = bmpl::accumulate<
AllSpeciesWithCurrent,
typename pmacc::math::CT::make_Int<simDim, 0>::type,
pmacc::math::CT::max<bmpl::_1, GetUpperMargin<GetCurrentSolver<bmpl::_2>>>>::type;
using LowerMarginShapes = pmacc::
mp_fold<AllSpeciesWithCurrent, typename pmacc::math::CT::make_Int<simDim, 0>::type, LowerMarginShapesOp>;
using UpperMarginShapes = pmacc::
mp_fold<AllSpeciesWithCurrent, typename pmacc::math::CT::make_Int<simDim, 0>::type, UpperMarginShapesOp>;

/* margins are always positive, also for lower margins
* additional current interpolations and current filters on FieldJ might
Expand Down
35 changes: 20 additions & 15 deletions include/picongpu/fields/FieldTmp.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,25 @@
#include <pmacc/traits/GetNumWorkers.hpp>
#include <pmacc/traits/GetUniqueTypeId.hpp>

#include <boost/mpl/accumulate.hpp>

#include <memory>
#include <string>


namespace picongpu
{
using namespace pmacc;

template<typename A, typename B>
using SpeciesLowerMarginOp =
typename pmacc::math::CT::max<A, typename GetLowerMargin<typename GetInterpolation<B>::type>::type>::type;
template<typename A, typename B>
using SpeciesUpperMarginOp =
typename pmacc::math::CT::max<A, typename GetUpperMargin<typename GetInterpolation<B>::type>::type>::type;

template<typename A, typename B>
using FieldTmpLowerMarginOp = typename pmacc::math::CT::max<A, typename GetLowerMargin<B>::type>::type;
template<typename A, typename B>
using FieldTmpUpperMarginOp = typename pmacc::math::CT::max<A, typename GetUpperMargin<B>::type>::type;

FieldTmp::FieldTmp(MappingDesc const& cellDescription, uint32_t slotId)
: SimulationFieldHelper<MappingDesc>(cellDescription)
, m_slotId(slotId)
Expand Down Expand Up @@ -80,15 +89,13 @@ namespace picongpu
typename pmacc::particles::traits::FilterByFlag<VectorAllSpecies, interpolation<>>::type;

/* ------------------ lower margin ----------------------------------*/
using SpeciesLowerMargin = bmpl::accumulate<
using SpeciesLowerMargin = pmacc::mp_fold<
VectorSpeciesWithInterpolation,
typename pmacc::math::CT::make_Int<simDim, 0>::type,
pmacc::math::CT::max<bmpl::_1, GetLowerMargin<GetInterpolation<bmpl::_2>>>>::type;
SpeciesLowerMarginOp>;

using FieldTmpLowerMargin = bmpl::accumulate<
FieldTmpSolvers,
typename pmacc::math::CT::make_Int<simDim, 0>::type,
pmacc::math::CT::max<bmpl::_1, GetLowerMargin<bmpl::_2>>>::type;
using FieldTmpLowerMargin = pmacc::
mp_fold<FieldTmpSolvers, typename pmacc::math::CT::make_Int<simDim, 0>::type, FieldTmpLowerMarginOp>;

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

Expand All @@ -99,15 +106,13 @@ namespace picongpu

/* ------------------ upper margin -----------------------------------*/

using SpeciesUpperMargin = bmpl::accumulate<
using SpeciesUpperMargin = pmacc::mp_fold<
VectorSpeciesWithInterpolation,
typename pmacc::math::CT::make_Int<simDim, 0>::type,
pmacc::math::CT::max<bmpl::_1, GetUpperMargin<GetInterpolation<bmpl::_2>>>>::type;
SpeciesUpperMarginOp>;

using FieldTmpUpperMargin = bmpl::accumulate<
FieldTmpSolvers,
typename pmacc::math::CT::make_Int<simDim, 0>::type,
pmacc::math::CT::max<bmpl::_1, GetUpperMargin<bmpl::_2>>>::type;
using FieldTmpUpperMargin = pmacc::
mp_fold<FieldTmpSolvers, typename pmacc::math::CT::make_Int<simDim, 0>::type, FieldTmpUpperMarginOp>;

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

Expand Down
4 changes: 2 additions & 2 deletions include/picongpu/fields/LaserPhysics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ namespace picongpu

using LaserPlaneSizeInSuperCells = typename pmacc::math::CT::AssignIfInRange<
typename SuperCellSize::vector_type,
bmpl::integral_c<uint32_t, 1>, /* y direction */
bmpl::integral_c<int, laserInitCellsInY>>::type;
std::integral_constant<uint32_t, 1>, /* y direction */
std::integral_constant<int, laserInitCellsInY>>::type;

DataSpace<simDim> gridBlocks
= Environment<simDim>::get().SubGrid().getLocalDomain().size / SuperCellSize::toRT();
Expand Down
16 changes: 4 additions & 12 deletions include/picongpu/fields/absorber/exponential/Exponential.kernel
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
#include <pmacc/memory/shared/Allocate.hpp>
#include <pmacc/meta/ForEach.hpp>

#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/range_c.hpp>


namespace picongpu
{
namespace fields
Expand All @@ -41,8 +37,8 @@ namespace picongpu
{
/** damp each field component at exchange the border
*
* @tparam T_NumWorkers, boost::mpl::integral_c number of workers
* @tparam T_Axis, boost::mpl::integral_c axis of the coordinate system
* @tparam T_NumWorkers, std::integral_constant number of workers
* @tparam T_Axis, std::integral_constant axis of the coordinate system
* (0 = x, 1 = y, 2 = z)
*/
template<typename T_NumWorkers, typename T_Axis>
Expand Down Expand Up @@ -168,16 +164,12 @@ namespace picongpu
DataSpace<simDim> const relExchangeDir
= Mask::getRelativeDirections<simDim>(mapper.getExchangeType());

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

meta::ForEach<
SimulationDimensions,
detail::
AbsorbInOneDirection<boost::mpl::integral_c<uint32_t, T_numWorkers>, boost::mpl::_1>>
AbsorbInOneDirection<std::integral_constant<uint32_t, T_numWorkers>, boost::mpl::_1>>
absorbInAllDirections;

absorbInAllDirections(acc, field, thickness, absorberStrength, mapper, relExchangeDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ namespace picongpu
//! Number of coefficients: T_neighbors along T_axis, 1 along other axes
using Size = typename pmacc::math::CT::Assign<
pmacc::math::CT::make_Int<3, 1>::type::vector_type,
bmpl::integral_c<int, T_axis>,
bmpl::integral_c<int, T_neighbors>>::type;
std::integral_constant<int, T_axis>,
std::integral_constant<int, T_neighbors>>::type;

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

//! Normalized coefficient values, actual coefficient = value[...] / step[T_axis]
float_X value[Size::x::value][Size::y::value][Size::z::value];
Expand Down
4 changes: 2 additions & 2 deletions include/picongpu/fields/incidentField/Solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ namespace picongpu
constexpr int blockSizeAlongAxis = std::min(sizeAlongAxis, supercellSizeAlongAxis);
using BlockSize = typename pmacc::math::CT::AssignIfInRange<
typename SuperCellSize::vector_type,
bmpl::integral_c<uint32_t, T_axis>,
bmpl::integral_c<int, blockSizeAlongAxis>>::type;
std::integral_constant<uint32_t, T_axis>,
std::integral_constant<int, blockSizeAlongAxis>>::type;
auto const superCellSize = SuperCellSize::toRT();
auto const gridBlocks
= (endLocalUserIdx - beginLocalUserIdx + superCellSize - Index::create(1)) / superCellSize;
Expand Down
6 changes: 2 additions & 4 deletions include/picongpu/initialization/InitialiserController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include <pmacc/assert.hpp>
#include <pmacc/pluginSystem/PluginConnector.hpp>

#include <boost/mpl/find.hpp>

namespace picongpu
{
using namespace pmacc;
Expand Down Expand Up @@ -96,7 +94,7 @@ namespace picongpu
* Calculate omega_p for each given species and create a `picLog::PHYSICS`
* log message
*/
template<typename T_Species = bmpl::_1>
template<typename T_Species = boost::mpl::_1>
struct LogOmegaP
{
void operator()()
Expand Down Expand Up @@ -147,7 +145,7 @@ namespace picongpu
= cellDescription->getGridLayout().getDataSpaceWithoutGuarding().productOfComponents();
log<picLog::PHYSICS>("macro particles per device: %1%")
% (localNrOfCells * particles::TYPICAL_PARTICLES_PER_CELL
* (bmpl::size<VectorAllSpecies>::type::value));
* (pmacc::mp_size<VectorAllSpecies>::value));
log<picLog::PHYSICS>("typical macro particle weighting: %1%")
% (particles::TYPICAL_NUM_PARTICLES_PER_MACROPARTICLE);

Expand Down
2 changes: 1 addition & 1 deletion include/picongpu/param/collision.param
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace picongpu
*
* the functors are called in order (from first to last functor)
*/
using CollisionPipeline = bmpl::vector<>;
using CollisionPipeline = pmacc::mp_list<>;

} // namespace collision
} // namespace particles
Expand Down
Loading

0 comments on commit 13889a6

Please sign in to comment.