Skip to content

Commit

Permalink
Set a ulimit to prevent one package from spinning in place; the SVGs …
Browse files Browse the repository at this point in the history
…are not critical

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17421 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 27, 2013
1 parent fe9ea79 commit 7742c9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Examples/GenerateDoc.mos
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ end if;
echo(false);
self:=getInstallationDirectoryPath() + "/share/doc/omc/testmodels/GenerateDoc.mos";getErrorString();
py:=getInstallationDirectoryPath() + "/share/doc/omc/testmodels/generate_icons.py";getErrorString();
commands:={"python "+py+" --quiet --output-dir . "+typeNameString(cl) for cl in getClassNames()};getErrorString();
commands:={"(ulimit -t 600 ; python "+py+" --quiet --output-dir . )"+typeNameString(cl) for cl in getClassNames()};getErrorString();
res:=system_parallel(commands);getErrorString();
system("rm -f *.json");getErrorString();
/* if max(res) <> 0 then
Expand Down
6 changes: 4 additions & 2 deletions Examples/generate_icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import json
import logging
import sys
import time
from optparse import OptionParser

import svgwrite
Expand Down Expand Up @@ -1095,6 +1096,7 @@ def getBaseClasses(modelica_class, base_classes):


def main():
t = time.time()
parser = OptionParser()
parser.add_option("--with-html", help="Generate an HTML report with all SVG-files", action="store_true", dest="with_html", default=False)
parser.add_option("--output-dir", help="Directory to generate SVG-files in", type="string", dest="output_dir", default=os.path.abspath('ModelicaIcons'))
Expand Down Expand Up @@ -1181,7 +1183,7 @@ def main():
# print 'FAILED: ' + modelica_class
logger.removeHandler(fh)
except Exception as e:
logger.critical('Failed to generate icons for %s: %s' % (package,sys.exc_info()[1]))
logger.critical('Failed to generate icons for %s after %.1f seconds: %s' % (package,time.time()-t,sys.exc_info()[1]))
raise
if with_html:
logger.info('Generating HTML file ...')
Expand All @@ -1199,7 +1201,7 @@ def main():
f_p.write('</html>\n')

logger.info('HTML file is ready.')
print "Generated svg's for %d models in packages %s" % (len(dwgs),PACKAGES_TO_GENERATE)
print "Generated svg's for %d models in packages %s in %.1f seconds" % (len(dwgs),PACKAGES_TO_GENERATE,time.time()-t)

logger.info('quit OMC')
logger.info('End of application')
Expand Down

0 comments on commit 7742c9d

Please sign in to comment.