Skip to content

Commit fb6f300

Browse files
committed
Graph
When TD is <= 0 just forget about it
1 parent bd48cae commit fb6f300

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

scripts/data/create_graphs_ganak.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,13 @@ def get_dirs(ver : str):
483483
# "out-ganak-gpmc-mei-14294765-", # gpmc
484484
# "out-ganak-gpmc-mei-14295250-0", # ganak, fixed complex
485485
# "out-ganak-gpmc-mei-14295899-0", # mpfr ganak
486+
# "out-ganak-gpmc-mei-14294765-1",
487+
# "out-ganak-gpmc-mei-14295250-0",
488+
# "out-ganak-gpmc-mei-14295899-0",
486489

487490
# blocking
488-
"out-ganak-mccomp2324-14299825",
491+
# "out-ganak-mccomp2324-14299825", # sigFPE in blocking, messed up get_weight vs *get_weight in Arjun
492+
"out-ganak-mccomp2324-14309534", # new blocking, Fields, etc
489493
]
490494
# only_dirs = ["out-ganak-6828273"] #-- functional synth
491495
#"6393432", "6393432", "6349002",, "6349002", "6387743" "6356951"] #, "out-ganak-6318929.pbs101-4", "out-ganak-6328707.pbs101-7", "out-ganak-6318929.pbs101-7"] #,"6348728" "6346880", "6335522", "6328982", "6328707"]
@@ -499,7 +503,6 @@ def get_dirs(ver : str):
499503
# only_calls = ["vsadsadjust 128"]
500504
only_calls = []
501505
# not_calls = ["restart"]
502-
only_files = ["track3", "track4"]
503506
not_calls = []
504507
todo = versions
505508

@@ -663,7 +666,7 @@ def get_dirs(ver : str):
663666
f.write("set ylabel \"Instances counted\"\n")
664667
f.write("set xlabel \"Time (s)\"\n")
665668
# f.write("plot [:][10:]\\\n")
666-
f.write("plot [:][:]\\\n")
669+
f.write("plot [:][900:]\\\n")
667670
i = 0
668671
# f.write(" \"runkcbox-prearjun.csv.gnuplotdata\" u 2:1 with linespoints title \"KCBox\",\\\n")
669672
# f.write(" \"runsharptd-prearjun.csv.gnuplotdata\" u 2:1 with linespoints title \"SharptTD\",\\\n")

src/comp_analyzer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ void CompAnalyzer::calc_blocked(
246246
<< " avg blocked/lit: " << (double)blocked_tot/(double)(n*2-2) << " T: " << cpu_time()-start_time);
247247
verb_print(1, "cls with blocked lits: " << cls_blocked << " / " << long_irred_cls.size()
248248
<< " = " << (double)cls_blocked/(double)long_irred_cls.size()*100 << "%");
249-
250249
}
251250

252251
// Builds occ lists and sets things up, Done exactly ONCE for a whole counting runkk

src/counter.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ bool Counter::remove_duplicates(vector<Lit>& lits) {
134134
void Counter::compute_score(TWD::TreeDecomposition& tdec, uint32_t nodes, bool print) {
135135
const auto& bags = tdec.Bags();
136136
td_width = tdec.width();
137-
if (print || conf.verb >= 1) verb_print(0, "[td] Calculated TD width: " << td_width-1);
137+
if (td_width <= 0) {
138+
if (print) verb_print(1, "TD width is 0, ignoring TD");
139+
return;
140+
}
141+
if (print) verb_print(2, "[td] Calculated TD width: " << td_width-1);
138142
const auto& adj = tdec.get_adj_list();
139143
#if 0
140144
for(uint32_t i = 0; i < bags.size(); i++) {
@@ -150,14 +154,14 @@ void Counter::compute_score(TWD::TreeDecomposition& tdec, uint32_t nodes, bool p
150154
#endif
151155
std::vector<int> dists = tdec.distanceFromCentroid(nodes);
152156
if (dists.empty()) {
153-
verb_print(1, "All projected vars in the same bag, ignoring TD");
157+
if (print) verb_print(1, "All projected vars in the same bag, ignoring TD");
154158
return;
155159
} else {
156160
int max_dst = 0;
157161
for(int i=1; i < (int)nodes; i++)
158162
max_dst = std::max(max_dst, dists[i]);
159163
if (max_dst == 0) {
160-
verb_print(1, "All projected vars are the same distance, ignoring TD");
164+
if (print) verb_print(1, "All projected vars are the same distance, ignoring TD");
161165
return;
162166
}
163167
}
@@ -213,9 +217,8 @@ void Counter::compute_score(TWD::TreeDecomposition& tdec, uint32_t nodes, bool p
213217
tdscore[i] = val;
214218
}
215219

216-
for(uint32_t i = 1; i < nodes; i++) {
217-
verb_print(2, "TD var: " << i << " tdscore: " << tdscore[i]);
218-
}
220+
for(uint32_t i = 1; i < nodes; i++)
221+
verb_print(2, "TD var: " << i << " tdscore: " << tdscore[i]);
219222
}
220223

221224
TWD::TreeDecomposition Counter::td_decompose_component(double mult) {

0 commit comments

Comments
 (0)