Orrery
A GPU-accelerated N-body gravitational simulator
Loading...
Searching...
No Matches
checkpoint.hpp
Go to the documentation of this file.
1#pragma once
2
41
42#include <cstdint>
43#include <filesystem>
44#include <string_view>
45
47#include "orrery/core/types.hpp"
49
50namespace orrery::sim {
51
53inline constexpr std::string_view kCheckpointMagic = "ORRERYCK";
54
56inline constexpr std::uint32_t kCheckpointVersion = 1;
57
74
85void write_checkpoint(const std::filesystem::path& path, const Checkpoint& checkpoint);
86
94[[nodiscard]] Checkpoint read_checkpoint(const std::filesystem::path& path);
95
96} // namespace orrery::sim
void write_checkpoint(const std::filesystem::path &path, const Checkpoint &checkpoint)
Write checkpoint to path, atomically.
Checkpoint read_checkpoint(const std::filesystem::path &path)
Read a checkpoint back.
constexpr std::uint32_t kCheckpointVersion
The version of the layout in docs/formats/checkpoint.md.
Definition checkpoint.hpp:56
constexpr std::string_view kCheckpointMagic
The eight bytes every checkpoint starts with.
Definition checkpoint.hpp:53
Storage for a set of point masses in structure-of-arrays layout.
Definition particle_data.hpp:43
Everything a run is, as data.
The particle store: one contiguous array per component.
A run, stopped.
Definition checkpoint.hpp:59
core::ParticleData particles
Positions, velocities, accelerations and masses, exactly as they were.
Definition checkpoint.hpp:72
Configuration configuration
The settings the run was started with, including the ones the command line supplied rather than the f...
Definition checkpoint.hpp:62
core::Index step
How many steps had been taken when this was written.
Definition checkpoint.hpp:69
A whole run, as data.
Definition configuration.hpp:332
The scalar and index types that every layer of the project agrees on.
std::size_t Index
The type of a particle index and of any count of particles.
Definition types.hpp:45