Added "klu_memgrow_factor" option to control the KLU memory grow factor

This commit is contained in:
Francesco Lannutti 2020-06-30 23:10:23 +02:00
parent 56a6cf719c
commit c68f740e85
7 changed files with 15 additions and 1 deletions

View File

@ -303,6 +303,7 @@ struct CKTcircuit {
#ifdef KLU
unsigned int CKTkluMODE:1;
unsigned int CKTkluMemGrowFactor : 1 ;
#endif
};

View File

@ -120,6 +120,8 @@ enum {
OPT_XMU,
OPT_INDVERBOSITY,
OPT_EPSMIN,
OPT_SPARSE,
OPT_KLU_MEMGROW_FACTOR,
};
#ifdef XSPICE

View File

@ -72,6 +72,7 @@ struct TSKtask {
#ifdef KLU
unsigned int TSKkluMODE:1;
unsigned int TSKkluMemGrowFactor : 1 ;
#endif
};

View File

@ -48,6 +48,7 @@ NIinit(CKTcircuit *ckt)
ckt->CKTmatrix->CKTkluMODE = ckt->CKTkluMODE ; /* TO BE SUBSTITUTED WITH THE HEURISTICS */
klu_defaults (ckt->CKTmatrix->CKTkluCommon) ;
ckt->CKTmatrix->CKTkluCommon->memgrow = ckt->CKTkluMemGrowFactor ;
#endif
ckt->CKTniState = NIUNINITIALIZED;

View File

@ -110,6 +110,7 @@ CKTdoJob(CKTcircuit *ckt, int reset, TSKtask *task)
#ifdef KLU
ckt->CKTkluMODE = task->TSKkluMODE;
ckt->CKTkluMemGrowFactor = task->TSKkluMemGrowFactor ;
#endif
#ifdef NEWTRUNC

View File

@ -78,6 +78,7 @@ CKTnewTask(CKTcircuit *ckt, TSKtask **taskPtr, IFuid taskName, TSKtask **defPtr)
#ifdef KLU
tsk->TSKkluMODE = def->TSKkluMODE;
tsk->TSKkluMemGrowFactor = def->TSKkluMemGrowFactor ;
#endif
#ifdef NEWTRUNC
@ -139,6 +140,7 @@ CKTnewTask(CKTcircuit *ckt, TSKtask **taskPtr, IFuid taskName, TSKtask **defPtr)
#ifdef KLU
tsk->TSKkluMODE = CKTkluON;
tsk->TSKkluMemGrowFactor = 1.2 ;
#endif
#if (1) /*CDHW*/

View File

@ -177,6 +177,10 @@ CKTsetOpt(CKTcircuit *ckt, JOB *anal, int opt, IFvalue *val)
case OPT_SPARSE:
task->TSKkluMODE = (val->iValue == 0);
break;
case OPT_KLU_MEMGROW_FACTOR:
task->TSKkluMemGrowFactor = (val->rValue == 1.2);
break;
#endif
/* gtri - begin - wbk - add new options */
@ -339,7 +343,9 @@ static IFparm OPTtbl[] = {
#ifdef KLU
{ "sparse", OPT_SPARSE, IF_SET|IF_FLAG,
"Set SPARSE 1.3 as Direct Linear Solver" }
"Set SPARSE 1.3 as Direct Linear Solver" },
{ "klu_memgrow_factor", OPT_KLU_MEMGROW_FACTOR, IF_SET|IF_FLAG,
"KLU Memory Grow Factor (default is 1.2)" }
#endif
};