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
>
classEnvironment
: public pmacc::detail::Environment¶ Global Environment singleton for PMacc.
Public Functions
-
pmacc::GridController<T_dim> &
GridController
()¶ get the singleton GridController
- Return
instance of GridController
-
void
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
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]
-
Environment
(const Environment&)¶
-
Environment &
operator=
(const Environment&)¶
Public Static Functions
-
static Environment<T_dim> &
get
()¶ get the singleton Environment< DIM >
- Return
instance of Environment<DIM >
-
pmacc::GridController<T_dim> &
DataConnector¶
-
class
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
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
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
Register a new Dataset and share its ownership.
If a Dataset with the same id already exists, a runtime_error is thrown. (Check with DataConnector::hasId when necessary.)
- Parameters
data
: simulation data to share ownership
-
void
consume
(std::unique_ptr<ISimulationData> data)¶ Register a new Dataset and transfer its ownership.
If a Dataset with the same id already exists, a runtime_error is thrown. (Check with DataConnector::hasId when necessary.) The only difference from share() is transfer of ownership.
- Parameters
data
: simulation data to transfer ownership
-
void
deregister
(SimulationDataId id)¶ End sharing a dataset with identifier id.
- Parameters
id
: id of the dataset to remove
-
void
clean
()¶ Unshare all associated datasets.
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
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
DataSpace¶
-
template<unsigned
T_Dim
>
classDataSpace
: public pmacc::math::Vector<int, T_Dim>¶ A T_Dim-dimensional data space.
DataSpace describes a T_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
T_Dim
: dimension (1-3) of the dataspace
Public Types
-
template<>
usingBaseType
= math::Vector<int, T_Dim>¶
Public Functions
-
HDINLINE
DataSpace
()¶ default constructor.
Sets size of all dimensions to 0.
-
HDINLINE
DataSpace
(dim3 value)¶ constructor.
Sets size of all dimensions from cuda dim3.
-
HDINLINE
DataSpace
(uint3 value)¶ constructor.
Sets size of all dimensions from cuda uint3 (e.g. threadIdx/blockIdx)
-
HDINLINE
DataSpace
(int x)¶ Constructor for DIM1-dimensional DataSpace.
- Parameters
x
: size of first dimension
-
HDINLINE
DataSpace
(int x, int y)¶ Constructor for DIM2-dimensional DataSpace.
- Parameters
x
: size of first dimensiony
: size of second dimension
-
HDINLINE
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
DataSpace
(const BaseType &vec)¶
-
HDINLINE
DataSpace
(const math::Size_t<T_Dim> &vec)¶
-
HDINLINE int pmacc::DataSpace::getDim() const
Returns number of dimensions (T_Dim) of this DataSpace.
- Return
number of dimensions
-
HINLINE bool pmacc::DataSpace::isOneDimensionGreaterThan(const DataSpace < T_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
-
HDINLINE
operator math::Size_t<T_Dim>
() const¶
-
HDINLINE
operator dim3
() const¶
Public Static Functions
Public Static Attributes
-
constexpr int
Dim
= T_Dim¶
Vector¶
Warning
doxygenclass: Cannot find class “pmacc::Vector” in doxygen xml output for project “PIConGPU” from directory: ../xml
SuperCell¶
-
template<class
T_FrameType
>
classSuperCell
¶ Public Functions
-
HDINLINE
SuperCell
()¶
-
HDINLINE T_FrameType* pmacc::SuperCell::FirstFramePtr()
-
HDINLINE T_FrameType* pmacc::SuperCell::LastFramePtr()
-
HDINLINE T_FrameType const* pmacc::SuperCell::FirstFramePtr() const
-
HDINLINE T_FrameType const* pmacc::SuperCell::LastFramePtr() const
-
HDINLINE bool pmacc::SuperCell::mustShift() const
-
HDINLINE void pmacc::SuperCell::setMustShift(bool const value)
-
HDINLINE uint32_t pmacc::SuperCell::getSizeLastFrame() const
-
HDINLINE uint32_t pmacc::SuperCell::getNumParticles() const
-
HDINLINE void pmacc::SuperCell::setNumParticles(uint32_t const size)
-
PMACC_ALIGN
(firstFramePtr, T_FrameType *)¶
-
PMACC_ALIGN
(lastFramePtr, T_FrameType *)¶
-
HDINLINE
GridBuffer¶
-
template<class
TYPE
, unsignedDIM
, classBORDERTYPE
= TYPE>
classGridBuffer
: public pmacc::HostDeviceBuffer<TYPE, DIM>¶ 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.
Public Types
-
typedef Parent::DataBoxType
DataBoxType
¶
Public Functions
-
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.
-
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)
-
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)
-
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
~GridBuffer
()¶ Destructor.
-
void
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
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
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
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
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
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> &
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> &
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
getSendMask
() const¶ Returns the Mask describing send exchanges.
- Return
Mask for send exchanges
-
Mask
getReceiveMask
() const¶ Returns the Mask describing receive exchanges.
- Return
Mask for receive exchanges
-
EventTask
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
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
asyncSend
(EventTask serialEvent, uint32_t sendEx)¶
-
EventTask
asyncReceive
(EventTask serialEvent, uint32_t recvEx)¶
-
GridLayout<DIM>
getGridLayout
()¶ Returns the GridLayout describing this GridBuffer.
- Return
the layout of this buffer
Protected Attributes
-
bool
hasOneExchange
¶
-
uint32_t
lastUsedCommunicationTag
¶
-
GridLayout<DIM>
gridLayout
¶
-
Mask
sendMask
¶
-
Mask
receiveMask
¶
-
template<>
ExchangeIntern<BORDERTYPE, DIM> *sendExchanges
[27]¶
-
template<>
ExchangeIntern<BORDERTYPE, DIM> *receiveExchanges
[27]¶
-
template<>
EventTaskreceiveEvents
[27]¶
-
template<>
EventTasksendEvents
[27]¶
-
uint32_t
maxExchange
¶
SimulationFieldHelper¶
-
template<class
CellDescription
>
classSimulationFieldHelper
¶ Public Types
-
typedef CellDescription
MappingDesc
¶
Public Functions
-
SimulationFieldHelper
(CellDescription description)¶
-
virtual
~SimulationFieldHelper
()¶
-
virtual void
reset
(uint32_t currentStep) = 0¶ Reset is as well used for init.
-
virtual void
syncToDevice
() = 0¶ Synchronize data from host to device.
-
CellDescription
getCellDescription
() const¶
Protected Attributes
-
CellDescription
cellDescription
¶
-
typedef CellDescription
ParticlesBase¶
-
template<typename
T_ParticleDescription
, classT_MappingDesc
, typenameT_DeviceHeap
>
classParticlesBase
: public pmacc::SimulationFieldHelper<T_MappingDesc>¶ Public Types
-
enum [anonymous]¶
Values:
-
Dim
= MappingDesc::Dim¶
-
TileSize
= math::CT::volume<typename MappingDesc::SuperCellSize>::type::value¶
-
-
typedef ParticlesBuffer<ParticleDescription, typename MappingDesc::SuperCellSize, T_DeviceHeap, MappingDesc::Dim>
BufferType
¶
-
typedef BufferType::FrameType
FrameType
¶
-
typedef BufferType::FrameTypeBorder
FrameTypeBorder
¶
-
typedef BufferType::ParticlesBoxType
ParticlesBoxType
¶
-
typedef ParticleDescription::HandleGuardRegion
HandleGuardRegion
¶
-
typedef ParticlesTag
SimulationDataTag
¶
Public Functions
-
void
fillAllGaps
()¶
-
void
fillBorderGaps
()¶
-
void
deleteGuardParticles
(uint32_t exchangeType)¶
-
template<uint32_t
T_area
>
voiddeleteParticlesInArea
()¶
-
void
copyGuardToExchange
(uint32_t exchangeType)¶ copy guard particles to intermediate exchange buffer
Copy all particles from the guard of a direction to the device exchange buffer.
- Warning
This method resets the number of particles in the processed supercells even if there are particles left in the supercell and does not guarantee that the last frame is contiguous filled. Call fillAllGaps afterwards if you need a valid number of particles and a contiguously filled last frame.
-
void
insertParticles
(uint32_t exchangeType)¶
-
ParticlesBoxType
getDeviceParticlesBox
()¶
-
ParticlesBoxType
getHostParticlesBox
(const int64_t memoryOffset)¶
-
BufferType &
getParticlesBuffer
()¶
-
void
reset
(uint32_t currentStep)¶ Reset is as well used for init.
Protected Functions
-
virtual
~ParticlesBase
()¶
-
template<uint32_t
AREA
>
voidshiftParticles
()¶
-
template<uint32_t
AREA
>
voidfillGaps
()¶
Protected Attributes
-
BufferType *
particlesBuffer
¶
-
enum [anonymous]¶
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
IPlugin
: public pmacc::INotify¶ Subclassed by picongpu::ISimulationPlugin, picongpu::ISimulationStarter, pmacc::SimulationHelper< DIM >, pmacc::SimulationHelper< simDim >
Public Functions
-
IPlugin
()¶
-
virtual
~IPlugin
()¶
-
virtual void
load
()¶
-
virtual void
unload
()¶
-
bool
isLoaded
()¶
-
virtual void
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
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
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
pluginGetName
() const = 0¶ Return the name of this plugin for status messages.
- Return
plugin name
-
virtual void
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
-
uint32_t
getLastCheckpoint
() const¶ When was the plugin checkpointed last?
- Return
last checkpoint’s time step
-
void
setLastCheckpoint
(uint32_t currentStep)¶ Remember last checkpoint call.
- Parameters
currentStep
: current simulation iteration step
-
PluginConnector¶
-
class
PluginConnector
¶ Plugin registration and management class.
Public Functions
-
void
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
loadPlugins
()¶ Calls load on all registered, not loaded plugins.
-
void
unloadPlugins
()¶ Unloads all registered, loaded plugins.
-
std::list<po::options_description>
registerHelp
()¶ Publishes command line parameters for registered plugins.
- Return
list of boost program_options command line parameters
-
void
setNotificationPeriod
(INotify *notifiedObj, std::string const &period)¶ Set the notification period.
- Parameters
notifiedObj
: the object to notify, e.g. an IPlugin instanceperiod
: notification period
-
void
notifyPlugins
(uint32_t currentStep)¶ Notifies plugins that data should be dumped.
- Parameters
currentStep
: current simulation iteration step
-
void
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
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)
Friends
-
friend
pmacc::PluginConnector::detail::Environment
-
void
SimulationHelper¶
-
template<unsigned
DIM
>
classSimulationHelper
: public pmacc::IPlugin¶ 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)
Public Types
-
template<>
usingSeqOfTimeSlices
= std::vector<pluginSystem::TimeSlice>¶
Public Functions
-
SimulationHelper
()¶ Constructor.
-
virtual
~SimulationHelper
()¶
-
virtual void
runOneStep
(uint32_t currentStep) = 0¶ Must describe one iteration (step).
This function is called automatically.
-
virtual void
init
() = 0¶ Initialize simulation.
Does hardware selections/reservations, memory allocations and initializes data structures as empty.
-
virtual uint32_t
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
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
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
dumpOneStep
(uint32_t currentStep)¶ Notifies registered output classes.
This function is called automatically.
- Parameters
currentStep
: simulation step
-
GridController<DIM> &
getGridController
()¶
-
void
dumpTimes
(TimeIntervall &tSimCalculation, TimeIntervall&, double &roundAvg, uint32_t currentStep)¶
-
void
startSimulation
()¶ Begin the simulation.
-
virtual void
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
pluginGetName
() const¶ Return the name of this plugin for status messages.
- Return
plugin name
-
void
pluginLoad
()¶
-
void
pluginUnload
()¶
-
void
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
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>
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
runSteps
¶
-
uint32_t
softRestarts
¶ Presentations: loop the whole simulation
softRestarts
times from initial step to runSteps.
-
std::string
checkpointPeriod
¶
-
SeqOfTimeSlices
seqCheckpointPeriod
¶
-
std::string
checkpointDirectory
¶
-
uint32_t
numCheckpoints
¶
-
int32_t
restartStep
¶
-
std::string
restartDirectory
¶
-
bool
restartRequested
¶
-
const std::string
CHECKPOINT_MASTER_FILE
¶
ForEach¶
Warning
doxygenstruct: Cannot find class “meta::ForEach” in doxygen xml output for project “PIConGPU” from directory: ../xml
Kernel Start¶
-
template<typename
T_KernelFunctor
>
structKernel
¶ wrapper for the user kernel functor
contains debug information like filename and line of the kernel call
Public Types
-
template<>
usingKernelType
= T_KernelFunctor¶
Public Functions
-
HINLINE
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)
-
template<>
-
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;