|
IPPL API Reference
Independent Parallel Particle Layer C++ API
|
Decorator class for buffer management that adds logging capabilities to buffer operations. More...
#include <LoggingBufferHandler.h>
Inheritance diagram for ippl::LoggingBufferHandler< MemorySpace >:
Collaboration diagram for ippl::LoggingBufferHandler< MemorySpace >:Public Types | |
| using | buffer_type = typename BufferHandler< MemorySpace >::buffer_type |
| using | size_type = typename BufferHandler< MemorySpace >::size_type |
Public Types inherited from ippl::BufferHandler< MemorySpace > | |
| using | archive_type = ippl::detail::Archive< MemorySpace > |
| using | buffer_type = std::shared_ptr< archive_type > |
| using | size_type = ippl::detail::size_type |
Public Member Functions | |
| LoggingBufferHandler (std::shared_ptr< BufferHandler< MemorySpace > > handler, int rank) | |
| Constructs a LoggingBufferHandler with an existing buffer handler. | |
| LoggingBufferHandler () | |
Default constructor, creates an internal BufferHandler for managing buffers. This constructor also initializes the rank by calling MPI_Comm_rank. | |
| buffer_type | getBuffer (size_type size, double overallocation) override |
| Allocates or retrieves a buffer and logs the action. | |
| void | freeBuffer (buffer_type buffer) override |
| Frees a buffer and logs the action. | |
| void | freeAllBuffers () override |
| Frees all buffers and logs the action. | |
| void | deleteAllBuffers () override |
| Deletes all buffers and logs the action. | |
| size_type | getUsedSize () const override |
| Retrieves the total size of allocated buffers. | |
| size_type | getFreeSize () const override |
| Retrieves the total size of free buffers. | |
| const std::vector< LogEntry > & | getLogs () const |
| Retrieves the list of log entries. | |
Decorator class for buffer management that adds logging capabilities to buffer operations.
LoggingBufferHandler extends the basic functionality of BufferHandler by recording detailed logs of buffer operations, such as allocation, deallocation, and resizing. This allows tracking of memory usage patterns and provides a record of buffer activity.
| MemorySpace | The memory space in which buffers are managed (e.g., HostSpace, CudaSpace). |
This class is a decorator for BufferHandler and does not modify buffer management logic. Instead, it adds logging for monitoring purposes.
| ippl::LoggingBufferHandler< MemorySpace >::LoggingBufferHandler | ( | std::shared_ptr< BufferHandler< MemorySpace > > | handler, |
| int | rank | ||
| ) |
Constructs a LoggingBufferHandler with an existing buffer handler.
| handler | A shared pointer to an BufferHandler instance used for buffer operations. |
| rank | The MPI rank for logging purposes, used to identify the source of logs. |
|
overridevirtual |
Deletes all buffers and logs the action.
Overrides BufferHandler::deleteAllBuffers. Calls BufferHandler::deleteAllBuffers and logs the operation.
Implements ippl::BufferHandler< MemorySpace >.
|
overridevirtual |
Frees all buffers and logs the action.
Overrides BufferHandler::freeAllBuffers. Calls BufferHandler::freeAllBuffers and logs the operation.
Implements ippl::BufferHandler< MemorySpace >.
|
overridevirtual |
Frees a buffer and logs the action.
Overrides BufferHandler::freeBuffer. Calls BufferHandler::freeBuffer and records the operation in the log.
| buffer | The buffer to be freed. |
Implements ippl::BufferHandler< MemorySpace >.
|
overridevirtual |
Allocates or retrieves a buffer and logs the action.
Overrides BufferHandler::getBuffer, providing the same buffer allocation behavior while recording an entry in the log with the operation details.
| size | Requested size of the buffer. |
| overallocation | Optional multiplier to allocate extra buffer space. |
Implements ippl::BufferHandler< MemorySpace >.
|
overridevirtual |
Retrieves the total size of free buffers.
Implements ippl::BufferHandler< MemorySpace >.
| const std::vector< LogEntry > & ippl::LoggingBufferHandler< MemorySpace >::getLogs | ( | ) | const |
Retrieves the list of log entries.
|
overridevirtual |
Retrieves the total size of allocated buffers.
Implements ippl::BufferHandler< MemorySpace >.