Skip to content

Commit

Permalink
- move log-verbose-level from LOG_INIT to LOG_DEBUG for some debug-me…
Browse files Browse the repository at this point in the history
…ssages

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12801 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Sep 6, 2012
1 parent eb27191 commit 0f3e75e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
30 changes: 15 additions & 15 deletions Compiler/Template/CodegenC.tpl
Expand Up @@ -1539,40 +1539,40 @@ template generateMatrix(list<JacobianColumn> jacobianColumn, list<SimVar> seedVa

int functionJac<%matrixname%>_sparse(DATA* data, double* jac)
{
int i, j, l, k=0, ii;
int color, seedVar, i, l, k=0;
int index = INDEX_JAC_<%matrixname%>;
const int maxColor = <%maxColor%>;
const int numSeedVars = <%numSeedVars%>;
for(i=0; i<maxColor; i++)
for(color=0; color<maxColor; color++)
{
for(ii=0; ii<numSeedVars; ii++)
if(data->simulationInfo.analyticJacobians[index].sparsePattern.colorCols[ii]-1 == i)
data->simulationInfo.analyticJacobians[index].seedVars[ii] = 1;
for(i=0; i<numSeedVars; i++)
if(data->simulationInfo.analyticJacobians[index].sparsePattern.colorCols[i]-1 == color)
data->simulationInfo.analyticJacobians[index].seedVars[i] = 1;
functionJac<%matrixname%>_column(data);
for(j=0; j<numSeedVars; j++)
for(seedVar=0; seedVar<numSeedVars; seedVar++)
{
if(data->simulationInfo.analyticJacobians[index].seedVars[j] == 1)
if(data->simulationInfo.analyticJacobians[index].seedVars[seedVar] == 1)
{
if(j == 0)
ii = 0;
if(seedVar == 0)
i = 0;
else
ii = data->simulationInfo.analyticJacobians[index].sparsePattern.leadindex[j-1];
i = data->simulationInfo.analyticJacobians[index].sparsePattern.leadindex[seedVar-1];
for(; ii < data->simulationInfo.analyticJacobians[index].sparsePattern.leadindex[j]; ii++)
for(; i < data->simulationInfo.analyticJacobians[index].sparsePattern.leadindex[seedVar]; i++)
{
l = data->simulationInfo.analyticJacobians[index].sparsePattern.index[ii]-1;
l = data->simulationInfo.analyticJacobians[index].sparsePattern.index[i]-1;
jac[k++] = data->simulationInfo.analyticJacobians[index].resultVars[l];
}
}
}

for(ii=0; ii<numSeedVars; ii++)
if(data->simulationInfo.analyticJacobians[index].sparsePattern.colorCols[ii]-1 == i)
data->simulationInfo.analyticJacobians[index].seedVars[ii] = 0;
for(i=0; i<numSeedVars; i++)
if(data->simulationInfo.analyticJacobians[index].sparsePattern.colorCols[i]-1 == color)
data->simulationInfo.analyticJacobians[index].seedVars[i] = 0;

}
return 0;
Expand Down
13 changes: 7 additions & 6 deletions SimulationRuntime/c/simulation/solver/ipopt_initialization.c
Expand Up @@ -226,13 +226,13 @@
else
{
/* return the values of the jacobian of the constraints */
DEBUG_INFO(LOG_INIT, "ipopt jacobian G");
DEBUG_INFO(LOG_DEBUG, "ipopt jacobian G");

if(ipopt_data->useSymbolic == 1)
{
functionJacG_sparse(ipopt_data->data, values);

if(DEBUG_FLAG(LOG_INIT))
if(DEBUG_FLAG(LOG_DEBUG))
{
int i, j;
int idx = 0;
Expand All @@ -253,7 +253,6 @@
printf("%10.5g ", 0.0);
printf("]\n");
}
printf("\n");
}

}
Expand Down Expand Up @@ -286,14 +285,15 @@
free(gp);
free(gn);

if(DEBUG_FLAG(LOG_INIT))
if(DEBUG_FLAG(LOG_DEBUG))
{
int i, j;
for(i=0; i<n; ++i)
{
printf(" | | column %3d: [ ", i+1);
for(j=0; j<m; ++j)
printf("%10.5g ", values[j*n+i]);
printf("\n");
printf("]\n");
}
}
}
Expand Down Expand Up @@ -366,7 +366,8 @@

if(ipopt_data.useSymbolic == 1)
{
nele_jac = data->simulationInfo.analyticJacobians[INDEX_JAC_G].sparsePattern.leadindex[n-1]; // sparse
/* sparse */
nele_jac = data->simulationInfo.analyticJacobians[INDEX_JAC_G].sparsePattern.leadindex[n-1];
DEBUG_INFO1(LOG_INIT, "number of zeros in the Jacobian of the constraints (jac_g): %d", n*m-nele_jac);
DEBUG_INFO1(LOG_INIT, "number of nonzeros in the Jacobian of the constraints (jac_g): %d", nele_jac);
}
Expand Down

0 comments on commit 0f3e75e

Please sign in to comment.