Important pmacc Classes

This is very, very small selection of classes of interest to get you started.

Note

Please help adding more Doxygen doc strings to the classes described below. As an example, here is a listing of possible extensive docs that new developers find are missing: https://github.com/ComputationalRadiationPhysics/picongpu/issues/776

Environment

template <uint32_t T_dim>
class pmacc::Environment

Global Environment singleton for PMacc.

Inherits from pmacc::detail::Environment

Public Functions

pmacc::GridController<T_dim> &pmacc::EnvironmentGridController()

get the singleton GridController

Return
instance of GridController

pmacc::SubGrid<T_dim> &pmacc::EnvironmentSubGrid()

get the singleton SubGrid

Return
instance of SubGrid

pmacc::Filesystem<T_dim> &pmacc::EnvironmentFilesystem()

get the singleton Filesystem

Return
instance of Filesystem

void pmacc::EnvironmentinitDevices(DataSpace<T_dim> devices, DataSpace<T_dim> periodic)

create and initialize the environment of PMacc

Usage of MPI or device(accelerator) function calls before this method are not allowed.

Parameters
  • devices: number of devices per simulation dimension
  • periodic: periodicity each simulation dimension (0 == not periodic, 1 == periodic)

void pmacc::EnvironmentinitGrids(DataSpace<T_dim> globalDomainSize, DataSpace<T_dim> localDomainSize, DataSpace<T_dim> localDomainOffset)

initialize the computing domain information of PMacc

Parameters
  • globalDomainSize: size of the global simulation domain [cells]
  • localDomainSize: size of the local simulation domain [cells]
  • localDomainOffset: local domain offset [cells]

pmacc::EnvironmentEnvironment(const Environment&)
Environment &pmacc::Environmentoperator=(const Environment&)

Public Static Functions

static Environment<T_dim> &pmacc::Environmentget()

get the singleton Environment< DIM >

Return
instance of Environment<DIM >

DataConnector

class pmacc::DataConnector

Singleton class which collects and shares simulation data.

All members are kept as shared pointers, which allows their factories to be destroyed after sharing ownership with our DataConnector.

Public Functions

bool pmacc::DataConnectorhasId(SimulationDataId id)

Returns if data with identifier id is shared.

Return
if dataset with id is registered
Parameters
  • id: id of the Dataset to query

void pmacc::DataConnectorinitialise(AbstractInitialiser &initialiser, uint32_t currentStep)

Initialises all Datasets using initialiser.

After initialising, the Datasets will be invalid.

Parameters
  • initialiser: class used for initialising Datasets
  • currentStep: current simulation step

void pmacc::DataConnectorshare(const std::shared_ptr<ISimulationData> &data)

Registers a new Dataset with data and identifier id.

If a Dataset with identifier id already exists, a runtime_error is thrown. (Check with DataConnector::hasId when necessary.)

Parameters
  • data: simulation data to share ownership

void pmacc::DataConnectorunshare(SimulationDataId id)

End sharing a dataset with identifier id.

Parameters
  • id: id of the dataset to remove

void pmacc::DataConnectorclean()

Unshare all associated datasets.

template <class TYPE>
std::shared_ptr<TYPE> pmacc::DataConnectorget(SimulationDataId id, bool noSync = false)

Returns shared pointer to managed data.

Reference to data in Dataset with identifier id and type TYPE is returned. If the Dataset status in invalid, it is automatically synchronized. Increments the reference counter to the dataset specified by id. This reference has to be released after all read/write operations before the next synchronize()/getData() on this data are done using releaseData().

Return
returns a reference to the data of type TYPE
Template Parameters
  • TYPE: if of the data to load
Parameters
  • id: id of the Dataset to load from
  • noSync: indicates that no synchronization should be performed, regardless of dataset status

void pmacc::DataConnectorreleaseData(SimulationDataId)

Indicate a data set gotten temporarily via.

See
getData is not used anymore

Parameters
  • id: id for the dataset previously acquired using getData()

Friends

friend pmacc::DataConnector::detail::Environment

DataSpace

template <unsigned DIM>
class pmacc::DataSpace

A DIM-dimensional data space.

DataSpace describes a DIM-dimensional data space with a specific size for each dimension. It only describes the space and does not hold any actual data.

Template Parameters
  • DIM: dimension (1-3) of the dataspace

Inherits from pmacc::math::Vector< int, DIM >

Public Types

typedef math::Vector<int, DIM> pmacc::DataSpaceBaseType

Public Functions

HDINLINE pmacc::DataSpaceDataSpace()

default constructor.

Sets size of all dimensions to 0.

HDINLINE pmacc::DataSpaceDataSpace(dim3 value)

constructor.

Sets size of all dimensions from cuda dim3.

