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

Egstern/304 test offset bunch cdt fails on perlmutter #305

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/synergia/bunch/core_diagnostics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@ Core_diagnostics::calculate_spatial_mean_stddev(Bunch const& bunch)
return mean_and_stddev;
}

double
calculate_median_cdt(Bunch const& bunch)
{
throw std::runtime_error("bunch cdt median not yet implemented");
}

std::vector<double>
Core_diagnostics::kokkos_view_to_stl_vector(karray1d const& view)
{
Expand Down
5 changes: 4 additions & 1 deletion src/synergia/bunch/tests/test_offset_bunch_cdt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ TEST_CASE("Bunch", "[Bunch]")

// Offset the bunch cdt
bunch.offset_bunch_particles_cdt(-0.02);


// particles changed on the device, so check them out for testing
bunch.checkout_particles();

auto new_parts = bunch.get_host_particles();

for (auto i=0; i<localnum; ++i) {
Expand Down
1 change: 1 addition & 0 deletions src/synergia/bunch/tests/test_offset_bunch_cdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test_offset_bunch_cdt(bunch_fixture):
bunch_fixture.offset_bunch_particles_cdt(-0.02)

# check that cdt is set correctly
# particles changed on device so check them out again
bunch_fixture.checkout_particles()
lp = bunch_fixture.get_particles_numpy()
print('particles cdt after offset: ', lp[:, 4])
Expand Down