-
Notifications
You must be signed in to change notification settings - Fork 20
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
Write an example of multiple federates using a single core #100
Comments
@phlptp, I've been poking around in the C API and I'm not sure it is possible to put multiple federates on a single core right now. There's Or maybe I'm entirely mis-understanding how to go about this. |
Just telling it the name of the core will find it. I have done that many times. You can set it in federateInfo object.
|
@phlptp, next challenge with this: handling blocking calls. I'm trying to enter executing mode with two federates and I thought I could use the Here's the code:
Right now, I'm making it through the first two lines but the third line never returns. I am misunderstanding how this should work? |
Do you have a third federate in there? If there is just two of them that should work? If there is a third or some other reason it is blocking then the third line will block until it is granted. There is also an "isAsyncOperationComplete" method that would tell you if the method has completed. |
Good call on the federate count; I had fat-fingered the number of federates the common-core was looking for. Now the hang-up appears to be the |
If the battery has that flag set it won't be able to grant the time unless the charger will not generate any data at time zero, so it would need to have requested the next time, otherwise it is still executing at time 0 and could send the battery a message at that time. So you would need to requestTimeAsync on the charger before the complete for the executing mode on the battery. |
This is the order I have now and hangs if battery has
"charger_fed" is able to complete but the last line never returns. Clearing the flag allows both federates to complete. |
This is what you would need for the battery to enter executing mode with the flag set
|
OK, after much trial and error, I got the whole example to run to completion. Thanks for the guidance, @phlptp. Now I've got to figure out why the results don't match the example on which it is based. |
Example is now working and produces the same results as the fundamental default example on which it is based. Next up, write up the documentation page and get this pushed up into the repos. |
HELICS allows multiple federates to use a single core, effectively representing multiple federates in a single executable. This is more commonly used by developers and is something of a special edge case in the user space. It would be good to have an example of it, though.
The text was updated successfully, but these errors were encountered: