Skip to content

Commit

Permalink
- ulimit -v -t doesn't seem to work for the given time in -t
Browse files Browse the repository at this point in the history
- trying ulimit -t -v and also added -v limit for simulation executable.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18934 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Feb 2, 2014
1 parent 7e3423d commit dfb0867
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Examples/BuildModelRecursive.mos
Expand Up @@ -21,8 +21,8 @@ libraryVersion:="default";
setCommandLineOptions({"+g=Modelica","+d=nogen"});
OpenModelica.Scripting.Internal.Time.timerTick(OpenModelica.Scripting.Internal.Time.RT_CLOCK_USER_RESERVED);
log:="BuildModelRecursive.html";
ulimitOmc:="1200"; // 20 minutes to generate the C-code
ulimitExe:="480"; // 8 minutes to initialize and run the simulation
ulimitOmc:="900"; // 15 minutes to generate the C-code
ulimitExe:="480"; // 8 minutes to initialize and run the simulation
ulimitMemory:="16000000"; // ~16GB memory at most
default_tolerance:=1e-6;
reference_reltol:=3e-3;
Expand Down Expand Up @@ -158,7 +158,7 @@ timeDiff := -1.0;

OpenModelica.Scripting.Internal.Time.timerTick(OpenModelica.Scripting.Internal.Time.RT_CLOCK_USER_RESERVED);
buildRes := res[1] <> \"\";
simRes := if not buildRes then false else 0 == system(\"ulimit -t "+ulimitExe+" ; ./"+s+" > \"+simFile+\" 2>&1\");
simRes := if not buildRes then false else 0 == system(\"ulimit -t " +ulimitExe+" -v "+ulimitMemory+" ; ./"+s+" > \"+simFile+\" 2>&1\");

system(\"sed -i '300,$ d' '\" + simFile + \"'\"); // Only keep the top 300 lines
timeSim := OpenModelica.Scripting.Internal.Time.timerTock(OpenModelica.Scripting.Internal.Time.RT_CLOCK_USER_RESERVED);
Expand Down Expand Up @@ -250,7 +250,7 @@ str:=if simRes then testcase(timeDiff,referenceOK,if referenceOK then \"\" else
writeFile(statFile + \".verify\", str);getErrorString();
") for s in a);
getErrorString();
results := system_parallel({"ulimit -v "+ulimitMemory+" -t "+ulimitOmc+" ; " + omc + " " + s + ".mos" for s in a});
results := system_parallel({"ulimit -t "+ulimitOmc+" -v "+ulimitMemory+" ; " + omc + " " + s + ".mos" for s in a});
getErrorString();

system("rm -f " + log);
Expand Down

0 comments on commit dfb0867

Please sign in to comment.