1

I've got an application that I'm working on which currently takes a model, passes it to OpenModelica, compiles it, runs a simulation, and grabs the output. We'd like to switch over to use Dymola, but I can't figure out how to do this in a GUI-less fashion.

For instance, I've seen how I can use the javascript interface by running "dymola.exe -serverport 8082", but that actually still launches a GUI, and you can see everything running in the background when you use the javascript interface. Plus, closing the GUI kills the server.

Is there any way to use Dymola without a GUI? Note also that I can't simple use the .exe of a compile model, since compiling the model is one of the things I need to do.

Even easier is if there is a way for me to run my .mos file without the GUI launching.

Sterno
  • 1,638
  • 2
  • 17
  • 28

2 Answers2

2

From the command line, dymola.exe -nowindow.

Dag B
  • 621
  • 3
  • 8
  • 1
    Dag, it is my recollection that even with "-nowindow", there is still a need for a desktop. In other words, the initialization of Dymola still goes on as if it were a GUI application. It simply stops short of actually opening a window. I could imagine that this could be an issue if somebody tries to run in a totally "headless" way. Any comments? – Michael Tiller Oct 07 '16 at 12:06
  • Yes, there's still a hidden window. If you are on a Windows or a Linux environment the overhead is still moderate and acceptable for most applications I would guess. – Dag B Oct 09 '16 at 16:13
  • @Dag I would also be interested in a real headless mode, because I would like to run Dymola from a completely headless Ubuntu server, or to be more precise, from Docker. Any chances real headless mode can be added in a future release? – matth Dec 19 '16 at 11:57
  • @matth I suggest we take this offline. Please mail me at work, dag.bruck@3ds.com. – Dag B Dec 21 '16 at 20:36
  • On a completely headless server, Dymola can still be started with the help of [`xvfb`](https://en.wikipedia.org/wiki/Xvfb). If that crashes, try running it like `Xvfb :77 -extension RANDR` (RANDR reports a screen refresh rate of 0 and some versions of Qt5.5 will crash with SIGFPE, so one has to [disable](http://stackoverflow.com/a/18120972/874701) it.). – matth Feb 09 '17 at 09:50
  • @matth A little late to the party but I'm looking to get something done on a headless ubuntu server too. Did you guys manage to do it? – theNotSoPro Jun 02 '21 at 01:18
  • Yes, see some more details here: https://github.com/ibpsa/modelica-ibpsa/issues/816 It might be easier than that today, because both Ubuntu and Dymola have seen updates. Not sure whether Dymola still opens a hidden window; Ubuntu Qt packages have probabyl been updated so that one workaround less is required. – matth Jun 02 '21 at 05:54
  • 1
    @matth Thanks! I thought I'd get a notification from SO if there were a response. I think I'm able to get it going with `xvfb-run`. Not exactly sure yet because I think a licensing modal during start up is preventing my script from getting executed. – theNotSoPro Jun 05 '21 at 00:51
2

you can use Dymola in command line mode and passing the right optional argument to not show its GUI. You should use the following command :

C:/Program Files (x86)/Dymola 2016 FD01/bin64/Dymola.exe /nowindow myscript.mos

With the first part being the pass the the Dymola executable depending on where it was installed on your machine, the second one /nowindow being the optional argument stating that the GUI should not be displayed, and the third part path to your Modelica script which can contained the simulation setup.

Check the Dymola User Guide for additional details.

Best regards, Gilles

Pleki
  • 108
  • 1
  • 11
  • 1
    Thanks, this worked. Is there a specific user Guide you're recommending I look at? I've looked at the User Manual (both volumes 1 and 2) and now that I know to look for "nowindow", I found it, but only in the context of an example script. I still haven't found anything that explicitly lists command line parameters for the application, or specifically discusses running without a window. – Sterno Oct 07 '16 at 13:12