Skip to content

Conversation

@brownbaerchen
Copy link
Contributor

I added three functions to the core problem class, which I hope cover most cases:

  • setUpFieldsIO: Mostly for setting up space decomposition. Here, you can call all the class methods of FieldsIO and derived classes
  • getOutputFile: This function is supposed to instantiate a FieldsIO object fully set up, only taking a file name as an argument. This needs to be done individually for the problem classes to set the header and data structure correctly
  • processSolutionForOutput: Do stuff to the solution before writing to the file. For instance, when using spectral methods, you may want to transform from spectral space to real space and throw away the imaginary part to save disc space.

Once these functions are set up for the problem class you want, you can simply add the hook LogToFile (I renamed the previous hook of this name to LogToPickleFile).
You configure this class via class attributes for file name, simulation time increment between writes and whether or not you allow overwriting of previous files.
This hook also supports restarting runs. If the path to the file exists and you are starting from a time greater than zero, it will append the file with the new solutions.

I added the setup of FieldsIO for generic_spectral and TestEquation0D classes. I have used this to run the 3D RBC examples that I will merge at some point.

Finally, I wrote a bunch of tests for this. Note that I am using pytest-isolate-mpi as discussed in #539 here.

This PR works on #534. It is addressing functionality parts rather than documentation, which should be added later as well.

@brownbaerchen
Copy link
Contributor Author

Does anyone have any opinions on this? :)

@tlunet
Copy link
Member

tlunet commented Apr 11, 2025

I'm fine with merging it. especially since @brownbaerchen started to use more the camelCase convention 😍

@pancetta pancetta merged commit 43cf2f5 into Parallel-in-Time:master Apr 11, 2025
87 checks passed
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.

3 participants