Skip to content

Commit

Permalink
Move timings from LOG_LS to LOG_LS_V
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel authored and OpenModelica-Hudson committed Apr 9, 2017
1 parent 65dd5bc commit e05d9d5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 26 deletions.
16 changes: 6 additions & 10 deletions SimulationRuntime/c/simulation/solver/linearSolverKlu.c
Expand Up @@ -221,24 +221,20 @@ solveKlu(DATA *data, threadData_t *threadData, int sysNumber)
}
tmpJacEvalTime = rt_ext_tp_tock(&(solverData->timeClock));
systemData->jacobianTime += tmpJacEvalTime;
infoStreamPrint(LOG_LS, 0, "### %f time to set Matrix A and vector b.", tmpJacEvalTime);
infoStreamPrint(LOG_LS_V, 0, "### %f time to set Matrix A and vector b.", tmpJacEvalTime);

if (ACTIVE_STREAM(LOG_LS_V))
{
if (ACTIVE_STREAM(LOG_LS_V))
{
infoStreamPrint(LOG_LS_V, 1, "Old solution x:");
for(i = 0; i < solverData->n_row; ++i)
infoStreamPrint(LOG_LS_V, 0, "[%d] %s = %g", i+1, modelInfoGetEquation(&data->modelData->modelDataXml,eqSystemNumber).vars[i], systemData->x[i]);
infoStreamPrint(LOG_LS_V, 1, "Old solution x:");
for(i = 0; i < solverData->n_row; ++i)
infoStreamPrint(LOG_LS_V, 0, "[%d] %s = %g", i+1, modelInfoGetEquation(&data->modelData->modelDataXml,eqSystemNumber).vars[i], systemData->x[i]);
messageClose(LOG_LS_V);

messageClose(LOG_LS_V);
}
infoStreamPrint(LOG_LS_V, 1, "Matrix A n_rows = %d", solverData->n_row);
for (i=0; i<solverData->n_row; i++){
infoStreamPrint(LOG_LS_V, 0, "%d. Ap => %d -> %d", i, solverData->Ap[i], solverData->Ap[i+1]);
for (j=solverData->Ap[i]; j<solverData->Ap[i+1]; j++){
infoStreamPrint(LOG_LS_V, 0, "A[%d,%d] = %f", i, solverData->Ai[j], solverData->Ax[j]);

}
}
messageClose(LOG_LS_V);
Expand Down Expand Up @@ -285,7 +281,7 @@ solveKlu(DATA *data, threadData_t *threadData, int sysNumber)
}
}

infoStreamPrint(LOG_LS, 0, "Solve System: %f", rt_ext_tp_tock(&(solverData->timeClock)));
infoStreamPrint(LOG_LS_V, 0, "Solve System: %f", rt_ext_tp_tock(&(solverData->timeClock)));

/* print solution */
if (1 == success){
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/c/simulation/solver/linearSolverLapack.c
Expand Up @@ -208,7 +208,7 @@ int solveLapack(DATA *data, threadData_t *threadData, int sysNumber)
}
tmpJacEvalTime = rt_ext_tp_tock(&(solverData->timeClock));
systemData->jacobianTime += tmpJacEvalTime;
infoStreamPrint(LOG_LS, 0, "### %f time to set Matrix A and vector b.", tmpJacEvalTime);
infoStreamPrint(LOG_LS_V, 0, "### %f time to set Matrix A and vector b.", tmpJacEvalTime);

/* Log A*x=b */
if(ACTIVE_STREAM(LOG_LS_V)){
Expand All @@ -229,7 +229,7 @@ int solveLapack(DATA *data, threadData_t *threadData, int sysNumber)
(int*) &systemData->size,
&solverData->info);

infoStreamPrint(LOG_LS, 0, "Solve System: %f", rt_ext_tp_tock(&(solverData->timeClock)));
infoStreamPrint(LOG_LS_V, 0, "Solve System: %f", rt_ext_tp_tock(&(solverData->timeClock)));

if(solverData->info < 0)
{
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/c/simulation/solver/linearSolverLis.c
Expand Up @@ -246,11 +246,11 @@ solveLis(DATA *data, threadData_t *threadData, int sysNumber)
}
tmpJacEvalTime = rt_ext_tp_tock(&(solverData->timeClock));
systemData->jacobianTime += tmpJacEvalTime;
infoStreamPrint(LOG_LS, 0, "### %f time to set Matrix A and vector b.", tmpJacEvalTime);
infoStreamPrint(LOG_LS_V, 0, "### %f time to set Matrix A and vector b.", tmpJacEvalTime);