HDINLINE pmacc::DataSpaceDataSpace(uint3 value)

constructor.

Sets size of all dimensions from cuda uint3 (e.g. threadIdx/blockIdx)

HDINLINE pmacc::DataSpaceDataSpace(const DataSpace<DIM> &value)
HDINLINE pmacc::DataSpaceDataSpace(int x)

Constructor for DIM1-dimensional DataSpace.

Parameters
  • x: size of first dimension

HDINLINE pmacc::DataSpaceDataSpace(int x, int y)

Constructor for DIM2-dimensional DataSpace.

Parameters
  • x: size of first dimension
  • y: size of second dimension

HDINLINE pmacc::DataSpaceDataSpace(int x, int y, int z)

Constructor for DIM3-dimensional DataSpace.

Parameters
  • x: size of first dimension
  • y: size of second dimension
  • z: size of third dimension

HDINLINE pmacc::DataSpaceDataSpace(const BaseType &vec)
HDINLINE pmacc::DataSpaceDataSpace(const math::Size_t<DIM> &vec)
HDINLINE int pmacc::DataSpace::getDim() const

Returns number of dimensions (DIM) of this DataSpace.

Return
number of dimensions

HINLINE bool pmacc::DataSpace::isOneDimensionGreaterThan(const DataSpace < DIM > & other) const

Evaluates if one dimension is greater than the respective dimension of other.

Return
true if one dimension is greater, false otherwise
Parameters

HDINLINE pmacc::DataSpaceoperator math::Size_t<DIM>() const
HDINLINE pmacc::DataSpaceoperator dim3() const

Public Static Functions

static HDINLINE DataSpace<DIM> pmacc::DataSpace::create(int value = 1)

Give DataSpace where all dimensions set to init value.

Return
the new DataSpace
Parameters
  • value: value which is setfor all dimensions

Public Static Attributes

constexpr int pmacc::DataSpaceDim =DIM

Vector

Warning

doxygenclass: Cannot find class “pmacc::Vector” in doxygen xml output for project “PIConGPU” from directory: ../xml

SuperCell

template <class TYPE>
class pmacc::SuperCell

Public Functions

HDINLINE pmacc::SuperCellSuperCell()
HDINLINE TYPE* pmacc::SuperCell::FirstFramePtr()
HDINLINE TYPE* pmacc::SuperCell::LastFramePtr()
HDINLINE const TYPE* pmacc::SuperCell::FirstFramePtr() const
HDINLINE const TYPE* pmacc::SuperCell::LastFramePtr() const
HDINLINE bool pmacc::SuperCell::mustShift()
HDINLINE void pmacc::SuperCell::setMustShift(bool value)
HDINLINE lcellId_t pmacc::SuperCell::getSizeLastFrame()
HDINLINE void pmacc::SuperCell::setSizeLastFrame(lcellId_t size)
pmacc::SuperCellPMACC_ALIGN(firstFramePtr, TYPE *)
pmacc::SuperCellPMACC_ALIGN(lastFramePtr, TYPE *)

GridBuffer

template <class TYPE, unsigned DIM, class BORDERTYPE = TYPE>
class pmacc::GridBuffer

GridBuffer represents a DIM-dimensional buffer which exists on the host as well as on the device.

GridBuffer combines a HostBuffer and a DeviceBuffer with equal sizes. Additionally, it allows sending data from and receiving data to these buffers. Buffers consist of core data which may be surrounded by border data.

Template Parameters
  • TYPE: datatype for internal Host- and DeviceBuffer
  • DIM: dimension of the buffers
  • BORDERTYPE: optional type for border data in the buffers. TYPE is used by default.

Inherits from pmacc::HostDeviceBuffer< TYPE, DIM >

Public Types

typedef Parent::DataBoxType pmacc::GridBufferDataBoxType

Public Functions

pmacc::GridBufferGridBuffer(const GridLayout<DIM> &gridLayout, bool sizeOnDevice = false)

Constructor.

Parameters
  • gridLayout: layout of the buffers, including border-cells
  • sizeOnDevice: if true, size information exists on device, too.

pmacc::GridBufferGridBuffer(const DataSpace<DIM> &dataSpace, bool sizeOnDevice = false)

Constructor.

Parameters
  • dataSpace: DataSpace representing buffer size without border-cells
  • sizeOnDevice: if true, internal buffers must store their size additionally on the device (as we keep this information coherent with the host, it influences performance on host-device copies, but some algorithms on the device might need to know the size of the buffer)

pmacc::GridBufferGridBuffer(DeviceBuffer<TYPE, DIM> &otherDeviceBuffer, const GridLayout<DIM> &gridLayout, bool sizeOnDevice = false)

Constructor.

Parameters
  • otherDeviceBuffer: DeviceBuffer which should be used instead of creating own DeviceBuffer
  • gridLayout: layout of the buffers, including border-cells
  • sizeOnDevice: if true, internal buffers must store their size additionally on the device (as we keep this information coherent with the host, it influences performance on host-device copies, but some algorithms on the device might need to know the size of the buffer)

pmacc::GridBufferGridBuffer(HostBuffer<TYPE, DIM> &otherHostBuffer, const DataSpace<DIM> &offsetHost, DeviceBuffer<TYPE, DIM> &otherDeviceBuffer, const DataSpace<DIM> &offsetDevice, const GridLayout<DIM> &gridLayout, bool sizeOnDevice = false)
virtual pmacc::GridBuffer~GridBuffer()

Destructor.

void pmacc::GridBufferaddExchange(uint32_t dataPlace, const Mask &receive, DataSpace<DIM> guardingCells, uint32_t communicationTag, bool sizeOnDeviceSend, bool sizeOnDeviceReceive)

Add Exchange in GridBuffer memory space.

An Exchange is added to this GridBuffer. The exchange buffers use the same memory as this GridBuffer.

Parameters
  • dataPlace: place where received data is stored [GUARD | BORDER] if dataPlace=GUARD than copy other BORDER to my GUARD if dataPlace=BORDER than copy other GUARD to my BORDER
  • receive: a Mask which describes the directions for the exchange
  • guardingCells: number of guarding cells in each dimension
  • communicationTag: unique tag/id for communication
  • sizeOnDeviceSend: if true, internal send buffers must store their size additionally on the device (as we keep this information coherent with the host, it influences performance on host-device copies, but some algorithms on the device might need to know the size of the buffer)
  • sizeOnDeviceReceive: if true, internal receive buffers must store their size additionally on the device

void pmacc::GridBufferaddExchange(uint32_t dataPlace, const Mask &receive, DataSpace<DIM> guardingCells, uint32_t communicationTag, bool sizeOnDevice = false)

Add Exchange in GridBuffer memory space.

An Exchange is added to this GridBuffer. The exchange buffers use the same memory as this GridBuffer.

Parameters
  • dataPlace: place where received data is stored [GUARD | BORDER] if dataPlace=GUARD than copy other BORDER to my GUARD if dataPlace=BORDER than copy other GUARD to my BORDER
  • receive: a Mask which describes the directions for the exchange
  • guardingCells: number of guarding cells in each dimension
  • communicationTag: unique tag/id for communication
  • sizeOnDevice: if true, internal buffers must store their size additionally on the device (as we keep this information coherent with the host, it influences performance on host-device copies, but some algorithms on the device might need to know the size of the buffer)

void pmacc::GridBufferaddExchangeBuffer(const Mask &receive, const DataSpace<DIM> &dataSpace, uint32_t communicationTag, bool sizeOnDeviceSend, bool sizeOnDeviceReceive)

Add Exchange in dedicated memory space.

An Exchange is added to this GridBuffer. The exchange buffers use the their own memory instead of using the GridBuffer’s memory space.

Parameters
  • receive: a Mask which describes the directions for the exchange
  • dataSpace: size of the newly created exchange buffer in each dimension
  • communicationTag: unique tag/id for communication
  • sizeOnDeviceSend: if true, internal send buffers must store their size additionally on the device (as we keep this information coherent with the host, it influences performance on host-device copies, but some algorithms on the device might need to know the size of the buffer)
  • sizeOnDeviceReceive: if true, internal receive buffers must store their size additionally on the device

void pmacc::GridBufferaddExchangeBuffer(const Mask &receive, const DataSpace<DIM> &dataSpace, uint32_t communicationTag, bool sizeOnDevice = false)

Add Exchange in dedicated memory space.

An Exchange is added to this GridBuffer. The exchange buffers use the their own memory instead of using the GridBuffer’s memory space.

Parameters
  • receive: a Mask which describes the directions for the exchange
  • dataSpace: size of the newly created exchange buffer in each dimension
  • communicationTag: unique tag/id for communication
  • sizeOnDevice: if true, internal buffers must store their size additionally on the device (as we keep this information coherent with the host, it influences performance on host-device copies, but some algorithms on the device might need to know the size of the buffer)

bool pmacc::GridBufferhasSendExchange(uint32_t ex) const

Returns whether this GridBuffer has an Exchange for sending in ex direction.

Return
true if send exchanges with ex direction exist, otherwise false
Parameters
  • ex: exchange direction to query

bool pmacc::GridBufferhasReceiveExchange(uint32_t ex) const

Returns whether this GridBuffer has an Exchange for receiving from ex direction.

Return
true if receive exchanges with ex direction exist, otherwise false
Parameters
  • ex: exchange direction to query

Exchange<BORDERTYPE, DIM> &pmacc::GridBuffergetSendExchange(uint32_t ex) const

Returns the Exchange for sending data in ex direction.

Returns an Exchange which for sending data from this GridBuffer in the direction described by ex.

Return
the Exchange for sending data
Parameters
  • ex: the direction to query

Exchange<BORDERTYPE, DIM> &pmacc::GridBuffergetReceiveExchange(uint32_t ex) const

Returns the Exchange for receiving data from ex direction.

Returns an Exchange which for receiving data to this GridBuffer from the direction described by ex.

Return
the Exchange for receiving data
Parameters
  • ex: the direction to query

Mask pmacc::GridBuffergetSendMask() const

Returns the Mask describing send exchanges.

Return
Mask for send exchanges

Mask pmacc::GridBuffergetReceiveMask() const

Returns the Mask describing receive exchanges.

Return
Mask for receive exchanges

EventTask pmacc::GridBuffercommunication()

Starts sync data from own device buffer to neighbor device buffer.

Asynchronously starts synchronization data from internal DeviceBuffer using added Exchange buffers. This operation runs sequential to other code but intern asynchronous

EventTask pmacc::GridBufferasyncCommunication(EventTask serialEvent)

Starts sync data from own device buffer to neighbor device buffer.

Asynchronously starts synchronization data from internal DeviceBuffer using added Exchange buffers.

EventTask pmacc::GridBufferasyncSend(EventTask serialEvent, uint32_t sendEx)
EventTask pmacc::GridBufferasyncReceive(EventTask serialEvent, uint32_t recvEx)
GridLayout<DIM> pmacc::GridBuffergetGridLayout()

Returns the GridLayout describing this GridBuffer.

Return
the layout of this buffer

Protected Attributes

bool pmacc::GridBufferhasOneExchange
uint32_t pmacc::GridBufferlastUsedCommunicationTag
GridLayout<DIM> pmacc::GridBuffergridLayout
Mask pmacc::GridBuffersendMask
Mask pmacc::GridBufferreceiveMask
template<>
ExchangeIntern<BORDERTYPE, DIM> *pmacc::GridBuffer<TYPE, DIM, BORDERTYPE>sendExchanges[27]
template<>
ExchangeIntern<BORDERTYPE, DIM> *pmacc::GridBuffer<TYPE, DIM, BORDERTYPE>receiveExchanges[27]
template<>
EventTask pmacc::GridBuffer<TYPE, DIM, BORDERTYPE>receiveEvents[27]
template<>
EventTask pmacc::GridBuffer<TYPE, DIM, BORDERTYPE>sendEvents[27]
uint32_t pmacc::GridBuffermaxExchange

SimulationFieldHelper

template <class CellDescription>
class pmacc::SimulationFieldHelper

Public Types

typedef CellDescription pmacc::SimulationFieldHelperMappingDesc

Public Functions

pmacc::SimulationFieldHelperSimulationFieldHelper(CellDescription description)
virtual pmacc::SimulationFieldHelper~SimulationFieldHelper()
virtual void pmacc::SimulationFieldHelperreset(uint32_t currentStep) = 0

Reset is as well used for init.

virtual void pmacc::SimulationFieldHelpersyncToDevice() = 0

Synchronize data from host to device.

Protected Attributes

CellDescription pmacc::SimulationFieldHelpercellDescription

ParticlesBase

template <typename T_ParticleDescription, class T_MappingDesc, typename T_DeviceHeap>
class pmacc::ParticlesBase

Inherits from pmacc::SimulationFieldHelper< T_MappingDesc >

Public Types

enum [anonymous]::ParticlesBase__anonymous27

Values:

pmacc::ParticlesBaseDim = MappingDesc::Dim
pmacc::ParticlesBaseExchanges = traits::NumberOfExchanges<Dim>::value
pmacc::ParticlesBaseTileSize = math::CT::volume<typename MappingDesc::SuperCellSize>::type::value
typedef ParticlesBuffer<ParticleDescription, typename MappingDesc::SuperCellSize, T_DeviceHeap, MappingDesc::Dim> pmacc::ParticlesBaseBufferType
typedef BufferType::FrameType pmacc::ParticlesBaseFrameType
typedef BufferType::FrameTypeBorder pmacc::ParticlesBaseFrameTypeBorder
typedef BufferType::ParticlesBoxType pmacc::ParticlesBaseParticlesBoxType
typedef ParticleDescription::HandleGuardRegion pmacc::ParticlesBaseHandleGuardRegion
typedef ParticlesTag pmacc::ParticlesBaseSimulationDataTag

Public Functions

