Commit ff0ec52d by Alan Mishchenko

Updating memory print-out of &vta and &gla.

parent d533f182
...@@ -1633,7 +1633,7 @@ void Gla_ManAbsPrintFrame( Gla_Man_t * p, int nCoreSize, int nFrames, int nConfl ...@@ -1633,7 +1633,7 @@ void Gla_ManAbsPrintFrame( Gla_Man_t * p, int nCoreSize, int nFrames, int nConfl
Abc_Print( 1, " %9d", sat_solver2_nvars(p->pSat) ); Abc_Print( 1, " %9d", sat_solver2_nvars(p->pSat) );
Abc_Print( 1, " %6d", nCoreSize > 0 ? nCoreSize : 0 ); Abc_Print( 1, " %6d", nCoreSize > 0 ? nCoreSize : 0 );
Abc_Print( 1, "%9.2f sec", 1.0*Time/CLOCKS_PER_SEC ); Abc_Print( 1, "%9.2f sec", 1.0*Time/CLOCKS_PER_SEC );
Abc_Print( 1, "%5.1f Gb", sat_solver2_memory_proof( p->pSat ) / (1<<30) ); Abc_Print( 1, "%5.1f Gb", (sat_solver2_memory_proof(p->pSat) + sat_solver2_memory(p->pSat, 0)) / (1<<30) );
Abc_Print( 1, "%s", nCoreSize > 0 ? "\n" : "\r" ); Abc_Print( 1, "%s", nCoreSize > 0 ? "\n" : "\r" );
fflush( stdout ); fflush( stdout );
} }
...@@ -1643,7 +1643,7 @@ void Gla_ManReportMemory( Gla_Man_t * p ) ...@@ -1643,7 +1643,7 @@ void Gla_ManReportMemory( Gla_Man_t * p )
int i; int i;
double memTot = 0; double memTot = 0;
double memAig = Gia_ManObjNum(p->pGia) * sizeof(Gia_Obj_t); double memAig = Gia_ManObjNum(p->pGia) * sizeof(Gia_Obj_t);
double memSat = sat_solver2_memory( p->pSat ); double memSat = sat_solver2_memory( p->pSat, 1 );
double memPro = sat_solver2_memory_proof( p->pSat ); double memPro = sat_solver2_memory_proof( p->pSat );
double memMap = p->nObjs * sizeof(Gla_Obj_t) + Gia_ManObjNum(p->pGia) * sizeof(int); double memMap = p->nObjs * sizeof(Gla_Obj_t) + Gia_ManObjNum(p->pGia) * sizeof(int);
double memRef = Gia_ManObjNum(p->pGia) * sizeof(Vec_Int_t); double memRef = Gia_ManObjNum(p->pGia) * sizeof(Vec_Int_t);
......
...@@ -1247,7 +1247,7 @@ int Vta_ManAbsPrintFrame( Vta_Man_t * p, Vec_Int_t * vCore, int nFrames, int nCo ...@@ -1247,7 +1247,7 @@ int Vta_ManAbsPrintFrame( Vta_Man_t * p, Vec_Int_t * vCore, int nFrames, int nCo
for ( k = 0; k < 7; k++ ) for ( k = 0; k < 7; k++ )
Abc_Print( 1, " " ); Abc_Print( 1, " " );
Abc_Print( 1, "%9.2f sec", 1.0*Time/CLOCKS_PER_SEC ); Abc_Print( 1, "%9.2f sec", 1.0*Time/CLOCKS_PER_SEC );
Abc_Print( 1, "%5.1f Gb", sat_solver2_memory_proof( p->pSat ) / (1<<30) ); Abc_Print( 1, "%5.1f Gb", (sat_solver2_memory_proof(p->pSat) + sat_solver2_memory(p->pSat, 0)) / (1<<30) );
Abc_Print( 1, "\r" ); Abc_Print( 1, "\r" );
} }
else else
...@@ -1269,7 +1269,7 @@ int Vta_ManAbsPrintFrame( Vta_Man_t * p, Vec_Int_t * vCore, int nFrames, int nCo ...@@ -1269,7 +1269,7 @@ int Vta_ManAbsPrintFrame( Vta_Man_t * p, Vec_Int_t * vCore, int nFrames, int nCo
Abc_Print( 1, " " ); Abc_Print( 1, " " );
} }
Abc_Print( 1, "%9.2f sec", 1.0*Time/CLOCKS_PER_SEC ); Abc_Print( 1, "%9.2f sec", 1.0*Time/CLOCKS_PER_SEC );
Abc_Print( 1, "%5.1f Gb", sat_solver2_memory_proof( p->pSat ) / (1<<30) ); Abc_Print( 1, "%5.1f Gb", (sat_solver2_memory_proof(p->pSat) + sat_solver2_memory(p->pSat, 0)) / (1<<30) );
Abc_Print( 1, "\n" ); Abc_Print( 1, "\n" );
} }
fflush( stdout ); fflush( stdout );
...@@ -1511,7 +1511,7 @@ void Gia_VtaPrintMemory( Vta_Man_t * p ) ...@@ -1511,7 +1511,7 @@ void Gia_VtaPrintMemory( Vta_Man_t * p )
{ {
double memTot = 0; double memTot = 0;
double memAig = Gia_ManObjNum(p->pGia) * sizeof(Gia_Obj_t); double memAig = Gia_ManObjNum(p->pGia) * sizeof(Gia_Obj_t);
double memSat = sat_solver2_memory( p->pSat ); double memSat = sat_solver2_memory( p->pSat, 1 );
double memPro = sat_solver2_memory_proof( p->pSat ); double memPro = sat_solver2_memory_proof( p->pSat );
double memMap = p->nObjsAlloc * sizeof(Vta_Obj_t) + p->nBins * sizeof(int); double memMap = p->nObjsAlloc * sizeof(Vta_Obj_t) + p->nBins * sizeof(int);
double memOth = sizeof(Vta_Man_t); double memOth = sizeof(Vta_Man_t);
......
...@@ -3203,7 +3203,7 @@ int Abc_NtkDarSeqSim3( Abc_Ntk_t * pNtk, int nFrames, int nWords, int nBinSize, ...@@ -3203,7 +3203,7 @@ int Abc_NtkDarSeqSim3( Abc_Ntk_t * pNtk, int nFrames, int nWords, int nBinSize,
{ {
Aig_Man_t * pMan; Aig_Man_t * pMan;
int status, RetValue = -1; int status, RetValue = -1;
clock_t clk = clock(); // clock_t clk = clock();
if ( Abc_NtkGetChoiceNum(pNtk) ) if ( Abc_NtkGetChoiceNum(pNtk) )
{ {
Abc_Print( 1, "Removing %d choices from the AIG.\n", Abc_NtkGetChoiceNum(pNtk) ); Abc_Print( 1, "Removing %d choices from the AIG.\n", Abc_NtkGetChoiceNum(pNtk) );
......
...@@ -1621,12 +1621,13 @@ void sat_solver2_rollback( sat_solver2* s ) ...@@ -1621,12 +1621,13 @@ void sat_solver2_rollback( sat_solver2* s )
} }
// returns memory in bytes used by the SAT solver // returns memory in bytes used by the SAT solver
double sat_solver2_memory( sat_solver2* s ) double sat_solver2_memory( sat_solver2* s, int fAll )
{ {
int i; int i;
double Mem = sizeof(sat_solver2); double Mem = sizeof(sat_solver2);
for (i = 0; i < s->cap*2; i++) if ( fAll )
Mem += s->wlists[i].cap * sizeof(int); for (i = 0; i < s->cap*2; i++)
Mem += s->wlists[i].cap * sizeof(int);
Mem += s->cap * sizeof(veci); // ABC_FREE(s->wlists ); Mem += s->cap * sizeof(veci); // ABC_FREE(s->wlists );
Mem += s->clauses.cap * sizeof(int); Mem += s->clauses.cap * sizeof(int);
Mem += s->learnts.cap * sizeof(int); Mem += s->learnts.cap * sizeof(int);
......
...@@ -49,7 +49,7 @@ extern int sat_solver2_simplify(sat_solver2* s); ...@@ -49,7 +49,7 @@ extern int sat_solver2_simplify(sat_solver2* s);
extern int sat_solver2_solve(sat_solver2* s, lit* begin, lit* end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal); extern int sat_solver2_solve(sat_solver2* s, lit* begin, lit* end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal);
extern void sat_solver2_rollback(sat_solver2* s); extern void sat_solver2_rollback(sat_solver2* s);
extern void sat_solver2_reducedb(sat_solver2* s); extern void sat_solver2_reducedb(sat_solver2* s);
extern double sat_solver2_memory( sat_solver2* s ); extern double sat_solver2_memory( sat_solver2* s, int fAll );
extern double sat_solver2_memory_proof( sat_solver2* s ); extern double sat_solver2_memory_proof( sat_solver2* s );
extern void sat_solver2_setnvars(sat_solver2* s,int n); extern void sat_solver2_setnvars(sat_solver2* s,int n);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment