Skip to content

Commit

Permalink
update memory_location during checkin/checkout!
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajid Ali committed Apr 22, 2024
1 parent 74795de commit 107c0bd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/synergia/bunch/bunch.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ class bunch_t {

// checkpoint partiles
void
save_checkpoint_particles(Hdf5_file& file, int idx) const
save_checkpoint_particles(Hdf5_file& file, int idx)
{
get_bunch_particles(PG::regular).save_checkpoint_particles(file, idx);
get_bunch_particles(PG::spectator).save_checkpoint_particles(file, idx);
Expand Down
9 changes: 4 additions & 5 deletions src/synergia/bunch/tests/test_bunch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,16 @@ TEST_CASE("Bunch", "[Bunch]")
CHECK(p2(0, 6) == 123);
CHECK(p2(1, 6) == 124);
CHECK(p2(4, 6) == 127);

CHECK(bunch.get_real_num() == Approx(1e13) );
bunch.set_real_num(1.2e13);
CHECK(bunch.get_real_num() == Approx(1.2e13) );

CHECK(bunch.get_real_num() == Approx(1e13));
bunch.set_real_num(1.2e13);
CHECK(bunch.get_real_num() == Approx(1.2e13));
}

#if defined SYNERGIA_HAVE_OPENPMD

void
check_particle_values(BunchParticles const& bp1, BunchParticles const& bp2)
check_particle_values(BunchParticles& bp1, BunchParticles& bp2)
{
bp1.checkout_particles();
bp2.checkout_particles();
Expand Down
2 changes: 1 addition & 1 deletion src/synergia/bunch/tests/test_bunch_particles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ init_particle_values(BunchParticles& bp)
}

void
check_particle_values(BunchParticles const& bp)
check_particle_values(BunchParticles& bp)
{
bp.checkout_particles();

Expand Down
2 changes: 1 addition & 1 deletion src/synergia/simulation/bunch_simulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ namespace {
}

void
Bunch_simulator::save_checkpoint_particles(std::string const& fname) const
Bunch_simulator::save_checkpoint_particles(std::string const& fname)
{
Hdf5_file file(fname, Hdf5_file::Flag::truncate, *comm);
auto bunches = get_bunch_ptrs(trains);
Expand Down
2 changes: 1 addition & 1 deletion src/synergia/simulation/bunch_simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ class Bunch_simulator {
const_karray1d limits);

// serialization helper
void save_checkpoint_particles(std::string const& fname) const;
void save_checkpoint_particles(std::string const& fname);
void load_checkpoint_particles(std::string const& fname);

std::string
Expand Down

0 comments on commit 107c0bd

Please sign in to comment.