void pmacc::ParticlesBasefillAllGaps()
void pmacc::ParticlesBasefillBorderGaps()
void pmacc::ParticlesBasedeleteGuardParticles(uint32_t exchangeType)
template <uint32_t T_area>
void pmacc::ParticlesBasedeleteParticlesInArea()
void pmacc::ParticlesBasecopyGuardToExchange(uint32_t exchangeType)

copy gard particles to intermediate exchange buffer

Copy all particles from the guard of a direction to the device exchange buffer.

void pmacc::ParticlesBaseinsertParticles(uint32_t exchangeType)
ParticlesBoxType pmacc::ParticlesBasegetDeviceParticlesBox()
ParticlesBoxType pmacc::ParticlesBasegetHostParticlesBox(const int64_t memoryOffset)
BufferType &pmacc::ParticlesBasegetParticlesBuffer()
void pmacc::ParticlesBasereset(uint32_t currentStep)

Reset is as well used for init.

Protected Functions

pmacc::ParticlesBaseParticlesBase(const std::shared_ptr<T_DeviceHeap> &deviceHeap, MappingDesc description)
virtual pmacc::ParticlesBase~ParticlesBase()
template <uint32_t AREA>
void pmacc::ParticlesBaseshiftParticles()
template <uint32_t AREA>
void pmacc::ParticlesBasefillGaps()

Protected Attributes

BufferType *pmacc::ParticlesBaseparticlesBuffer

ParticleDescription

Warning

doxygenclass: Cannot find class “pmacc::ParticleDescription” in doxygen xml output for project “PIConGPU” from directory: ../xml

ParticleBox

Warning

doxygenclass: Cannot find class “pmacc::ParticleBox” in doxygen xml output for project “PIConGPU” from directory: ../xml

Frame

Warning

doxygenclass: Cannot find class “pmacc::Frame” in doxygen xml output for project “PIConGPU” from directory: ../xml

IPlugin

class pmacc::IPlugin

Inherits from pmacc::INotify

Subclassed by picongpu::ISimulationPlugin, picongpu::ISimulationStarter, pmacc::SimulationHelper< DIM >, pmacc::SimulationHelper< simDim >

Public Functions

pmacc::IPluginIPlugin()
virtual pmacc::IPlugin~IPlugin()
virtual void pmacc::IPluginload()
virtual void pmacc::IPluginunload()
bool pmacc::IPluginisLoaded()
virtual void pmacc::IPlugincheckpoint(uint32_t currentStep, const std::string checkpointDirectory) = 0

Notifies plugins that a (restartable) checkpoint should be created for this timestep.

Parameters
  • currentStep: cuurent simulation iteration step
  • checkpointDirectory: common directory for checkpoints

virtual void pmacc::IPluginrestart(uint32_t restartStep, const std::string restartDirectory) = 0

Restart notification callback.

Parameters
  • restartStep: simulation iteration step to restart from
  • restartDirectory: common restart directory (contains checkpoints)

virtual void pmacc::IPluginpluginRegisterHelp(po::options_description &desc) = 0

Register command line parameters for this plugin.

Parameters are parsed and set prior to plugin load.

Parameters
  • desc: boost::program_options description

virtual std::string pmacc::IPluginpluginGetName() const = 0

Return the name of this plugin for status messages.

Return
plugin name

virtual void pmacc::IPluginonParticleLeave(const std::string&, const int32_t)

Called each timestep if particles are leaving the global simulation volume.

This method is only called for species which are marked with the GuardHandlerCallPlugins policy in their descpription.

The order in which the plugins are called is undefined, so this means read-only access to the particles.

Parameters
  • speciesName: name of the particle species
  • direction: the direction the particles are leaving the simulation

uint32_t pmacc::IPlugingetLastCheckpoint() const

When was the plugin checkpointed last?

Return
last checkpoint’s time step

void pmacc::IPluginsetLastCheckpoint(uint32_t currentStep)

Remember last checkpoint call.

Parameters
  • currentStep: current simulation iteration step

Protected Functions

virtual void pmacc::IPluginpluginLoad()
virtual void pmacc::IPluginpluginUnload()

Protected Attributes

bool pmacc::IPluginloaded
uint32_t pmacc::IPluginlastCheckpoint

PluginConnector

class pmacc::PluginConnector

Plugin registration and management class.

Public Functions

void pmacc::PluginConnectorregisterPlugin(IPlugin *plugin)

Register a plugin for loading/unloading and notifications.

Plugins are loaded in the order they are registered and unloaded in reverse order. To trigger plugin notifications, call

See
setNotificationPeriod after registration.
Parameters
  • plugin: plugin to register

void pmacc::PluginConnectorloadPlugins()

Calls load on all registered, not loaded plugins.

void pmacc::PluginConnectorunloadPlugins()

Unloads all registered, loaded plugins.

