Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
lm::main::CheckpointSignaler Class Reference

A type of worker thread that checkpoints at a specified interval. More...

#include <CheckpointSignaler.h>

Inheritance diagram for lm::main::CheckpointSignaler:
[legend]
Collaboration diagram for lm::main::CheckpointSignaler:
[legend]

Public Member Functions

 CheckpointSignaler ()
 Creates a new CheckpointSignaler Worker thread.
virtual ~CheckpointSignaler ()
virtual void startCheckpointing (time_t checkpointInterval)
 Tells the thread to start checkpointing every checkpointInterval seconds.
virtual void stopCheckpointing ()
 Tell the thread to stop checkpointing.
virtual void wake ()
 Wake the thread if inactive.
Public Member Functions inherited from lm::thread::Worker
 Worker ()
 Creates thread and attaches it to the manager.
virtual ~Worker ()
 Removes thread from manager and deletes thread.
virtual void abort ()
 Set the aborted status for a thread and wakes thread.
virtual void checkpoint ()
 Checkpoint (currently unimplemented)
Public Member Functions inherited from lm::thread::Thread
 Thread ()
 Creates a pthread locking mechanism and initializes "Thread".
virtual ~Thread ()
 Destory the Thread.
virtual void start ()
 If no thread exists, creates a new thread and begins execution.
virtual void stop ()
 Joins the thread with the parent waiting if necessary.
virtual pthread_t getId ()
 Returns the pthread based id for the Thread.
virtual void setAffinity (int cpuNumber)
 Binds the thread to a CPU core.

Protected Member Functions

virtual int run ()
 A method to actually run a timestep while checkpointing every "checkpointInterval" time increment.
void setNextCheckpointTime ()
 Set the next checkpoint time for this thread.

Additional Inherited Members

Protected Attributes inherited from lm::thread::Worker
volatile bool aborted
Protected Attributes inherited from lm::thread::Thread
pthread_mutex_t controlMutex
pthread_t threadId
volatile bool running
int cpuNumber

Detailed Description

A type of worker thread that checkpoints at a specified interval.

Constructor & Destructor Documentation

◆ CheckpointSignaler()

lm::main::CheckpointSignaler::CheckpointSignaler ( )

Creates a new CheckpointSignaler Worker thread.

◆ ~CheckpointSignaler()

lm::main::CheckpointSignaler::~CheckpointSignaler ( )
virtual

Member Function Documentation

◆ run()

int lm::main::CheckpointSignaler::run ( )
protectedvirtual

A method to actually run a timestep while checkpointing every "checkpointInterval" time increment.

Returns
0 on success, -1 on failure

Implements lm::thread::Thread.

Here is the call graph for this function:

◆ setNextCheckpointTime()

void lm::main::CheckpointSignaler::setNextCheckpointTime ( )
protected

Set the next checkpoint time for this thread.

Here is the caller graph for this function:

◆ startCheckpointing()

void lm::main::CheckpointSignaler::startCheckpointing ( time_t checkpointInterval)
virtual

Tells the thread to start checkpointing every checkpointInterval seconds.

Parameters
checkpointIntervalHow often in seconds to checkpoint
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopCheckpointing()

void lm::main::CheckpointSignaler::stopCheckpointing ( )
virtual

Tell the thread to stop checkpointing.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wake()

void lm::main::CheckpointSignaler::wake ( )
virtual

Wake the thread if inactive.

Implements lm::thread::Thread.

Here is the caller graph for this function:

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