Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/component_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ uint64_t freeram() {
#include "stack.h"


ComponentCache::ComponentCache(DataAndStatistics &statistics) :
statistics_(statistics) {
ComponentCache::ComponentCache(DataAndStatistics &statistics,
SolverConfiguration& config) :
statistics_(statistics), config_(config) {
}

void ComponentCache::init(Component &super_comp) {

if(!config_.quiet)
cout << sizeof(CacheableComponent) << " " << sizeof(mpz_class) << endl;
CacheableComponent &packed_super_comp = *new CacheableComponent(super_comp);
CacheableComponent &packed_super_comp = *new CacheableComponent(super_comp);
my_time_ = 1;

entry_base_.clear();
Expand All @@ -76,14 +78,14 @@ void ComponentCache::init(Component &super_comp) {
statistics_.maximum_cache_size_bytes_ = max_cache_bound;
}

if (statistics_.maximum_cache_size_bytes_ > free_ram) {
if (!config_.quiet && statistics_.maximum_cache_size_bytes_ > free_ram) {
cout << endl <<" WARNING: Maximum cache size larger than free RAM available" << endl;
cout << " Free RAM " << free_ram / 1000000 << "MB" << endl;
}

cout << "Maximum cache size:\t"
<< statistics_.maximum_cache_size_bytes_ / 1000000 << " MB" << endl
<< endl;
if(!config_.quiet)
cout << "Maximum cache size:\t"
<< statistics_.maximum_cache_size_bytes_ / 1000000 << " MB" << endl
<< endl;

assert(!statistics_.cache_full());

Expand Down
5 changes: 4 additions & 1 deletion src/component_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
#include "component_types/component.h"

#include "stack.h"
#include "solver_config.h"


class ComponentCache {
public:

ComponentCache(DataAndStatistics &statistics);
ComponentCache(DataAndStatistics &statistics,
SolverConfiguration& config);

~ComponentCache() {
// debug_dump_data();
Expand Down Expand Up @@ -163,6 +165,7 @@ class ComponentCache {
unsigned table_size_mask_;

DataAndStatistics &statistics_;
SolverConfiguration &config_;

unsigned long my_time_ = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion src/component_management.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ComponentManager {
public:
ComponentManager(SolverConfiguration &config, DataAndStatistics &statistics,
LiteralIndexedVector<TriValue> & lit_values) :
config_(config), statistics_(statistics), cache_(statistics),
config_(config), statistics_(statistics), cache_(statistics, config),
ana_(statistics,lit_values) {
}

Expand Down