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::Environment
GridController
()¶ get the singleton GridController
- Return
- instance of GridController
-
PMacc::SubGrid<T_dim> &PMacc::Environment
SubGrid
()¶ get the singleton SubGrid
- Return
- instance of SubGrid
-
PMacc::Filesystem<T_dim> &PMacc::Environment
Filesystem
()¶ get the singleton Filesystem
- Return
- instance of Filesystem
-
void PMacc::Environment
initDevices
(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 dimensionperiodic
: periodicity each simulation dimension (0 == not periodic, 1 == periodic)
-
void PMacc::Environment
initGrids
(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::Environment
Environment
(const Environment&)¶
-
Environment &PMacc::Environment
operator=
(const Environment&)¶
Public Static Functions
-
static Environment<T_dim> &PMacc::Environment
get
()¶ get the singleton Environment< DIM >
- Return
- instance of Environment<DIM >
-
PMacc::GridController<T_dim> &PMacc::Environment
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::DataConnector
hasId
(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::DataConnector
initialise
(AbstractInitialiser &initialiser, uint32_t currentStep)¶ Initialises all Datasets using initialiser.
After initialising, the Datasets will be invalid.
- Parameters
initialiser
: class used for initialising DatasetscurrentStep
: current simulation step
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
End sharing a dataset with identifier id.
- Parameters
id
: id of the dataset to remove
-
void PMacc::DataConnector
clean
()¶ Unshare all associated datasets.
- template <class TYPE>
-
std::shared_ptr<TYPE> PMacc::DataConnector
get
(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 fromnoSync
: indicates that no synchronization should be performed, regardless of dataset status
-
void PMacc::DataConnector
releaseData
(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
-
bool PMacc::DataConnector
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 Functions
-
HDINLINE PMacc::DataSpace
DataSpace
(dim3 value)¶ constructor.
Sets size of all dimensions from cuda dim3.
-
HDINLINE PMacc::DataSpace
DataSpace
(uint3 value)¶ constructor.
Sets size of all dimensions from cuda uint3 (e.g. threadIdx/blockIdx)
-
HDINLINE PMacc::DataSpace
DataSpace
(int x)¶ Constructor for DIM1-dimensional DataSpace.
- Parameters
x
: size of first dimension
-
HDINLINE PMacc::DataSpace
DataSpace
(int x, int y)¶ Constructor for DIM2-dimensional DataSpace.
- Parameters
x
: size of first dimensiony
: size of second dimension
-
HDINLINE PMacc::DataSpace
DataSpace
(int x, int y, int z)¶ Constructor for DIM3-dimensional DataSpace.
- Parameters
x
: size of first dimensiony
: size of second dimensionz
: size of third dimension
-
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
other
: DataSpace to compare with
Public Static Functions
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 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)
-
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 DeviceBufferDIM
: dimension of the buffersBORDERTYPE
: 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::GridBuffer
DataBoxType
¶
Public Functions
-
PMacc::GridBuffer
GridBuffer
(const GridLayout<DIM> &gridLayout, bool sizeOnDevice = false)¶ Constructor.
- Parameters
gridLayout
: layout of the buffers, including border-cellssizeOnDevice
: if true, size information exists on device, too.
-
PMacc::GridBuffer
GridBuffer
(const DataSpace<DIM> &dataSpace, bool sizeOnDevice = false)¶ Constructor.
- Parameters
dataSpace
: DataSpace representing buffer size without border-cellssizeOnDevice
: 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::GridBuffer
GridBuffer
(DeviceBuffer<TYPE, DIM> &otherDeviceBuffer, const GridLayout<DIM> &gridLayout, bool sizeOnDevice = false)¶ Constructor.
- Parameters
otherDeviceBuffer
: DeviceBuffer which should be used instead of creating own DeviceBuffergridLayout
: layout of the buffers, including border-cellssizeOnDevice
: 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::GridBuffer
GridBuffer
(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::GridBuffer
addExchange
(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 BORDERreceive
: a Mask which describes the directions for the exchangeguardingCells
: number of guarding cells in each dimensioncommunicationTag
: unique tag/id for communicationsizeOnDeviceSend
: 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::GridBuffer
addExchange
(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 BORDERreceive
: a Mask which describes the directions for the exchangeguardingCells
: number of guarding cells in each dimensioncommunicationTag
: unique tag/id for communicationsizeOnDevice
: 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::GridBuffer
addExchangeBuffer
(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 exchangedataSpace
: size of the newly created exchange buffer in each dimensioncommunicationTag
: unique tag/id for communicationsizeOnDeviceSend
: 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::GridBuffer
addExchangeBuffer
(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 exchangedataSpace
: size of the newly created exchange buffer in each dimensioncommunicationTag
: unique tag/id for communicationsizeOnDevice
: 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::GridBuffer
hasSendExchange
(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::GridBuffer
hasReceiveExchange
(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::GridBuffer
getSendExchange
(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::GridBuffer
getReceiveExchange
(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::GridBuffer
getSendMask
() const¶ Returns the Mask describing send exchanges.
- Return
- Mask for send exchanges
-
Mask PMacc::GridBuffer
getReceiveMask
() const¶ Returns the Mask describing receive exchanges.
- Return
- Mask for receive exchanges
-
EventTask PMacc::GridBuffer
communication
()¶ 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::GridBuffer
asyncCommunication
(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::GridBuffer
asyncSend
(EventTask serialEvent, uint32_t sendEx)¶
-
EventTask PMacc::GridBuffer
asyncReceive
(EventTask serialEvent, uint32_t recvEx)¶
-
GridLayout<DIM> PMacc::GridBuffer
getGridLayout
()¶ Returns the GridLayout describing this GridBuffer.
- Return
- the layout of this buffer
Protected Attributes
-
bool PMacc::GridBuffer
hasOneExchange
¶
-
uint32_t PMacc::GridBuffer
lastUsedCommunicationTag
¶
-
GridLayout<DIM> PMacc::GridBuffer
gridLayout
¶
-
Mask PMacc::GridBuffer
sendMask
¶
-
Mask PMacc::GridBuffer
receiveMask
¶
-
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::GridBuffer
maxExchange
¶
SimulationFieldHelper¶
- template <class CellDescription>
-
class PMacc
::
SimulationFieldHelper
¶ Public Types
-
typedef CellDescription PMacc::SimulationFieldHelper
MappingDesc
¶
Public Functions
-
PMacc::SimulationFieldHelper
SimulationFieldHelper
(CellDescription description)¶
-
virtual PMacc::SimulationFieldHelper
~SimulationFieldHelper
()¶
-
virtual void PMacc::SimulationFieldHelper
reset
(uint32_t currentStep) = 0¶ Reset is as well used for init.
-
virtual void PMacc::SimulationFieldHelper
syncToDevice
() = 0¶ Synchronize data from host to device.
Protected Attributes
-
CellDescription PMacc::SimulationFieldHelper
cellDescription
¶
-
typedef CellDescription PMacc::SimulationFieldHelper
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
__anonymous23
¶ Values:
-
PMacc::ParticlesBase
Dim
= MappingDesc::Dim¶
-
PMacc::ParticlesBase
Exchanges
= traits::NumberOfExchanges<Dim>::value¶
-
PMacc::ParticlesBase
TileSize
= math::CT::volume<typename MappingDesc::SuperCellSize>::type::value¶
-
PMacc::ParticlesBase
-
typedef ParticlesBuffer<ParticleDescription, typename MappingDesc::SuperCellSize, T_DeviceHeap, MappingDesc::Dim> PMacc::ParticlesBase
BufferType
¶
-
typedef BufferType::FrameType PMacc::ParticlesBase
FrameType
¶
-
typedef BufferType::FrameTypeBorder PMacc::ParticlesBase
FrameTypeBorder
¶
-
typedef BufferType::ParticlesBoxType PMacc::ParticlesBase
ParticlesBoxType
¶
-
typedef ParticleDescription::HandleGuardRegion PMacc::ParticlesBase
HandleGuardRegion
¶
-
typedef ParticlesTag PMacc::ParticlesBase
SimulationDataTag
¶
Public Functions
-
void PMacc::ParticlesBase
fillAllGaps
()¶
-
void PMacc::ParticlesBase
fillBorderGaps
()¶
-
void PMacc::ParticlesBase
deleteGuardParticles
(uint32_t exchangeType)¶
- template <uint32_t T_area>
-
void PMacc::ParticlesBase
deleteParticlesInArea
()¶
-
void PMacc::ParticlesBase
bashParticles
(uint32_t exchangeType)¶
-
void PMacc::ParticlesBase
insertParticles
(uint32_t exchangeType)¶
-
ParticlesBoxType PMacc::ParticlesBase
getDeviceParticlesBox
()¶
-
ParticlesBoxType PMacc::ParticlesBase
getHostParticlesBox
(const int64_t memoryOffset)¶
-
BufferType &PMacc::ParticlesBase
getParticlesBuffer
()¶
-
void PMacc::ParticlesBase
reset
(uint32_t currentStep)¶ Reset is as well used for init.
Protected Functions
-
virtual PMacc::ParticlesBase
~ParticlesBase
()¶
- template <uint32_t AREA>
-
void PMacc::ParticlesBase
shiftParticles
()¶
- template <uint32_t AREA>
-
void PMacc::ParticlesBase
fillGaps
()¶
Protected Attributes
-
BufferType *PMacc::ParticlesBase
particlesBuffer
¶
-
enum [anonymous]::ParticlesBase
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
-
virtual void PMacc::IPlugin
checkpoint
(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 stepcheckpointDirectory
: common directory for checkpoints
-
virtual void PMacc::IPlugin
restart
(uint32_t restartStep, const std::string restartDirectory) = 0¶ Restart notification callback.
- Parameters
restartStep
: simulation iteration step to restart fromrestartDirectory
: common restart directory (contains checkpoints)
-
virtual void PMacc::IPlugin
pluginRegisterHelp
(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::IPlugin
pluginGetName
() const = 0¶ Return the name of this plugin for status messages.
- Return
- plugin name
-
virtual void PMacc::IPlugin
onParticleLeave
(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 speciesdirection
: the direction the particles are leaving the simulation
Protected Functions
-
virtual void PMacc::IPlugin
PluginConnector¶
-
class PMacc
::
PluginConnector
¶ Plugin registration and management class.
Public Functions
-
void PMacc::PluginConnector
registerPlugin
(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::PluginConnector
loadPlugins
()¶ Calls load on all registered, not loaded plugins.
-
void PMacc::PluginConnector
unloadPlugins
()¶ Unloads all registered, loaded plugins.
-
std::list<po::options_description> PMacc::PluginConnector
registerHelp
()¶ Publishes command line parameters for registered plugins.
- Return
- list of boost program_options command line parameters
-
void PMacc::PluginConnector
setNotificationPeriod
(INotify *notifiedObj, uint32_t period)¶ Set the notification period.
- Parameters
notifiedObj
: the object to notify, e.g. an IPlugin instanceperiod
: notification period
-
void PMacc::PluginConnector
notifyPlugins
(uint32_t currentStep)¶ Notifies plugins that data should be dumped.
- Parameters
currentStep
: current simulation iteration step
-
void PMacc::PluginConnector
checkpointPlugins
(uint32_t currentStep, const std::string checkpointDirectory)¶ Notifies plugins that a restartable checkpoint should be dumped.
- Parameters
currentStep
: current simulation iteration stepcheckpointDirectory
: common directory for checkpoints
-
void PMacc::PluginConnector
restartPlugins
(uint32_t restartStep, const std::string restartDirectory)¶ Notifies plugins that a restart is required.
- Parameters
restartStep
: simulation iteration to restart fromrestartDirectory
: common restart directory (contains checkpoints)
- template <typename Plugin>
-
std::vector<Plugin *> PMacc::PluginConnector
getPluginsFromType
()¶ 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::PluginConnector
getAllPlugins
() const¶ Return a copied list of pointers to all registered plugins.
Friends
-
friend
PMacc::PluginConnector::detail::Environment
-
void PMacc::PluginConnector
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 Functions
-
PMacc::SimulationHelper
SimulationHelper
()¶ Constructor.
-
virtual PMacc::SimulationHelper
~SimulationHelper
()¶
-
virtual void PMacc::SimulationHelper
runOneStep
(uint32_t currentStep) = 0¶ Must describe one iteration (step).
This function is called automatically.
-
virtual void PMacc::SimulationHelper
init
() = 0¶ Initialize simulation.
Does hardware selections/reservations, memory allocations and initializes data structures as empty.
-
virtual uint32_t PMacc::SimulationHelper
fillSimulation
() = 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::SimulationHelper
resetAll
(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::SimulationHelper
movingWindowCheck
(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::SimulationHelper
dumpOneStep
(uint32_t currentStep)¶ Notifies registered output classes.
This function is called automatically.
- Parameters
currentStep
: simulation step
-
GridController<DIM> &PMacc::SimulationHelper
getGridController
()¶
-
void PMacc::SimulationHelper
dumpTimes
(TimeIntervall &tSimCalculation, TimeIntervall&, double &roundAvg, uint32_t currentStep)¶
-
void PMacc::SimulationHelper
startSimulation
()¶ Begin the simulation.
-
virtual void PMacc::SimulationHelper
pluginRegisterHelp
(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::SimulationHelper
pluginGetName
() const¶ Return the name of this plugin for status messages.
- Return
- plugin name
-
void PMacc::SimulationHelper
pluginLoad
()¶
-
void PMacc::SimulationHelper
pluginUnload
()¶
-
void PMacc::SimulationHelper
restart
(uint32_t restartStep, const std::string restartDirectory)¶ Restart notification callback.
- Parameters
restartStep
: simulation iteration step to restart fromrestartDirectory
: common restart directory (contains checkpoints)
-
void PMacc::SimulationHelper
checkpoint
(uint32_t currentStep, const std::string checkpointDirectory)¶ Notifies plugins that a (restartable) checkpoint should be created for this timestep.
- Parameters
currentStep
: cuurent simulation iteration stepcheckpointDirectory
: common directory for checkpoints
Protected Functions
-
std::vector<uint32_t> PMacc::SimulationHelper
readCheckpointMasterFile
()¶ 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::SimulationHelper
runSteps
¶
-
uint32_t PMacc::SimulationHelper
softRestarts
¶ Presentations: loop the whole simulation
softRestarts
times from initial step to runSteps.
-
uint32_t PMacc::SimulationHelper
checkpointPeriod
¶
-
std::string PMacc::SimulationHelper
checkpointDirectory
¶
-
uint32_t PMacc::SimulationHelper
numCheckpoints
¶
-
int32_t PMacc::SimulationHelper
restartStep
¶
-
std::string PMacc::SimulationHelper
restartDirectory
¶
-
bool PMacc::SimulationHelper
restartRequested
¶
-
const std::string PMacc::SimulationHelper
CHECKPOINT_MASTER_FILE
¶
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::nextT_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_PARAMST_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::ForEach
SolvedFunctors
¶
-
typedef boost::mpl::begin<SolvedFunctors>::type PMacc::algorithms::forEach::ForEach
begin
¶
-
typedef boost::mpl::end<SolvedFunctors>::type PMacc::algorithms::forEach::ForEach
end
¶
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)
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 Functions
-
HINLINE PMacc::exec::Kernel
Kernel
(T_KernelFunctor const &kernelFunctor, std::string const &file = std::string(), size_t const line = 0)¶ - Return
- Parameters
gridExtent
: grid extent configuration for the kernelblockExtent
: block extent configuration for the kernelsharedMemByte
: 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 kernelblockExtent
: block extent configuration for the kernelsharedMemByte
: dynamic shared memory used by the kernel (in byte)
-
HINLINE PMacc::exec::Kernel
-
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
name
: name of the struct...
: preprocessor sequence with TypeMemberPair’s e.g. (PMACC_C_VALUE(int,a,2))
-
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 elementdim
: number of vector componentsname
: 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 membername
: member variable namevalue
: 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 membername
: member variable namevalue
: 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 elementname
: 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 elementdim
: number of vector componentsname
: 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 namechar_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 valuename
: name of identifierin_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()
orlength_
-
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;