Skip to content

Commit 81dd075

Browse files
authored
do not distribute zero step size (#185)
* do not distribute zero step size * fix whitespace
1 parent 3b2e71d commit 81dd075

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

testmodel.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,10 @@ def sendExpressionOldOrNew(cmd):
514514
fmisimulator = "%s simulate " % fmisimulator
515515
cmd = "%s --start-time %g --stop-time %g --timeout %g --relative-tolerance %g --interface-type ModelExchange --solver CVode --output-interval %g %s.fmu" % (("--output-file %s" % resFile),startTime,stopTime,conf["ulimitExe"],tolerance,stepSize,conf["fileName"].replace(".","_"))
516516
else: # OMSimulator
517-
cmd = "%s --tempDir=%s --startTime=%g --stopTime=%g --stepSize=%g --timeout=%g --tolerance=%g %s.fmu" % (("-r=%s" % resFile) if outputFormat != "empty" else "",fmitmpdir,startTime,stopTime,stepSize,conf["ulimitExe"],tolerance,conf["fileName"].replace(".","_"))
517+
stepSizeStr = ""
518+
if stepSize != 0.0:
519+
stepSizeStr = " --stepSize=%g" % stepSize
520+
cmd = "%s --tempDir=%s --startTime=%g --stopTime=%g%s --timeout=%g --tolerance=%g %s.fmu" % (("-r=%s" % resFile) if outputFormat != "empty" else "",fmitmpdir,startTime,stopTime,stepSizeStr,conf["ulimitExe"],tolerance,conf["fileName"].replace(".","_"))
518521
with open(simFile,"w") as fp:
519522
fp.write("%s %s\n" % (fmisimulator, cmd))
520523
res = checkOutputTimeout("(rm -f %s.pipe ; mkfifo %s.pipe ; head -c 1048576 < %s.pipe >> %s & %s %s > %s.pipe 2>&1)" % (conf["fileName"],conf["fileName"],conf["fileName"],simFile,fmisimulator,cmd,conf["fileName"]), 1.05*conf["ulimitExe"], conf)

0 commit comments

Comments
 (0)