[zypp-commit] r9812 - in /trunk/sat-solver/src: repo_helix.c solver.c solver.h
Author: mlschroe Date: Fri Apr 25 11:24:20 2008 New Revision: 9812 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9812&view=rev Log: - add bugzilla reference - add more statistics Modified: trunk/sat-solver/src/repo_helix.c trunk/sat-solver/src/solver.c trunk/sat-solver/src/solver.h Modified: trunk/sat-solver/src/repo_helix.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repo_helix.c?rev=9812&r1=9811&r2=9812&view=diff ============================================================================== --- trunk/sat-solver/src/repo_helix.c (original) +++ trunk/sat-solver/src/repo_helix.c Fri Apr 25 11:24:20 2008 @@ -622,6 +622,7 @@ s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0); s->supplements = repo_fix_legacy(pd->repo, s->provides, s->supplements); + /* see bugzilla bnc#190163 */ const char *flavor = findKernelFlavor(pd, s); if (flavor) { Modified: trunk/sat-solver/src/solver.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.c?rev=9812&r1=9811&r2=9812&view=diff ============================================================================== --- trunk/sat-solver/src/solver.c (original) +++ trunk/sat-solver/src/solver.c Fri Apr 25 11:24:20 2008 @@ -1291,7 +1291,7 @@ || !r->w2) /* rule is assertion */ continue; - /* see addwatches(solv, r) */ + /* see addwatches_rule(solv, r) */ r->n1 = solv->watches[nsolvables + r->w1]; solv->watches[nsolvables + r->w1] = r - solv->rules; @@ -1305,8 +1305,8 @@ * add watches (for rule) */ -static void -addwatches(Solver *solv, Rule *r) +static inline void +addwatches_rule(Solver *solv, Rule *r) { int nsolvables = solv->pool->nsolvables; @@ -1353,8 +1353,6 @@ { POOL_DEBUG(SAT_DEBUG_PROPAGATE, "propagate for decision %d level %d\n", -pkg, level); solver_printruleelement(solv, SAT_DEBUG_PROPAGATE, 0, -pkg); - if (0) - solver_printwatches(solv, SAT_DEBUG_SCHUBI); } for (rp = watches + pkg; *rp; rp = nrp) @@ -1563,6 +1561,7 @@ queue_push(&solv->learnt_pool, 0); if (whyp) *whyp = learnt_why; + solv->stats_learned++; return rlevel; } @@ -1669,6 +1668,7 @@ Id lastweak; POOL_DEBUG(SAT_DEBUG_UNSOLVABLE, "ANALYZE UNSOLVABLE ----------------------\n"); + solv->stats_unsolvable++; oldproblemcount = solv->problems.count; oldlearntpoolcount = solv->learnt_pool.count; @@ -1881,7 +1881,7 @@ { /* at least 2 literals, needs watches */ watch2onhighest(solv, r); - addwatches(solv, r); + addwatches_rule(solv, r); } solv->decisionmap[p > 0 ? p : -p] = p > 0 ? level : -level; queue_push(&solv->decisionq, p); @@ -2402,6 +2402,8 @@ } break; } + POOL_DEBUG(SAT_DEBUG_STATS, "solver statistics: %d learned rules, %d unsolvable\n", solv->stats_learned, solv->stats_unsolvable); + POOL_DEBUG(SAT_DEBUG_STATS, "done solving.\n\n"); queue_free(&dq); } @@ -3572,7 +3574,7 @@ queue_init(&redoq); goterase = 0; - /* disable all erase jobs (continuing weak "keep uninstalled" rules) */ + /* disable all erase jobs (including weak "keep uninstalled" rules) */ for (i = solv->jobrules, r = solv->rules + i; i < solv->updaterules; i++, r++) { if (!r->w1) @@ -3744,6 +3746,8 @@ } solv->recommendations.count = recocount; } + + POOL_DEBUG(SAT_DEBUG_STATS, "final solver statistics: %d learned rules, %d unsolvable\n", solv->stats_learned, solv->stats_unsolvable); queue_free(&redoq); } Modified: trunk/sat-solver/src/solver.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.h?rev=9812&r1=9811&r2=9812&view=diff ============================================================================== --- trunk/sat-solver/src/solver.h (original) +++ trunk/sat-solver/src/solver.h Fri Apr 25 11:24:20 2008 @@ -105,6 +105,8 @@ Queue recommendations; /* recommended packages */ Queue suggestions; /* suggested packages */ + int stats_learned; /* statistic */ + int stats_unsolvable; /* statistic */ Map recommendsmap; /* recommended packages from decisionmap */ Map suggestsmap; /* suggested packages from decisionmap */ -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
mlschroe@svn.opensuse.org