Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

every simulation fails why?

every simulation fails why?

Bonjours,

from this  morning for every simulation that I  launch by  omshell or omc
omc  always return this message

""""""
Record SimulationResult
    resultFile = "Simulation failed.
"
SimulationResult end;
""""""

for example on omcshell
"""""""""""""""""
>> Cd ("C: / OpenModelica1.5.0/testmodels)
"C: / OpenModelica1.5.0/testmodels"

>> LoadFile ("C: / OpenModelica1.5.0/testmodels/dcmotor.mo)
true

>> Simulated (dcmotor, startTime = 0.0, StopTime = 10.0)
Record SimulationResult
    resultFile = "Simulation failed.
"
SimulationResult end;
""""""""""""""""""""""""
I can not figure out what's 'the problem?

Can someone help me?

I have already tried to uninstall openmodelica,  to delete everything that was in the folder,  to run ccleaner, to restart my system and to reinstall openmodelica but nothing is changed

What is it wrong please?

ps
I have Windows XP with Modelica open 105, and the eclipse with mdt simforge

Re: every simulation fails why?

There are several ways of handling with this:

1. Have a look in any of the generated *.log files. It might point you to the error.
2. Add getErrorString(); after the simulate command as it may give you additional info.
3. Run the script from the command line:
    > cd C:\OpenModelica1.5.0\testmodels
    > ..\bin\omc +showErrorMessages +d=failtrace sim_BouncingBall.mos

Post back here with what you find.

Cheers,
Adrian Pop/

Re: every simulation fails why?

this is the result
it doesn't sound good for me

***************************************
C:\OpenModelica1.5.0\testmodels>..\bin\omc +showErrorMessages +d=failtrace sim_B
ouncingBall.mos
/*- CevalScript.cevalGenerateFunctionDAEs failed( loadFile )*/
/*- CevalScript.cevalGenerateFunction failed(loadFile)*/
/*- CevalScript.cevalGenerateFunctionDAEs failed( simulate )*/
/*- CevalScript.cevalGenerateFunction failed(simulate)*/
/*- CevalScript.cevalGenerateFunctionDAEs failed( plot )*/
/*- CevalScript.cevalGenerateFunction failed(plot)*/
/*- CevalScript.cevalGenerateFunctionDAEs failed( plot )*/
/*- CevalScript.cevalGenerateFunction failed(plot)*/
/*- CevalScript.cevalGenerateFunctionDAEs failed( system )*/
/*- CevalScript.cevalGenerateFunction failed(system)*/
'rm' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
true
""
record SimulationResult
    resultFile = "Simulation failed.
"
end SimulationResult;
""
"No simulation result to plot."
"No simulation result to plot."
1

C:\OpenModelica1.5.0\testmodels>
***************************************

Re: every simulation fails why?

while that is the contain of the file dcmotor.log
**************************
g++ -I"C:\OpenModelica1.5.0\/include" -msse2 -mfpmath=sse  -I. -I"C:/OpenModelica1.5.0/testmodels" -o dcmotor.exe dcmotor.cpp -L"C:/OpenModelica1.5.0/testmodels" -lsim -L"C:\OpenModelica1.5.0\/lib" -lc_runtime -lf2c -lsendData -lQtNetwork-mingw -lQtCore-mingw -lQtGui-mingw -luuid -lole32 -lws2_32
/mingw/lib/libmingwex.a(pformat.o):pformat.ccurrent/sad.text+0x1529): undefined reference to `__get_output_format'
collect2: ld returned 1 exit status
mingw32-make: *** [dcmotor] Error 1
**************************

and I don't have anything when I add  getErrorString()

**********************
simulate(dcmotor,startTime=0.0,stopTime=10.0)
record SimulationResult
    resultFile = "Simulation failed.
"
end SimulationResult;

>> getErrorString()
""
***************************

Re: every simulation fails why?

so ... I should format my pc and reinstall all the stuffs.

I think it's better

Re: every simulation fails why?

No. Do you by any chance installed a new version of MinGW?
OpenModelica distributes with MinGW 3.4.5 and if you install
another one it might be a problem.

As it worked fine before, is something that you did in the meantime.

Cheers,
Adrian Pop/

Re: every simulation fails why?

Hm. I think I found what the problem is.

Here http://lists-archives.org/mingw-users/1 … c-6-0.html
it say that msvcrt.dll version less than 8 does generate these problems.

Somehow you ended up with an older (than version 8) msvcrt.dll in:
c:\windows\system32\msvcrt.dll

See if that is the case and try to install a newer one, i.e.:
http://www.microsoft.com/downloads/deta … laylang=en

Cheers,
Adrian Pop/

Re: every simulation fails why?

Hello,

I have the same issue with Kubuntu 10.04 and Openmodelica 1.5.0 : all simulations failed!

I try the following command

Code:

thierry@ACER-ASPIRE:/usr/share/doc/omc/testmodels$ omc +showErrorMessages +d=failtrace sim_BouncingBall.mos

The result is :

Code:

/*- CevalScript.cevalGenerateFunctionDAEs failed( loadFile )*/

/*- CevalScript.cevalGenerateFunction failed(loadFile)*/
true
""
/*- CevalScript.cevalGenerateFunctionDAEs failed( simulate )*/
/*- CevalScript.cevalGenerateFunction failed(simulate)*/
-!!!Tpl.textFile failed - a system error ?
-!!!Tpl.textFile failed - a system error ?
-!!!Tpl.textFile failed - a system error ?
-SimCodegen.generateInitData failed
record SimulationResult
    resultFile = "Simulation failed.
ERROR: Error writing to file BouncingBall.cpp.
ERROR: Error writing to file BouncingBall_functions.cpp.
ERROR: Error writing to file BouncingBall.makefile.
ERROR: Error writing to file BouncingBall_init.txt.
"
end SimulationResult;
""
"No simulation result to plot."
"No simulation result to plot."
/*- CevalScript.cevalGenerateFunctionDAEs failed( system )*/
/*- CevalScript.cevalGenerateFunction failed(system)*/
0

I have also a HDD with Windows OS (XP SP3) and the result is the same.

I note FONTE user is French (He start the message with "Bonjour"), like me. Do you think Regional or Local Settings could be a way to fix the issue (French have comma for decimal separator)?

Thanks for your help.

Re: every simulation fails why?

/usr/share/doc/omc/testmodels$ omc +showErrorMessages +d=failtrace

There's your problem. You do not have write rights to /usr/share/doc/omc. Only root does. OpenModelica really should put all files in a temp directory instead, but that's for the future current/wink
Swedish locale settings also use comma, and most of the developers are from there so I expect that's not the issue here.

Why you have the same problem in XP I don't know though. Maybe you installed OpenModelica in a path containing a space.

If copying the testmodels to a directory you can write to does not solve the issue, use the command checkSettings() in OMShell and paste the result.

Re: every simulation fails why?

I have copied and pasted sim_BouncingBall.mos in /home/thierry/tmp/ and I have run 'omc +showErrorMessages +d=failtrace  sim_BouncingBall.mos': same result than message #8.

Hereafter the result of checkSettings() command in OMShell-terminal.

Code:

>>> checkSettings()

record OpenModelica.Diagnostics.ImportantValues
    OPENMODELICAHOME = "/usr/",
    OPENMODELICALIBRARY = "/usr/share/omlibrary/modelicalib/",
    OMC_PATH = "/usr//bin/omc",
    OMC_FOUND = true,
    MODELICAUSERCFLAGS = "",
    WORKING_DIRECTORY = "/home/thierry/tmp",
    OS = "linux",
    SENDDATALIBS = " -lsendData -lQtNetwork -lQtCore -lQtGui -lpthread",
    C_COMPILER = "g++",
    C_COMPILER_RESPONDING = true,
    CONFIGURE_CMDLINE = "Configured 2010-07-03 11:00:11 using arguments: '--host=i486-linux-gnu --build=i486-linux-gnu --prefix=/usr --with-omniORB=/usr --with-static-lpsolve=/usr --with-sendData-Qt build_alias=i486-linux-gnu host_alias=i486-linux-gnu CFLAGS=-Wall -g -O2 LDFLAGS= CPPFLAGS='"
end OpenModelica.Diagnostics.ImportantValues;

OMC_PATH contains double slash "//". This is the problem?
No possibility to run checkSettings() with Windows.

Re: every simulation fails why?

Still... The actual code failing is:

Code:

file = fopen(filename,"w");

  if (file == NULL) {
    char *c_tokens[1]={filename};
    c_add_message(21, /* WRITING_FILE_ERROR */
      "SCRIPTING",
      "ERROR",
      "Error writing to file %s.",
      c_tokens,
      1);
    RML_TAILCALLK(rmlFC);
  }

So it really can't open files for writing in that directory. Can you manually create a new file (touch abc.txt) in that directory? Does root own some of the files that omc tries to overwrite?

The double slashes are not a problem. I have them myself.

Re: every simulation fails why?

I have made a mistake in a previous message. The error message is not the same when I copy BouncingBall.mo and sim_BoucingBall.mos under /home. See the result:

Code:

thierry@ACER-ASPIRE:~/camp$ ls

BouncingBall.mo  sim_BouncingBall.mos
thierry@ACER-ASPIRE:~/camp$ touch abc.txt
thierry@ACER-ASPIRE:~/camp$ ls
abc.txt  BouncingBall.mo  sim_BouncingBall.mos
thierry@ACER-ASPIRE:~/camp$ omc +showErrorMessages +d=failtrace sim_BouncingBall.mos
/*- CevalScript.cevalGenerateFunctionDAEs failed( loadFile )*/
/*- CevalScript.cevalGenerateFunction failed(loadFile)*/
true
""
/*- CevalScript.cevalGenerateFunctionDAEs failed( simulate )*/
/*- CevalScript.cevalGenerateFunction failed(simulate)*/
record SimulationResult
    resultFile = "Simulation failed.
"
end SimulationResult;
""
"No simulation result to plot."
"No simulation result to plot."
/*- CevalScript.cevalGenerateFunctionDAEs failed( system )*/
/*- CevalScript.cevalGenerateFunction failed(system)*/
0
thierry@ACER-ASPIRE:~/camp$ ls
abc.txt  BouncingBall.mo  sim_BouncingBall.mos

When I run the BouncingBall model inside OMShell-terminal, OMC write the files:

Code:

thierry@ACER-ASPIRE:~/camp$ OMShell-terminal

Open Source Modelica Terminal Shell
Copyright 1997-2008, PELAB, Linkoping University

To get help on using Mosh and OpenModelica, type "help()" and press enter
Started server using:/usr//bin/omc +d=interactive > /tmp/omshell.log 2>&1 &
res = 0
>>> loadModel(Modelica)
true
>>> loadFile("BouncingBall.mo")
true
>>> simulate(BouncingBall,stopTime=3.0)
record SimulationResult
    resultFile = "Simulation failed.
"
end SimulationResult;
>>> getErrorString()
""
>>> quit()
quit requested, shutting server down
thierry@ACER-ASPIRE:~/camp$ ls
abc.txt           BouncingBall_functions.cpp  BouncingBall.log       output.log
BouncingBall      BouncingBall_init.txt       BouncingBall.makefile  sim_BouncingBall.mos
BouncingBall.cpp  BouncingBall.libs           BouncingBall.mo
thierry@ACER-ASPIRE:~/camp$

Another information, the log file:

Code:

thierry@ACER-ASPIRE:~/camp$ cat BouncingBall.log

g++ -I"/usr//include/omc" -msse2 -mfpmath=sse  -I. -o BouncingBall BouncingBall.cpp   -lsim -L"/usr//lib/omc" -lc_runtime -lf2c -linteractive -lsendData -lQtNetwork -lQtCore -lQtGui -lpthread
thierry@ACER-ASPIRE:~/camp$

What is your feeling?

Thanks and regards,

Re: every simulation fails why?

If you run the executable manually, what does it say? And what does output.log contain (should be the executable output when called from simulate()).

Re: every simulation fails why?

Code:

thierry@ACER-ASPIRE:~/camp$ ls

abc.txt           BouncingBall_functions.cpp  BouncingBall.log       output.log
BouncingBall      BouncingBall_init.txt       BouncingBall.makefile  sim_BouncingBall.mos
BouncingBall.cpp  BouncingBall.libs           BouncingBall.mo
thierry@ACER-ASPIRE:~/camp$ ./BouncingBall
Instruction non permise
thierry@ACER-ASPIRE:~/camp$ cat output.log
Illegal instruction

What does it means? It is the same with Windows.

French translation: "Instruction non permise" = "lllegal instruction"

Re: every simulation fails why?

Hmmm... what version of omc are you running (apt-cache show omc)?

You could probably also provide better information by running gdb:
gdb ./BouncingBall
> run
< Program stopped. Illegal instruction
> bt
< GDB shows a backtrace

Re: every simulation fails why?

Code:

thierry@ACER-ASPIRE:~/camp$ gdb ./BouncingBall

GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/thierry/camp/BouncingBall...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/thierry/camp/BouncingBall
[Thread debugging using libthread_db enabled]

Program received signal SIGILL, Illegal instruction.
0x0805283d in startNonInteractiveSimulation(int, char**) ()
(gdb) bt
#0  0x0805283d in startNonInteractiveSimulation(int, char**) ()
#1  0x08052d98 in main ()
(gdb)

The command

Code:

thierry@ACER-ASPIRE:~/camp$ apt-cache show omc

returns 3 pages. So I run

Code:

thierry@ACER-ASPIRE:~/camp$ apt-cache show omc | grep Version

Version: 5809-1
Version: 5795-1
Version: 5791-1
Version: 5790-1
Version: 5789-1
Version: 5788-1
Version: 5785-1
Version: 5771-1
Version: 5764-1
Version: 5756-1
Version: 5737-1
Version: 5736-1
Version: 5734-1
Version: 5733-1
Version: 5728-1
Version: 5721-1
Version: 5718-1
Version: 5717-1
Version: 5715-1
Version: 5714-1
thierry@ACER-ASPIRE:~/camp$

I have seen in old forum a concern regarding SSE2 instruction. This could be my problem?

Re: every simulation fails why?

It might be that it's using SSE2, but any semi-modern machine has access to it. The simulation runtime does not look at CFLAGS from the configure script, but only the CPU that the system is running on. So it always builds with -msse2...

What is your "uname -m" output?

Re: every simulation fails why?

Anyway, I changed the runtime to use the architecture specified by CFLAGS.
If you want to test it, the build should be generated at 11:30 Paris time assuming nothing is broken.

Re: every simulation fails why?

Hereafter information needed:

Code:

thierry@ACER-ASPIRE:~/camp$ uname -m

i686

I have upgraded Openmodelica (Nightly build)

Code:

thierry@ACER-ASPIRE:~/camp$ apt-cache show omc | grep Version

Version: 5813-1
Version: 5809-1
Version: 5795-1
Version: 5791-1
Version: 5790-1
Version: 5789-1
Version: 5788-1
Version: 5785-1
Version: 5771-1
Version: 5764-1
Version: 5756-1
Version: 5737-1
Version: 5736-1
Version: 5734-1
Version: 5733-1
Version: 5728-1
Version: 5721-1
Version: 5718-1
Version: 5717-1
Version: 5715-1
Version: 5714-1

But result is the same:

Code:

thierry@ACER-ASPIRE:~/camp$ omc +showErrorMessages +d=failtrace sim_BouncingBall.mos

/*- CevalScript.cevalGenerateFunctionDAEs failed( loadFile )*/
/*- CevalScript.cevalGenerateFunction failed(loadFile)*/
true
""
/*- CevalScript.cevalGenerateFunctionDAEs failed( simulate )*/
/*- CevalScript.cevalGenerateFunction failed(simulate)*/
record SimulationResult
    resultFile = "Simulation failed.
"
end SimulationResult;
""
"No simulation result to plot."
"No simulation result to plot."
/*- CevalScript.cevalGenerateFunctionDAEs failed( system )*/
/*- CevalScript.cevalGenerateFunction failed(system)*/
0

I have installed Openmodelica on a laptop with Windows, all work fine. But it would be nice if i can run Openmodelica with my machine.

Re: every simulation fails why?

I'll get on fixing the build on 32-bit tomorrow. I'll just need to check the build logs since it failed.

Re: every simulation fails why?

Yummy... 3 BouncingBall testcases spinning at 100% CPU on the build server.... That's what happens if you try to run simulations without -msse2 -mfpmath=sse current/smile

-msse is not good enough, because the dassl solver requires double precision. And the 387 floating point unit spins forever in simulations. Which means SSE2 is required to use OpenModelica on Linux.

Re: every simulation fails why?

Try omc_5833-1_i386.deb . It's compiled -msse -mfpmath=sse -ffloat-store, which should make the evil fortran code work correctly.

Re: every simulation fails why?

I have installed omc_5833-1_i386.deb. That's work fine. Thank you for your help.

Take care: Build repository don't work, I have downloaded and installed files manualy. I have already seen a post for this issue but bug continues.

Re: every simulation fails why?

What bug remains?

Re: every simulation fails why?

This one: http://www.openmodelica.org/index.php/forum/topic?id=76

Failed to fetch ..... size mismatch
when
sudo apt-get upgrade

Re: every simulation fails why?

Ah. Maybe you have some old downloaded files stored there (/var/cache/apt/archives). The problem is solved so it shouldn't happen again, but if you downloaded some of the bad files, they will still be there

Also, I'm assuming you are using stable or release. Then you won't be able to get the version compiled for SSE instead of SSE2 (until the release comes).

Re: every simulation fails why?

sudo apt-get clean
sudo apt-get upgrade


I am using nigthly build. The last version is omc_5840-1_i386.deb and all is OK.

I am starting to learn Modelica language.

Re: every simulation fails why?

hello
all of my simulation is failed

I have these errors :

[:0:0-0:0] Error: Failed to open simulation result /tmp/OpenModelica_maryam/OMEdit/BuildingEnergySystems.CaseStudies.TemperatureControl.Thermal_equivalent.Rooms.RoomsThermalSimplifiedWithAppliances_res.mat: Too few rows in data_2 matrix

[:0:0-0:0] Error: Error opening the file <b>BuildingEnergySystems.CaseStudies.TemperatureControl.Thermal_equivalent.Rooms.RoomsThermalSimplifiedWithAppliances_res.mat</b>. Too few rows in data_2 matrix

There are 0 guests and 0 other users also viewing this topic