Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
[cRuntime] add some jacobian statistics
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - #2732
  • Loading branch information
wibraun authored and OpenModelica-Hudson committed Oct 19, 2018
1 parent 75c4b3e commit 58cae62
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SimulationRuntime/c/simulation/solver/dassl.c
Expand Up @@ -310,6 +310,12 @@ int dassl_initial(DATA* data, threadData_t *threadData, SOLVER_INFO* solverInfo,
{
infoStreamPrint(LOG_STDOUT, 0, "Jacobian or SparsePattern is not generated or failed to initialize! Switch back to normal.");
dasslData->dasslJacobian = INTERNALNUMJAC;
} else {
ANALYTIC_JACOBIAN* jac = &data->simulationInfo->analyticJacobians[data->callback->INDEX_JAC_A];
infoStreamPrint(LOG_SIMULATION, 1, "Initialized colored Jacobian:");
infoStreamPrint(LOG_SIMULATION, 0, "columns: %d rows: %d", jac->sizeCols, jac->sizeRows);
infoStreamPrint(LOG_SIMULATION, 0, "NNZ: %d colors: %d", jac->sparsePattern.numberOfNoneZeros, jac->sparsePattern.maxColors);
messageClose(LOG_SIMULATION);
}
}
/* default use a user sub-routine for JAC */
Expand Down
7 changes: 7 additions & 0 deletions SimulationRuntime/c/simulation/solver/ida_solver.c
Expand Up @@ -450,7 +450,14 @@ ida_solver_initial(DATA* data, threadData_t *threadData, SOLVER_INFO* solverInfo
flag = IDADense(idaData->ida_mem, idaData->N);
warningStreamPrint(LOG_STDOUT, 0, "IDA linear solver method also switched back to %s", IDA_LS_METHOD_DESC[idaData->linearSolverMethod]);
}
} else {
ANALYTIC_JACOBIAN* jac = &data->simulationInfo->analyticJacobians[data->callback->INDEX_JAC_A];
infoStreamPrint(LOG_SIMULATION, 1, "Initialized colored Jacobian:");
infoStreamPrint(LOG_SIMULATION, 0, "columns: %d rows: %d", jac->sizeCols, jac->sizeRows);
infoStreamPrint(LOG_SIMULATION, 0, "NNZ: %d colors: %d", jac->sparsePattern.numberOfNoneZeros, jac->sparsePattern.maxColors);
messageClose(LOG_SIMULATION);
}

}
/* set up the appropriate function pointer */
if (idaData->linearSolverMethod == IDA_LS_KLU)
Expand Down

0 comments on commit 58cae62

Please sign in to comment.