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

Create checkpoint file in pychrono #516

Open
TheCrazyT opened this issue Sep 6, 2024 · 4 comments
Open

Create checkpoint file in pychrono #516

TheCrazyT opened this issue Sep 6, 2024 · 4 comments

Comments

@TheCrazyT
Copy link

So I guess this is not possible, since there is no way to use ChStreamOutAsciiFile etc. .
Are I'm correct?

@TheCrazyT
Copy link
Author

now i found SerializeToJSON but what is the opposite?

@dariomangoni
Copy link
Member

Hi @TheCrazyT,
the short answer is that is not currently possible, except for the only method that you already found.

As you may have seen from the CHANGELOG there have been significant changes to the API. One of this, is obsoleting the ChStreamOutAsciiFile class and replace it with pure STL streams (of which the ChStream[In|Out]AsciiFile were basically slightly more than simple wrappers) that we didn't expose through SWIG yet.

However, this is not the reason for which the serialization/checkpointing is not fully implemented for the PyChrono version. What is truly missing are all the classes in the chrono/serialization folder! These classes leverage some complex C++ feature, together with an heavy use of templates, thus being quite difficult to wrap in SWIG.

That's why the only thing that we exposed in Python and C# is SerializeToJSON that allows us (especially for the Chrono::SolidWorks add-in) to:

  • only export
  • only the entire system
  • only to JSON

We may add some additional methods to expand the flexibility of the serialization also for the wrapped languages, but we do not have strict plans for that!

@rserban
Copy link
Member

rserban commented Sep 8, 2024

Could you please clarify: are you interested in serializing a Chrono system or in checkpointing? The two are not the same thing.

@TheCrazyT
Copy link
Author

Was interested in checkpointing.
But I aleady noticed that this feature is not even complete if you use a c++ program.

As a workaround I am currently using dmtcp for now.
Although I only use it with simple graph creation and without visualisation of the simulation.
Not shure if it would work for that, too.

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

3 participants