SpinParser
1.0
|
Abstract base class for DataStack types. More...
#include <LoadManager.hpp>
Public Types | |
enum | StackType { StackType::Explicit, StackType::Implicit, StackType::Slave, StackType::Passive } |
List to identify the different traits of DataStack. More... | |
enum | MessageTag { MessageTag::Chunk, MessageTag::ChunkReturn } |
Internal message tags for MPI communication. More... | |
Public Member Functions | |
virtual | ~DataStackBase () |
Virtual destructor. | |
virtual void | applyCalculator (const int n) |
Virtual function to apply an internal calculator to the n-th value stored in the stack. More... | |
virtual void | send (const int offset, const int count, const int serverRank, const MPI_Comm communicator) const |
Virtual function to send a data block to a DataStack on a different MPI rank, typically the server rank. More... | |
virtual void | receive (const int offset, const int count, const int rank, const MPI_Comm communicator, MPI_Request &request) |
Virtual function to asynchronously receive a data block from a different MPI rank. More... | |
virtual void | broadcast (const int serverRank, const MPI_Comm communicator) |
Virtual function to broadcast a data block from the server rank to all other MPI ranks. More... | |
Public Attributes | |
StackType | type |
Specifies the trait of the stack. More... | |
StackIdentifier | master |
Specifies the id of an associated stack. Only relevant for slave stacks, otherwise set to -1. More... | |
int | size |
Number of elements (or tuples of elements if DataStackBase::typeMultiplicity is greater than one) stored in the stack. | |
int | typeMultiplicity |
Multiplicity of each element. Cannot be greater than one for explicit stacks. If greater than one, the data stack is assumed to consist of tuples of fundamental data types. Element indexing then refers to the tuples, not the fundamental data types. | |
int | recommendedChunkSizeMultiple |
When breaking the data stack down into smaller work chunks, attempt to form chunks whose size is a multiple of the given value. This is helpful if calculators vary in runtime, but can be joined to groups whose collective runtime is expected to be constant. | |
int | recommendedChunksPerRank |
When breaking the data stack down into smaller work chunks, attempt to form approximately the specified number of chunks per MPI rank. | |
bool | autoBroadcast |
If set to true, modifications to the stack's data that are a consequence of the onvication of calculators are automatically communicated across all MPI ranks. If set to false, they are only sent to the MPI server rank. | |
Abstract base class for DataStack types.
This abstract type does not actually store data or prescriptions for calculations. It merely specifies the virtual interface for inheritance. Subclasses should then implement data storage and calculators, see concrete implementations for more details.
|
strong |
Internal message tags for MPI communication.
Enumerator | |
---|---|
Chunk | MPI message contains Chunk information. |
ChunkReturn | MPI message contains the result of a chunk computation. |
|
strong |
List to identify the different traits of DataStack.
Enumerator | |
---|---|
Explicit | Explicit DataStack. An explicit DataStack contains an explicit calculator, i.e. a function with a single integer as an argument, and a non-void return type. When the calculator is invoked, its return value is written to the data element whose position is specified by the integer argument. |
Implicit | Implicit DataStack. An implicit DataStack contains an implicit calculator, i.e. a function with a single integer as an argument, and a void return type. When the calculator is invoked, it is passed the index of a data element stored in the stack. The calculator is expected to modify that element. |
Slave | Slave DataStack. A slave DataStack does not contain a calculator. Instead, it is associated with an implicit data stack. The data storage is expected to have the same size as the associated implicit stack, and the associated stack's implicit calculator is expected to modify also the slave stack's element with the corresponding index. Whenever data of the associated implicit stack is communicated between different MPI ranks, the corresponding slave stack data is also communicated.
|
Passive | Passive DataStack. A passive DataStack does not contain a calculator. Changes to its data can only be made on the MPI server rank and need to be manually broadcasted.
|
|
inlinevirtual |
Virtual function to apply an internal calculator to the n-th value stored in the stack.
n | Specifies the index to which the calculator should be applied. |
Reimplemented in HMP::LoadManager::DataStack< StackT >.
|
inlinevirtual |
Virtual function to broadcast a data block from the server rank to all other MPI ranks.
serverRank | The MPI rank to take the role of the sender. |
communicator | The MPI communicator used for communication. |
Reimplemented in HMP::LoadManager::DataStack< StackT >.
|
inlinevirtual |
Virtual function to asynchronously receive a data block from a different MPI rank.
[in] | offset | Offset to the beginning of the data block to be received, measured in number of entries (or number of entry tuples, if DataStackBase::typeMultiplicity is greater than one). |
[in] | count | Number of entries to be received. |
[in] | rank | Sender's MPI rank. |
[in] | communicator | The MPI communicator used for communication. |
[out] | request | MPI request object for the communication; Should be used to determine whether the non-blocking receive has been completed. |
Reimplemented in HMP::LoadManager::DataStack< StackT >.
|
inlinevirtual |
Virtual function to send a data block to a DataStack on a different MPI rank, typically the server rank.
offset | Offset to the beginning of the data block to be sent, measured in number of entries (or number of entry tuples, if DataStackBase::typeMultiplicity is greater than one). |
count | Number of entries to be sent. |
serverRank | Receiver's MPI rank, typically the server rank. |
communicator | The MPI communicator used for communication. |
Reimplemented in HMP::LoadManager::DataStack< StackT >.
StackIdentifier HMP::LoadManager::DataStackBase::master |
Specifies the id of an associated stack. Only relevant for slave stacks, otherwise set to -1.
StackType HMP::LoadManager::DataStackBase::type |
Specifies the trait of the stack.