Painless
A framework to ease parallelization of sequential CDCL SAT solvers
Loading...
Searching...
No Matches
Sharer Class Reference

A sharer is a thread responsible for executing a list of SharingStrategies. More...

#include <Sharer.hpp>

Collaboration diagram for Sharer:

Public Member Functions

 Sharer (int id_, std::vector< std::shared_ptr< SharingStrategy > > &sharingStrategies)
 Constructor with multiple sharing strategies.
 
 Sharer (int id_, std::shared_ptr< SharingStrategy > sharingStrategy)
 Constructor with a single sharing strategy.
 
virtual ~Sharer ()
 Destructor.
 
virtual void printStats ()
 Print sharing statistics.
 
void join ()
 Join the thread of this sharer object.
 
void setThreadAffinity (int coreId)
 Set the thread affinity for this sharer.
 
int getId ()
 Get the ID of this sharer.
 
void setId (int id)
 Set the ID of this sharer.
 

Protected Attributes

Threadsharer
 Pointer to the thread in charge of sharing.
 
double totalSharingTime = 0
 Heuristic for strategy implementation comparison (TODO: ifndef NSTAT for such probes)
 
unsigned int round
 Number of sharing rounds completed.
 
std::vector< std::shared_ptr< SharingStrategy > > sharingStrategies
 Strategy/Strategies used to share clauses.
 
int m_sharerId
 The ID of this sharer.
 

Friends

void * mainThrSharing (void *arg)
 Working function that will call sharingStrategy doSharing()
 

Detailed Description

A sharer is a thread responsible for executing a list of SharingStrategies.

Constructor & Destructor Documentation

◆ Sharer() [1/2]

Sharer::Sharer ( int id_,
std::vector< std::shared_ptr< SharingStrategy > > & sharingStrategies )

Constructor with multiple sharing strategies.

Parameters
id_The ID of the sharer.
sharingStrategiesA vector of sharing strategies.

◆ Sharer() [2/2]

Sharer::Sharer ( int id_,
std::shared_ptr< SharingStrategy > sharingStrategy )

Constructor with a single sharing strategy.

Parameters
id_The ID of the sharer.
sharingStrategyA single sharing strategy.

Member Function Documentation

◆ getId()

int Sharer::getId ( )
inline

Get the ID of this sharer.

Returns
The sharer's ID.

◆ setId()

void Sharer::setId ( int id)
inline

Set the ID of this sharer.

Parameters
idThe new ID for the sharer.

◆ setThreadAffinity()

void Sharer::setThreadAffinity ( int coreId)
inline

Set the thread affinity for this sharer.

Parameters
coreIdThe ID of the core to set affinity to.

Friends And Related Symbol Documentation

◆ mainThrSharing

void * mainThrSharing ( void * arg)
friend

Working function that will call sharingStrategy doSharing()

Parameters
sharerthe sharer object
Returns
NULL if well ended
Parameters
argPointer to the associated Sharer object.
Returns
NULL if the thread exits correctly.

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