Skip to content
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

problem with synchronization between low computational unit and high computational unit #63

Open
femust opened this issue Apr 7, 2022 · 1 comment

Comments

@femust
Copy link

femust commented Apr 7, 2022

Hey,

so I have encountered one problem with dcplib use and synchronization:

  • If I have 2 slaves with FMU (low complexity model) that exchange information -> result plots are correct and they have the same number of data points, e.g. if the simulation is 10 seconds, we get 1000 samples for each slave if the step is 0.01s -> and here there is no problem BUT
  • If I have the same 2 slaves with FMU but joined with one FMU that is high computational demanding (e.g. particle filter), I see the "simple slaves" results have 1000 samples, but complex FMU has only ~50. So the conclusion is that it seems that the communication within dcp is not synchronized properly even if SYNC option and SYNC callbacks are used.
  • The files structure is similar to the structure that is available in the examples.

Thanks for the suggestions.

image

Here is an example 100 seconds of simulation, complex model only reached 7s.

@clemensschiffer
Copy link
Collaborator

Hi,

sorry for the late reply.
I am not sure if understand fully, but some general pointers:
The SYNC and ASYNC refer to the type of callback of the functions, ie, whether or not the callback is executed in its own thread or not.
E.g. if you use ASYNC in DoStep, it will run in its own thread, but then you will have to call computingFinished(); on your own, and so on.

There is no mechanism to slow down simulation time in SRT mode if one node computes a lot slower than the others.
In SRT all nodes try to keep up with real-time - with best effort as opposed to hard real time- and then effects like this can occur.

If you do not care about RT-capabilities but only care about simulation you could run NRT (which is basically what FMI does).
If you do care about RT then your models should be able to run at RT (or you need to deal with it somehow if they do not).

Not sure if this helps...

Kind regards,
Clemens

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

No branches or pull requests

2 participants