Skip to content

[ModelicaSystem] only local omc process allowed #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

syntron
Copy link
Contributor

@syntron syntron commented Jun 17, 2025

ModelicaSystem relies on read access to files and the possibility to execute the compiled model; thus, it only works if OMC is started locally

Use OMCProcessLocal to ensure that this requirement is defined

Based on PR #295

@syntron syntron changed the title [ModelicaSystem] only omc process local [ModelicaSystem] only local omc process allowed Jun 17, 2025
@syntron syntron force-pushed the ModelicaSystem_only_OMCProcessLocal branch 2 times, most recently from 21aaab8 to c40bc06 Compare June 23, 2025 17:02
@adeas31
Copy link
Member

adeas31 commented Jun 26, 2025

Does this mean we can't use docker and wsl instances with ModelicaSystem? Is this just because if I/O permission issues?

@syntron
Copy link
Contributor Author

syntron commented Jun 26, 2025

Does this mean we can't use docker and wsl instances with ModelicaSystem? Is this just because if I/O permission issues?

@adeas31 no, the reason is that ModelicaSystem accesses the file system directly without using OMC (create csv file; read result data, etc.). Due to this, the class can only used locally ...

@syntron
Copy link
Contributor Author

syntron commented Jun 26, 2025

Here some more analyses:

ModelicaSystem(Cmd) are using Python functions to access files from the OMC model; if this code is replaced by calls to OMC, the ModelicaSystem classes would be completly independent from the use OMCSessionZMQ(OMCProcess) version used.

However, it would also mean, that some simple functionality is replaced by code which has to go through OMC in the case of a local usage - but it should be possible to abstract the access to the local filesystem! Thus, ModelicaSystem can be used for all systems for which OMCSessionZMQ is defined.

Use cases (line numbers based on master):

@syntron
Copy link
Contributor Author

syntron commented Jun 26, 2025

Another big issue is the call to the executable in simulate() and linearize() using ModelicaSystemCmd(). A solution for this case is also needed - how to call / run the executable from the host within docker / wsl and also local?

@syntron
Copy link
Contributor Author

syntron commented Jun 27, 2025

Another point: if the model executeable is used, the evaluation of the library paths is done for Windows (using *.bat file). However, I never tested this part for linux (docker, wsl). How can we ensure, that the needed (external) libraries are found in this case?

@syntron syntron force-pushed the ModelicaSystem_only_OMCProcessLocal branch from c40bc06 to fdd63e8 Compare June 28, 2025 19:26
@syntron syntron mentioned this pull request Jun 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants