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

A set of helper functions for distributed solver initialization and finalization using MPI. More...

Functions

bool sendFormula (std::vector< simpleClause > &clauses, unsigned int *varCount, int rootRank)
 Sends a formula represented by clauses and variable count over MPI.
 
bool serializeClauses (const std::vector< simpleClause > &clauses, std::vector< int > &serializedClauses)
 Serializes a vector of Clauses into a vector of integers.
 
bool deserializeClauses (const std::vector< int > &serializedClauses, std::vector< simpleClause > &clauses)
 Deserializes a vector of characters into a vector of simpleClause objects.
 
void sendModelToRoot ()
 The winner determined by the root will send the model if the answer was SATISFIABLE.
 

Detailed Description

A set of helper functions for distributed solver initialization and finalization using MPI.

Function Documentation

◆ deserializeClauses()

bool mpiutils::deserializeClauses ( const std::vector< int > & serializedClauses,
std::vector< simpleClause > & clauses )

Deserializes a vector of characters into a vector of simpleClause objects.

Parameters
serializedClausesThe vector of characters that represents the serialized array.
clausesThe vector where the deserialized simpleClause objects will be stored.
Returns
Returns true if the deserialization was successful, false otherwise.

◆ sendFormula()

bool mpiutils::sendFormula ( std::vector< simpleClause > & clauses,
unsigned int * varCount,
int rootRank )

Sends a formula represented by clauses and variable count over MPI.

Parameters
clausesThe vector of Clauses representing the formula.
varCountThe number of variables in the formula (pointer).
rootRankThe mpi process rank broadcasting the formula.
Returns
Returns true if the formula was successfully received, false otherwise.

◆ serializeClauses()

bool mpiutils::serializeClauses ( const std::vector< simpleClause > & clauses,
std::vector< int > & serializedClauses )

Serializes a vector of Clauses into a vector of integers.

Parameters
clausesThe vector of Clauses to be serialized.
serializedClausesThe vector where the serialized clauses will be stored.
Returns
Returns true if the serialization was successful, false otherwise.
Todo
A version with a function parameter for GlobalSharingStrategies