rt_ext_tp_tick(&(solverData->timeClock));
err = lis_solve(solverData->A,solverData->b,solverData->x,solverData->solver);
infoStreamPrint(LOG_LS, 0, "Solve System: %f", rt_ext_tp_tock(&(solverData->timeClock)));
infoStreamPrint(LOG_LS_V, 0, "Solve System: %f", rt_ext_tp_tock(&(solverData->timeClock)));

if (err){
warningStreamPrint(LOG_LS_V, 0, "lis_solve : %s(code=%d)\n\n ", lis_returncode[err], err);
Expand Down
Expand Up @@ -432,12 +432,12 @@ int solveTotalPivot(DATA *data, threadData_t *threadData, int sysNumber)
}
tmpJacEvalTime = rt_ext_tp_tock(&(solverData->timeClock));
systemData->jacobianTime += tmpJacEvalTime;
infoStreamPrint(LOG_LS, 0, "### %f time to set Matrix A and vector b.", tmpJacEvalTime);
infoStreamPrint(LOG_LS_V, 0, "### %f time to set Matrix A and vector b.", tmpJacEvalTime);
debugMatrixDoubleLS(LOG_LS_V,"LGS: matrix Ab",solverData->Ab, n, n+1);

rt_ext_tp_tick(&(solverData->timeClock));
status = solveSystemWithTotalPivotSearchLS(n, solverData->x, solverData->Ab, solverData->indRow, solverData->indCol, &rank);
infoStreamPrint(LOG_LS, 0, "Solve System: %f", rt_ext_tp_tock(&(solverData->timeClock)));
infoStreamPrint(LOG_LS_V, 0, "Solve System: %f", rt_ext_tp_tock(&(solverData->timeClock)));

if (status != 0)
{
Expand Down
16 changes: 6 additions & 10 deletions SimulationRuntime/c/simulation/solver/linearSolverUmfpack.c
Expand Up @@ -238,24 +238,20 @@ solveUmfPack(DATA *data, threadData_t *threadData, int sysNumber)
}
tmpJacEvalTime = rt_ext_tp_tock(&(solverData->timeClock));
systemData->jacobianTime += tmpJacEvalTime;
infoStreamPrint(LOG_LS, 0, "### %f time to set Matrix A and vector b.", tmpJacEvalTime);
infoStreamPrint(LOG_LS_V, 0, "### %f time to set Matrix A and vector b.", tmpJacEvalTime);

if (ACTIVE_STREAM(LOG_LS_V))
{
if (ACTIVE_STREAM(LOG_LS_V))
{
infoStreamPrint(LOG_LS_V, 1, "Old solution x:");
for(i = 0; i < solverData->n_row; ++i)
infoStreamPrint(LOG_LS_V, 0, "[%d] %s = %g", i+1, modelInfoGetEquation(&data->modelData->modelDataXml,eqSystemNumber).vars[i], systemData->x[i]);
infoStreamPrint(LOG_LS_V, 1, "Old solution x:");
for(i = 0; i < solverData->n_row; ++i)
infoStreamPrint(LOG_LS_V, 0, "[%d] %s = %g", i+1, modelInfoGetEquation(&data->modelData->modelDataXml,eqSystemNumber).vars[i], systemData->x[i]);
messageClose(LOG_LS_V);

messageClose(LOG_LS_V);
}
infoStreamPrint(LOG_LS_V, 1, "Matrix A n_rows = %d", solverData->n_row);
for (i=0; i<solverData->n_row; i++){
infoStreamPrint(LOG_LS_V, 0, "%d. Ap => %d -> %d", i, solverData->Ap[i], solverData->Ap[i+1]);
for (j=solverData->Ap[i]; j<solverData->Ap[i+1]; j++){
infoStreamPrint(LOG_LS_V, 0, "A[%d,%d] = %f", i, solverData->Ai[j], solverData->Ax[j]);

}
}
messageClose(LOG_LS_V);
Expand Down Expand Up @@ -295,7 +291,7 @@ solveUmfPack(DATA *data, threadData_t *threadData, int sysNumber)
success = 1;
}
}
infoStreamPrint(LOG_LS, 0, "Solve System: %f", rt_ext_tp_tock(&(solverData->timeClock)));
infoStreamPrint(LOG_LS_V, 0, "Solve System: %f", rt_ext_tp_tock(&(solverData->timeClock)));

/* print solution */
if (1 == success){
Expand Down

0 comments on commit e05d9d5

Please sign in to comment.