3#include "sharing/Filters/BloomFilter.hpp"
4#include "sharing/SharingStatistics.hpp"
5#include "sharing/SharingStrategy.hpp"
7#include "solvers/SolverInterface.hpp"
37 const std::vector<std::shared_ptr<SharingEntity>>& producers = {},
38 const std::vector<std::shared_ptr<SharingEntity>>& consumers = {});
61 void importClauses(
const std::vector<ClauseExchangePtr>& v_cls)
override
63 for (
auto& cls : v_cls)
76 "Global Strategy %d exports a cls %p to %d", this->
getSharingId(), clause.get(), client->getSharingId());
77 return client->importClause(clause);
#define LOGDEBUG3(...)
Log a debug message with verbosity level 4 and magenta color.
Definition Logger.hpp:229
Base class for global clause sharing strategies across MPI processes.
Definition GlobalSharingStrategy.hpp:27
GlobalSharingStrategy(const std::shared_ptr< ClauseDatabase > &clauseDB, const std::vector< std::shared_ptr< SharingEntity > > &producers={}, const std::vector< std::shared_ptr< SharingEntity > > &consumers={})
Constructor for GlobalSharingStrategy.
GlobalSharingStatistics gstats
Statistics for global sharing.
Definition GlobalSharingStrategy.hpp:118
virtual bool doSharing() override
Performs the clause sharing operation.
bool requests_sent
Flag indicating if requests to end were sent to the root.
Definition GlobalSharingStrategy.hpp:119
MPI_Request send_end_request
MPI request for non-root Isend for final synchronization with root.
Definition GlobalSharingStrategy.hpp:121
std::vector< int > receivedFinalResultRoot
Buffer for storing results received from other mpi processes.
Definition GlobalSharingStrategy.hpp:122
void importClauses(const std::vector< ClauseExchangePtr > &v_cls) override
Imports multiple clauses into the clause database.
Definition GlobalSharingStrategy.hpp:61
virtual bool initMpiVariables()
Initializes MPI-related variables.
virtual ~GlobalSharingStrategy()
Destructor.
bool importClause(const ClauseExchangePtr &cls) override
Imports a clause into the clause database.
Definition GlobalSharingStrategy.hpp:51
std::chrono::microseconds getSleepingTime() override
Gets the sleeping time for the sharing strategy.
void printStats() override
Prints the statistics of the sharing strategy.
virtual void joinProcess(int winnerRank, SatResult res, const std::vector< int > &model)
Handles the process of joining when a solution is found.
std::vector< MPI_Request > recv_end_requests
MPI requests for non-blocking receive of end signals.
Definition GlobalSharingStrategy.hpp:120
bool exportClauseToClient(const ClauseExchangePtr &clause, std::shared_ptr< SharingEntity > client)
Exports a clause to a specific client.
Definition GlobalSharingStrategy.hpp:73
int getSharingId() const
Get the sharing ID of this entity.
Definition SharingEntity.hpp:89
SharingStrategy class, inheriting from SharingEntity.
Definition SharingStrategy.hpp:26
std::shared_ptr< ClauseDatabase > m_clauseDB
Clause database where exported clauses are stored.
Definition SharingStrategy.hpp:147
SatResult
Enumeration for SAT solver results.
Definition SolverInterface.hpp:39
Statistics of a global sharing strategy.
Definition SharingStatistics.hpp:23