Galois
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
galois::substrate::TerminationDetection Class Referenceabstract

#include <Termination.h>

Inherited by galois::substrate::internal::LocalTerminationDetection< _UNUSED >, galois::substrate::internal::TreeTerminationDetection< _UNUSED >, and galois::substrate::internal::LocalTerminationDetection<>.

Public Member Functions

virtual ~TerminationDetection (void)
 
virtual void initializeThread ()=0
 Initializes the per-thread state. More...
 
virtual void localTermination (bool workHappened)=0
 Process termination locally. More...
 
bool globalTermination () const
 Returns whether global termination is detected. More...
 

Protected Member Functions

virtual void init (unsigned activeThreads)=0
 for internal use by child classes More...
 

Protected Attributes

CacheLineStorage< std::atomic
< int > > 
globalTerm
 

Friends

TerminationDetectiongetSystemTermination (unsigned)
 

Constructor & Destructor Documentation

galois::substrate::TerminationDetection::~TerminationDetection ( void  )
virtual

Member Function Documentation

bool galois::substrate::TerminationDetection::globalTermination ( ) const
inline

Returns whether global termination is detected.

virtual void galois::substrate::TerminationDetection::init ( unsigned  activeThreads)
protectedpure virtual

for internal use by child classes

virtual void galois::substrate::TerminationDetection::initializeThread ( )
pure virtual

Initializes the per-thread state.

All threads must call this before any call localTermination.

virtual void galois::substrate::TerminationDetection::localTermination ( bool  workHappened)
pure virtual

Process termination locally.

May be called as often as needed. The argument workHappened signals that since last time it was called, some progress was made that should prevent termination. All threads must call initializeThread() before any thread calls this function. This function should not be on the fast path (this is why it takes a flag, to allow the caller to buffer up work status changes).

Friends And Related Function Documentation

TerminationDetection& getSystemTermination ( unsigned  )
friend

Member Data Documentation

CacheLineStorage<std::atomic<int> > galois::substrate::TerminationDetection::globalTerm
protected

The documentation for this class was generated from the following files: