Hedgehog  3.1.0
A library to generate hybrid pipeline workflow systems
Loading...
Searching...
No Matches
hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore > Class Template Referenceabstract

Typed abstraction for groupable node. More...

#include "groupable_abstraction.h"

Inheritance diagram for hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore >:
Inheritance graph
Collaboration diagram for hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore >:
Collaboration graph

Public Member Functions

 GroupableAbstraction (CopyableNode *const copyableNode, size_t const &numberThreads)
 Constructor using the node abstraction to call the user-defined copy and the number of threads.
 
 ~GroupableAbstraction () override=default
 Default destructor.
 
int threadId () const
 Accessor to thread id.
 
std::shared_ptr< CopyableNode > callCopyAndRegisterInGroup ()
 Call the used-defined copy and register the copy in the group.
 
virtual void copyInnerStructure (CopyableCore *copyableCore)=0
 Copy the inner structure of the core.
 
- Public Member Functions inherited from hh::core::abstraction::CopyableAbstraction< CopyableNode >
 CopyableAbstraction (CopyableNode *const copyableNode)
 Constructor using a node abstraction.
 
virtual ~CopyableAbstraction ()=default
 Default destructor.
 
- Public Member Functions inherited from hh::core::abstraction::AnyGroupableAbstraction
 AnyGroupableAbstraction (size_t const numberThreads)
 Constructor using the number of threads.
 
virtual ~AnyGroupableAbstraction ()=default
 Default destructor.
 
size_t numberThreads () const
 Accessor to the number of threads.
 
bool isInGroup () const
 Test if a group is needed.
 
std::string nodeId () const
 Accessor to the node id (redirection to NodeAbstraction::nodeId)
 
std::shared_ptr< std::set< AnyGroupableAbstraction * > > const & group () const
 Group of cores accessor.
 
std::shared_ptr< std::set< NodeAbstraction * > > groupAsNodes () const
 Create a set of the NodeAbstraction constituting the group.
 
AnyGroupableAbstractiongroupRepresentative () const
 Group representative accessor.
 
std::string groupRepresentativeId () const
 Group id representative accessor.
 
void groupRepresentative (AnyGroupableAbstraction *groupRepresentative)
 Group representative setter.
 
void group (std::shared_ptr< std::set< AnyGroupableAbstraction * > > const &group)
 Group setter.
 
size_t numberActiveThreadInGroup () const
 Accessor to the number of nodes alive in the group.
 
std::pair< std::chrono::nanoseconds, std::chrono::nanoseconds > minmaxWaitDurationGroup () const
 Accessor to the min / max wait duration of the nodes in the group.
 
std::pair< std::chrono::nanoseconds, std::chrono::nanoseconds > meanSDWaitDurationGroup () const
 Accessor to the mean / standard deviation wait duration of the nodes in the group.
 
std::pair< std::chrono::nanoseconds, std::chrono::nanoseconds > minmaxExecutionDurationGroup () const
 Accessor to the min / max execution duration of the nodes in the group.
 
std::pair< std::chrono::nanoseconds, std::chrono::nanoseconds > meanSDExecutionDurationGroup () const
 Accessor to the mean / standard deviation execution duration of the nodes in the group.
 
std::pair< std::chrono::nanoseconds, std::chrono::nanoseconds > minmaxExecTimePerElementGroup () const
 Accessor to the min / max execution per elements duration of the nodes in the group.
 
std::pair< std::chrono::nanoseconds, std::chrono::nanoseconds > meanSDExecTimePerElementGroup () const
 Accessor to the mean / standard deviation execution per elements duration of the nodes in the group.
 
std::pair< std::chrono::nanoseconds, std::chrono::nanoseconds > minmaxMemoryWaitTimeGroup () const
 Accessor to the min / max wait time duration of the nodes in the group.
 
std::pair< std::chrono::nanoseconds, std::chrono::nanoseconds > meanSDMemoryWaitTimePerElementGroup () const
 Accessor to the mean / standard deviation wait time duration of the nodes in the group.
 
std::pair< size_t, size_tminmaxNumberElementsReceivedGroup () const
 Accessor to the min / max number of elements received in the group.
 
std::pair< double, double > meanSDNumberElementsReceivedGroup () const
 Accessor to the mean / standard deviation number of elements received in the group.
 
virtual void createGroup (std::map< NodeAbstraction *, std::vector< NodeAbstraction * > > &)=0
 Create a group to insert in the map.
 

Private Attributes

int threadId_ = 0
 Thread id.
 
int numberThreadsCreated_ = 1
 Number of thread created for the group.
 

Additional Inherited Members

- Protected Member Functions inherited from hh::core::abstraction::CopyableAbstraction< CopyableNode >
std::shared_ptr< CopyableNode > callCopy ()
 Interface to call user-defined copy method.
 

Detailed Description

template<tool::CopyableNode CopyableNode, class CopyableCore>
class hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore >

Typed abstraction for groupable node.

Template Parameters
CopyableNodeType of the node to copy and group
CopyableCoreType of the core to copy and group

Definition at line 40 of file groupable_abstraction.h.

Constructor & Destructor Documentation

◆ GroupableAbstraction()

template<tool::CopyableNode CopyableNode, class CopyableCore >
hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore >::GroupableAbstraction ( CopyableNode *const  copyableNode,
size_t const &  numberThreads 
)
inline

Constructor using the node abstraction to call the user-defined copy and the number of threads.

Parameters
copyableNodeType of the node to copy and group
numberThreadsNumber of threads (number of nodes) in the group

Definition at line 52 of file groupable_abstraction.h.

◆ ~GroupableAbstraction()

template<tool::CopyableNode CopyableNode, class CopyableCore >
hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore >::~GroupableAbstraction ( )
overridedefault

Default destructor.

Member Function Documentation

◆ callCopyAndRegisterInGroup()

template<tool::CopyableNode CopyableNode, class CopyableCore >
std::shared_ptr< CopyableNode > hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore >::callCopyAndRegisterInGroup ( )
inline

Call the used-defined copy and register the copy in the group.

Returns
Copy of the node
Exceptions
std::runtime_errora copy is ill-formed

Definition at line 67 of file groupable_abstraction.h.

Here is the call graph for this function:

◆ copyInnerStructure()

template<tool::CopyableNode CopyableNode, class CopyableCore >
virtual void hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore >::copyInnerStructure ( CopyableCore *  copyableCore)
pure virtual

Copy the inner structure of the core.

Parameters
copyableCoreCore to copy the inner structure from

Implemented in hh::core::CoreTask< Separator, AllTypes >, and hh::core::CoreTask< Separator, AllTypes... >.

◆ threadId()

template<tool::CopyableNode CopyableNode, class CopyableCore >
int hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore >::threadId ( ) const
inline

Accessor to thread id.

Returns
Thread id

Definition at line 61 of file groupable_abstraction.h.

Member Data Documentation

◆ numberThreadsCreated_

template<tool::CopyableNode CopyableNode, class CopyableCore >
int hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore >::numberThreadsCreated_ = 1
private

Number of thread created for the group.

Definition at line 46 of file groupable_abstraction.h.

◆ threadId_

template<tool::CopyableNode CopyableNode, class CopyableCore >
int hh::core::abstraction::GroupableAbstraction< CopyableNode, CopyableCore >::threadId_ = 0
private

Thread id.

Definition at line 45 of file groupable_abstraction.h.