std::list<po::options_description> pmacc::PluginConnectorregisterHelp()

Publishes command line parameters for registered plugins.

Return
list of boost program_options command line parameters

void pmacc::PluginConnectorsetNotificationPeriod(INotify *notifiedObj, std::string const &period)

Set the notification period.

Parameters
  • notifiedObj: the object to notify, e.g. an IPlugin instance
  • period: notification period

void pmacc::PluginConnectornotifyPlugins(uint32_t currentStep)

Notifies plugins that data should be dumped.

Parameters
  • currentStep: current simulation iteration step

void pmacc::PluginConnectorcheckpointPlugins(uint32_t currentStep, const std::string checkpointDirectory)

Notifies plugins that a restartable checkpoint should be dumped.

Parameters
  • currentStep: current simulation iteration step
  • checkpointDirectory: common directory for checkpoints

void pmacc::PluginConnectorrestartPlugins(uint32_t restartStep, const std::string restartDirectory)

Notifies plugins that a restart is required.

Parameters
  • restartStep: simulation iteration to restart from
  • restartDirectory: common restart directory (contains checkpoints)

template <typename Plugin>
std::vector<Plugin *> pmacc::PluginConnectorgetPluginsFromType()

Get a vector of pointers of all registered plugin instances of a given type.

Return
vector of plugin pointers
Template Parameters
  • Plugin: type of plugin

std::list<IPlugin *> pmacc::PluginConnectorgetAllPlugins() const

Return a copied list of pointers to all registered plugins.

Friends

friend pmacc::PluginConnector::detail::Environment

SimulationHelper

template <unsigned DIM>
class pmacc::SimulationHelper

Abstract base class for simulations.

Use this helper class to write your own concrete simulations by binding pure virtual methods.

Template Parameters
  • DIM: base dimension for the simulation (2-3)

Inherits from pmacc::IPlugin

Public Types

template<>
using pmacc::SimulationHelper<DIM>SeqOfTimeSlices = std::vector<pluginSystem::TimeSlice>

Public Functions

pmacc::SimulationHelperSimulationHelper()

Constructor.

virtual pmacc::SimulationHelper~SimulationHelper()
virtual void pmacc::SimulationHelperrunOneStep(uint32_t currentStep) = 0

Must describe one iteration (step).

This function is called automatically.

virtual void pmacc::SimulationHelperinit() = 0

Initialize simulation.

Does hardware selections/reservations, memory allocations and initializes data structures as empty.

virtual uint32_t pmacc::SimulationHelperfillSimulation() = 0

Fills simulation with initial data after init()

Return
returns the first step of the simulation (can be >0 for, e.g., restarts from checkpoints)

virtual void pmacc::SimulationHelperresetAll(uint32_t currentStep) = 0

Reset the simulation to a state such as it was after init() but for a specific time step.

Can be used to call fillSimulation() again.

virtual void pmacc::SimulationHelpermovingWindowCheck(uint32_t currentStep) = 0

Check if moving window work must do.

If no moving window is needed the implementation of this function can be empty

Parameters
  • currentStep: simulation step

virtual void pmacc::SimulationHelperdumpOneStep(uint32_t currentStep)

Notifies registered output classes.

This function is called automatically.

Parameters
  • currentStep: simulation step

GridController<DIM> &pmacc::SimulationHelpergetGridController()
void pmacc::SimulationHelperdumpTimes(TimeIntervall &tSimCalculation, TimeIntervall&, double &roundAvg, uint32_t currentStep)
void pmacc::SimulationHelperstartSimulation()

Begin the simulation.

virtual void pmacc::SimulationHelperpluginRegisterHelp(po::options_description &desc)

Register command line parameters for this plugin.

Parameters are parsed and set prior to plugin load.

Parameters
  • desc: boost::program_options description

std::string pmacc::SimulationHelperpluginGetName() const

Return the name of this plugin for status messages.

Return
plugin name

void pmacc::SimulationHelperpluginLoad()
void pmacc::SimulationHelperpluginUnload()
void pmacc::SimulationHelperrestart(uint32_t restartStep, const std::string restartDirectory)

Restart notification callback.

Parameters
  • restartStep: simulation iteration step to restart from
  • restartDirectory: common restart directory (contains checkpoints)

void pmacc::SimulationHelpercheckpoint(uint32_t currentStep, const std::string checkpointDirectory)

Notifies plugins that a (restartable) checkpoint should be created for this timestep.

Parameters
  • currentStep: cuurent simulation iteration step
  • checkpointDirectory: common directory for checkpoints

Protected Functions

std::vector<uint32_t> pmacc::SimulationHelperreadCheckpointMasterFile()

Reads the checkpoint master file if any and returns all found checkpoint steps.

Return
vector of found checkpoints steps in order they appear in the file

