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

New predefined JLD2 checkpointing #194

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

New predefined JLD2 checkpointing #194

wants to merge 7 commits into from

Conversation

aelligp
Copy link
Collaborator

@aelligp aelligp commented Jan 17, 2025

"""
    checkpointing_particles(dst, particles, phases, phase_ratios; chain=nothing, t=nothing, dt=nothing, particle_args=nothing)

Save the state of particles and related data to a checkpoint file in a jld2 format.


# Arguments
- `dst`: The destination directory where the checkpoint file will be saved.
- `particles::AbstractArray`: The array of particles to be saved.
- `phases::AbstractArray`: The array of phases associated with the particles.
- `phase_ratios::AbstractArray`: The array of phase ratios.
- `fname::String`: The name of the checkpoint file.

## Keyword Arguments
- `chain`: The chain data to be saved. If nothing is stated, the default is `nothing`.
- `t`: The current time to be saved. If nothing is stated, the default is `nothing`.
- `dt`: The timestep to be saved. If nothing is stated, the default is `nothing`.
- `particle_args::Union{Nothing, AbstractArray}`: Additional particle arguments to be saved. If nothing is stated, the default is `nothing`.
"""

The current file is in src/IO/JLD2.jl without an additional module. However, one could do the same as in JustRelax.jl with DataIO

Copy link
Member

@albert-de-montserrat albert-de-montserrat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! Will need to merge from main after #193 is merged

src/IO/JLD2.jl Outdated Show resolved Hide resolved
src/IO/JLD2.jl Outdated Show resolved Hide resolved
src/IO/JLD2.jl Outdated Show resolved Hide resolved
test/test_save_load.jl Show resolved Hide resolved
test/test_save_load.jl Outdated Show resolved Hide resolved
test/test_save_load.jl Outdated Show resolved Hide resolved
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.

2 participants