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

Commit c978947

Browse files
Willi BraunOpenModelica-Hudson
authored andcommitted
suppress debug output of max tearing size
1 parent d1d09a1 commit c978947

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Compiler/BackEnd/Tearing.mo

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,11 @@ protected function traverseComponents1 "author: Frenkel TUD 2012-05"
279279
output Integer strongComponentIndexOut=strongComponentIndexIn;
280280
protected
281281
constant Boolean debug = false;
282+
Boolean debugFlag = Flags.isSet(Flags.TEARING_DUMP) or Flags.isSet(Flags.TEARING_DUMPVERBOSE);
282283
algorithm
283284
strongComponentIndexOut := match(inComp)
284285
case(BackendDAE.EQUATIONSYSTEM(jac=BackendDAE.FULL_JACOBIAN())) equation
285-
if Flags.isSet(Flags.TEARING_DUMP) or Flags.isSet(Flags.TEARING_DUMPVERBOSE) then
286+
if debugFlag then
286287
print("Handle strong component with index: " + intString(strongComponentIndexOut+1) + "\nTo disable tearing of this component use '--noTearingForComponent=" + intString(strongComponentIndexOut+1) + "'.\n");
287288
end if;
288289
then (strongComponentIndexOut + 1);
@@ -304,17 +305,19 @@ algorithm
304305
true = getLinearfromJacType(jacType);
305306
maxSize = Flags.getConfigInt(Flags.MAX_SIZE_LINEAR_TEARING);
306307
if intGt(listLength(vindx),maxSize) then
307-
Error.addMessage(Error.MAX_TEARING_SIZE, {intString(strongComponentIndexOut), intString(listLength(vindx)),"linear",intString(maxSize)});
308+
if debugFlag then
309+
Error.addMessage(Error.MAX_TEARING_SIZE, {intString(strongComponentIndexOut), intString(listLength(vindx)),"linear",intString(maxSize)});
310+
end if;
308311
fail();
309312
end if;
310313
if listMember(strongComponentIndexOut,Flags.getConfigIntList(Flags.NO_TEARING_FOR_COMPONENT)) then
311-
if Flags.isSet(Flags.TEARING_DUMP) or Flags.isSet(Flags.TEARING_DUMPVERBOSE) then
314+
if debugFlag then
312315
print("\nTearing deactivated by user.\n");
313316
end if;
314317
Error.addMessage(Error.NO_TEARING_FOR_COMPONENT, {intString(strongComponentIndexOut)});
315318
fail();
316319
end if;
317-
if Flags.isSet(Flags.TEARING_DUMP) or Flags.isSet(Flags.TEARING_DUMPVERBOSE) then
320+
if debugFlag then
318321
print("\nTearing of LINEAR component\nUse Flag '-d=tearingdumpV' for more details\n\n");
319322
end if;
320323
// TODO: Remove when cpp runtime ready for doLinearTearing
@@ -331,17 +334,19 @@ algorithm
331334
false = getLinearfromJacType(jacType);
332335
maxSize = Flags.getConfigInt(Flags.MAX_SIZE_NONLINEAR_TEARING);
333336
if intGt(listLength(vindx),maxSize) then
334-
Error.addMessage(Error.MAX_TEARING_SIZE, {intString(strongComponentIndexOut), intString(listLength(vindx)),"nonlinear",intString(maxSize)});
337+
if debugFlag then
338+
Error.addMessage(Error.MAX_TEARING_SIZE, {intString(strongComponentIndexOut), intString(listLength(vindx)),"nonlinear",intString(maxSize)});
339+
end if;
335340
fail();
336341
end if;
337342
if listMember(strongComponentIndexOut,Flags.getConfigIntList(Flags.NO_TEARING_FOR_COMPONENT)) then
338-
if Flags.isSet(Flags.TEARING_DUMP) or Flags.isSet(Flags.TEARING_DUMPVERBOSE) then
343+
if debugFlag then
339344
print("\nTearing deactivated by user.\n");
340345
end if;
341346
Error.addMessage(Error.NO_TEARING_FOR_COMPONENT, {intString(strongComponentIndexOut)});
342347
fail();
343348
end if;
344-
if Flags.isSet(Flags.TEARING_DUMP) or Flags.isSet(Flags.TEARING_DUMPVERBOSE) then
349+
if debugFlag then
345350
print("\nTearing of NONLINEAR component\nUse Flag '-d=tearingdumpV' for more details\n\n");
346351
end if;
347352
if Flags.isSet(Flags.TEARING_DUMPVERBOSE) then

0 commit comments

Comments
 (0)