Protected Attributes

uint32_t pmacc::SimulationHelperrunSteps
uint32_t pmacc::SimulationHelpersoftRestarts

Presentations: loop the whole simulation softRestarts times from initial step to runSteps.

std::string pmacc::SimulationHelpercheckpointPeriod
SeqOfTimeSlices pmacc::SimulationHelperseqCheckpointPeriod
std::string pmacc::SimulationHelpercheckpointDirectory
uint32_t pmacc::SimulationHelpernumCheckpoints
int32_t pmacc::SimulationHelperrestartStep
std::string pmacc::SimulationHelperrestartDirectory
bool pmacc::SimulationHelperrestartRequested
const std::string pmacc::SimulationHelperCHECKPOINT_MASTER_FILE
std::string pmacc::SimulationHelperauthor

ForEach

template <typename T_MPLSeq, typename T_Functor, typename T_Accessor = compileTime::accessors::Identity< >>
struct pmacc::algorithms::forEach::ForEach

Compile-Time for each for Boost::MPL Type Lists.

Example: MPLSeq = boost::mpl::vector<int,float> Functor = any unary lambda functor Accessor = lambda operation identity

Template Parameters
  • T_MPLSeq: A mpl sequence that can be accessed by mpl::begin, mpl::end, mpl::next
  • T_Functor: An unary lambda functor with a HDINLINE void operator()(…) method _1 is substituted by Accessor’s result using boost::mpl::apply with elements from T_MPLSeq. The maximum number of parameters for the operator() is limited by PMACC_MAX_FUNCTOR_OPERATOR_PARAMS
  • T_Accessor: An unary lambda operation

definition: F(X) means boost::apply<F,X>

call: ForEach<MPLSeq,Functor,Accessor>()(42); unrolled code: Functor(Accessor(int))(42); Functor(Accessor(float))(42);

Public Types

typedef bmpl::transform<T_MPLSeq, ReplacePlaceholder<bmpl::_1>>::type pmacc::algorithms::forEach::ForEachSolvedFunctors
typedef boost::mpl::begin<SolvedFunctors>::type pmacc::algorithms::forEach::ForEachbegin
typedef boost::mpl::end<SolvedFunctors>::type pmacc::algorithms::forEach::ForEachend
typedef detail::CallFunctorOfIterator<begin, end> pmacc::algorithms::forEach::ForEachNextCall
typedef detail::CallFunctorOfIterator<end, end> pmacc::algorithms::forEach::ForEachFunctor

Public Functions

template <typename… T_Types>
PMACC_NO_NVCC_HDWARNING HDINLINE void pmacc::algorithms::forEach::ForEach::operator()(const T_Types &... ts) const
template <typename… T_Types>
PMACC_NO_NVCC_HDWARNING HDINLINE void pmacc::algorithms::forEach::ForEach::operator()(const T_Types &... ts)
template <typename X>
struct pmacc::algorithms::forEach::ForEachReplacePlaceholder

Inherits from boost::mpl::apply1< T_Functor, bmpl::apply1< T_Accessor, X >::type >

Kernel Start

template <typename T_KernelFunctor>
struct pmacc::exec::Kernel

wrapper for the user kernel functor

contains debug information like filename and line of the kernel call

Public Types

template<>
using pmacc::exec::Kernel<T_KernelFunctor>KernelType = T_KernelFunctor

Public Functions

HINLINE pmacc::exec::KernelKernel(T_KernelFunctor const &kernelFunctor, std::string const &file = std::string(), size_t const line = 0)

Return
Parameters
  • gridExtent: grid extent configuration for the kernel
  • blockExtent: block extent configuration for the kernel
  • sharedMemByte: dynamic shared memory used by the kernel (in byte )

template <typename T_VectorGrid, typename T_VectorBlock>
HINLINE auto pmacc::exec::Kernel::operator()(T_VectorGrid const & gridExtent, T_VectorBlock const & blockExtent, size_t const sharedMemByte = 0) const

configured kernel object

this objects contains the functor and the starting parameter

Template Parameters
  • T_VectorGrid: type which defines the grid extents (type must be castable to CUDA dim3)
  • T_VectorBlock: type which defines the block extents (type must be castable to CUDA dim3)
Parameters
  • gridExtent: grid extent configuration for the kernel
  • blockExtent: block extent configuration for the kernel
  • sharedMemByte: dynamic shared memory used by the kernel (in byte)

Public Members

T_KernelFunctor const pmacc::exec::Kernelm_kernelFunctor

functor

std::string const pmacc::exec::Kernelm_file

file name from where the kernel is called

size_t const pmacc::exec::Kernelm_line

line number in the file

PMACC_KERNEL(...)

create a kernel object out of a functor instance

