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

Inter process communication and Openmodelica

Inter process communication and Openmodelica

Hello,
I would like to ask, which means of inter process communication is availible with OMC? I am building a php aplication which should be able to start  OMC and run multiple simulations so it would be as fast as possible and I dont have to start over OMC and load all libraries each  time. I search it a lot and found sockets but it is said it is deprecated method and a CORBA. But I dont really understand CORBA, is it also IPC? Is it usable from PHP? I am using ubuntu, so there is some support for message queues or pipe or sth like that?current/smile
Thanks in advance:)

Re: Inter process communication and Openmodelica

CORBA is IPC: synchronous function calls over TCP/IP. If you want to fork, you could do something like:

Code:

loadString("function fork

  output Integer pid;
external \"C\" pid=fork() annotation(Include=\"#include <unistd.h>\");
end fork;");getErrorString();
loadModel(Modelica);getErrorString();
fork();getErrorString();

But I guess it would be inconvenient. Sockets still work if you like that better than CORBA. I guess PHP does not have CORBA bindings although Python does.

Support for named pipes, stdin, etc is a bit weak in OMC because it parses the full input before running any commands.

Re: Inter process communication and Openmodelica

Thank you current/smile. I decided to implement sockets and it works fine (only after closing socket omc autocloses  but thats not really a problem in my application:).

There are 0 guests and 0 other users also viewing this topic
You are here: