-
Notifications
You must be signed in to change notification settings - Fork 218
PMacc data types [Buffer]
You are here: Home > Developer Documentation
This page gives an overview of the data containers in PMacc.
Their according iterators are called Box(es) in PMacc.
Buffer
is a container that holds or points to memory
- array buffers are located in
libPMacc/include/memory/buffers
- buffers:
- are container of real memory, which is located on either an accelerator/host or both
- or can be constructed from a combination of other buffers
In the most cases buffer types are a combination of [memory location]Buffer
(the interface), Buffer
(generic interface) and [memory location]BufferIntern
(implementation).
-
DeviceBuffer/ DeviceBufferIntern
- contains device memory
- memory is set to zero on initialization
- line by line aligned (if multi dimensional)
- number of elements (current size) is available on device (optional)
- can point to existing device memory (optional)
-
HostBuffer/ HostBufferIntern
- contains host memory
- memory is set to zero on initialization
- multi dimensional memory is not aligned
-
Exchange/ExchangeIntern
- buffer to communicate guarding cells (ghost cells)
- contains host buffer
- points to a subset of an existing device buffer (host and device size are the same)
- linear device double buffer of subset were the device buffer points to (only existing on multi dimensional exchanges) [ used to speed up memory copies from host2device and device2host ]
-
MappedBuffer
- contains host buffer that can be accessed directly from a device
- memory is set to zero on initialization
- same interface like
DeviceBuffer
- not aligned
-
GridBuffer
- complex buffer that contains a
DeviceBuffer
and aHostBuffer
-
ExchangeBuffer
can be added at runtime for every surface of the memory (1D -- <=2 exchanges, 2D -- <= 8 exchanges, 3D -- <=26 exchanges) - contains methods for asynchronous communication of the exchanges
- definition:
GridBuffer<DataType, DIM1> *myGridBuffer;
(psychocoderHPC: we shouln't show interfaces in the WIKI, maybe we can add a example code section here?) - initialization:
myGridBuffer = new GridBuffer<DataType, DIM1 > (DataSpace<DIM1 > (NumberOfElements));
- copy to host:
myGridBuffer->deviceToHost();
- get pointer to memory on host:
myGridBuffer->getHostBuffer().getBasePointer()
- get pointer to memory on the device:
myGridBuffer->getDeviceBuffer().getDataBox()
- free buffer:
__delete(myGridBuffer);
- delete data on device:
myGridBuffer->getDeviceBuffer().reset(false);
- complex buffer that contains a
-
MultiGridBuffer
- creates multiple
GridBuffer
s of the same native data type and size in one big memory chunk - every
GridBuffer
can be accessed by an enum - exchanges can be set separately for one
GridBuffer
or for all - the used iterator
MultiBox
has a small memory footprint in contrast to multipleGridBuffers
- creates multiple
Particle buffers are located in libPMacc/include/particles/memory/buffers
-
HeapBuffer
- not longer needed and supported after we switched to the memory controller
mallocMC
- not longer needed and supported after we switched to the memory controller
-
RingBuffer
- not longer needed and supported after we switched to the memory controller
mallocMC
- not longer needed and supported after we switched to the memory controller
-
StackExchangeBuffer
- ???
-
ParticleBuffer
- cool stuff
All wiki entries describe the dev branch. Features may be different in the current master branch.
Before you start please read our README!
PIConGPU is a scientific project. If you present and/or publish scientific results that used PIConGPU, you should set a reference to show your support. Our according up-to-date publication at the time of your publication should be inquired from:
The documentation in this wiki is still not complete and we need your help keeping it up to date. Feel free to help improving this wiki!