this macro add the current filename and line number to the kernel object

Parameters
  • ...: instance of kernel functor

Struct Factory

Syntax to generate structs with all members inline. Allows to conveniently switch between variable and constant defined members without the need to declare or initialize them externally. See for example PIConGPU’s density.param for usage.

PMACC_STRUCT(name, ...)

generate a struct with static and dynamic members

PMACC_STRUCT(StructAlice,
    // constant member variable
    (PMACC_C_VALUE(float, varFoo, -1.0))
    // lvalue member variable
    (PMACC_VALUE(float, varFoo, -1.0))
    // constant vector member variable
    (PMACC_C_VECTOR_DIM(double, 3, vectorBarC, 1.134e-5, 1.134e-5, 1.134e-5))
    // lvalue vector member variable
    (PMACC_VECTOR_DIM(double, 3, vectorBarC, 1.134e-5, 1.134e-5, 1.134e-5))
    // constant string member variable
    (PMACC_C_STRING(someString, "anythingYouWant: even spaces!"))
    // plain C++ member
    PMACC_EXTENT(
        using float_64 = double;
        static constexpr int varBar = 42;
    );
);
Note
do not forget the surrounding parenthesize for each element of a sequence
Parameters

PMACC_C_VECTOR_DIM(type, dim, name, ...)

create static const member vector that needs no memory inside of the struct

PMACC_C_VECTOR_DIM(float_64, simDim, center_SI, 1.134e-5, 1.134e-5, 1.134e-5);
// is syntactically equivalent to
static const Vector<float_64,simDim> center_SI = Vector<float_64,simDim>(1.134e-5, 1.134e-5, 1.134e-5);
Parameters
  • type: type of an element
  • dim: number of vector components
  • name: member variable name
  • ...: enumeration of init values (number of components must be greater or equal than dim)

PMACC_C_VALUE(type, name, value)

create static constexpr member

PMACC_C_VALUE(float_64, power_SI, 2.0);
// is syntactically equivalent to
static constexpr float_64 power_SI = float_64(2.0);
Parameters
  • type: type of the member
  • name: member variable name
  • value: init value

PMACC_VALUE(type, name, initValue)

create changeable member

PMACC_VALUE(float_64, power_SI, 2.0);
// is the equivalent of
float_64 power_SI(2.0);
Parameters
  • type: type of the member
  • name: member variable name
  • value: init value

PMACC_VECTOR(type, name, ...)

create changeable member vector

PMACC_VECTOR(float2_64, center_SI, 1.134e-5, 1.134e-5);
// is the equivalent of
float2_64 center_SI(1.134e-5, 1.134e-5);
Parameters
  • type: type of an element
  • name: member variable name
  • ...: enumeration of init values

PMACC_VECTOR_DIM(type, dim, name, ...)

create changeable member vector

PMACC_VECTOR_DIM(float_64, simDim, center_SI, 1.134e-5, 1.134e-5, 1.134e-5);
// is the equivalent of
Vector<float_64,3> center_SI(1.134e-5, 1.134e-5, 1.134e-5);
Parameters
  • type: type of an element
  • dim: number of vector components
  • name: member variable name
  • ...: enumeration of init values (number of components must be equal to dim)

PMACC_C_STRING(name, initValue)

create static const character string

PMACC_C_STRING(filename, "fooFile.txt");
// is syntactically equivalent to
static const char* filename = (char*)"fooFile.txt";
Parameters
  • name: member variable name
  • char_string: character string

PMACC_EXTENT(...)

create any code extension

PMACC_EXTENT(typedef float FooFloat;)
// is the equivalent of
typedef float FooFloat;
Parameters
  • ...: any code

Identifier

Construct unique types, e.g. to name, access and assign default values to particle species’ attributes. See for example PIConGPU’s speciesAttributes.param for usage.

value_identifier(in_type, name, in_default)

define a unique identifier with name, type and a default value

The created identifier has the following options: getValue() - return the user defined value getName() - return the name of the identifier ::type - get type of the value

Parameters
  • in_type: type of the value
  • name: name of identifier
  • in_value: user defined value of in_type (can be a constructor of a class)

e.g. value_identifier(float,length,0.0f) typedef length::type value_type; // is float value_type x = length::getValue(); //set x to 0.f printf(“Identifier name: %s”,length::getName()); //print Identifier name: length

to create a instance of this value_identifier you can use: length() or length_

alias(name)

create an alias

an alias is a unspecialized type of an identifier or a value_identifier

example: alias(aliasName); //create type varname

Parameters
  • name: name of alias

to specialize an alias do: aliasName<valueIdentifierName> to create an instance of this alias you can use: aliasName(); or aliasName_

get type which is represented by the alias typedef typename traits::Resolve<name>::type resolved_type;