Skip to content

Commit

Permalink
Remove deprecated code from v0.4 (#1063)
Browse files Browse the repository at this point in the history
* Update documentation to include deprecation removal as part of the release process
* Remove `Storage` from ORANGE surfaces
* Remove Byte
* Remove normalize_direction
* Defer removal of accel interface
* Remove deprecated IO options
* Remove host/device accessor from mirror
  • Loading branch information
sethrj committed Dec 13, 2023
1 parent 7b7bfb2 commit cb176ff
Show file tree
Hide file tree
Showing 73 changed files with 186 additions and 340 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.release.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Target: upstream/develop (always!)
- [ ] Tag the develop branch with ``vX.Y.Z-rc.N`` where N starts with 1, and increment for every time you return to this step due to new pull requests.
- [ ] Run performance regression tests on Summit, Crusher/Frontier, and an additional machine with debug assertions enabled (e.g., Wildstyle).
- [ ] Update documentation with release notes from all pull requests newly included in the release.
- [ ] Check for (and delete if found) code marked as "deprecated: to be removed in vX.Y".
- [ ] Ensure the code documentation builds with as few warnings as possible in the `doc` workflow on the CI.

## Post-merge checklist
Expand Down
2 changes: 1 addition & 1 deletion app/demo-geo-check/demo-geo-check.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void run(std::istream& is)
GeoTrackInitializer trkinit;
inp.at("pos").get_to(trkinit.pos);
inp.at("dir").get_to(trkinit.dir);
normalize_direction(&trkinit.dir);
trkinit.dir = make_unit_vector(trkinit.dir);

CELER_ASSERT(geo_params);
int max_steps = inp.at("max_steps").get<int>();
Expand Down
4 changes: 2 additions & 2 deletions app/demo-interactor/XsGridParams.hh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ class XsGridParams
explicit XsGridParams(Input const& input);

// Access on-device data
DeviceRef const& device_ref() const { return data_.device(); }
DeviceRef const& device_ref() const { return data_.device_ref(); }

// Get host-side data
HostRef const& host_ref() const { return data_.host(); }
HostRef const& host_ref() const { return data_.host_ref(); }

private:
CollectionMirror<TableData> data_;
Expand Down
5 changes: 2 additions & 3 deletions app/demo-rasterizer/ImageStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ ImageStore::ImageStore(ImageRunArgs params)
CELER_EXPECT(params.vertical_pixels > 0);

// Normalize rightward axis
right_ax_ = params.rightward_ax;
normalize_direction(&right_ax_);
right_ax_ = make_unit_vector(params.rightward_ax);

// Vector pointing toward the upper right from the lower left corner
Real3 diagonal;
Expand All @@ -42,7 +41,7 @@ ImageStore::ImageStore(ImageRunArgs params)
{
down_ax_[i] = -diagonal[i] + projection * right_ax_[i];
}
normalize_direction(&down_ax_);
down_ax_ = make_unit_vector(down_ax_);

// Calculate length along each axis
real_type width_x = dot_product(diagonal, right_ax_);
Expand Down
52 changes: 27 additions & 25 deletions doc/appendix/administration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -283,41 +283,43 @@ or a "backport" branch (minor, patch).
The following process must be followed (and may need iteration to converge) for
each release.

1. Create a ``release-vX.Y.Z`` branch.
2. Ensure all CI jobs passed for the release in question. This is automatic
for releases from the ``develop`` branch (since every pull request must
pass) but should be checked manually for backports.
3. Update documentation with release notes from all pull requests newly
included in the release. *Make sure this happens after all pull requests
targeted for this milestone have been merged*.
Follow the format for previous releases: add a
summary of highlights, and enumerate the pull requests (with PR numbers and
authorship attribution) separated by features and bug requests. Use the
`helper notebook`_ in the Celeritas documents repository to automate this.
4. Tag the branch on your fork with ``vX.Y.Z-rc.N`` where N starts with 1, and
1. Ensure all CI jobs pass for the target branch. This is automatic
for releases from the ``develop`` branch, since every pull request must
pass, but should be checked manually for backports.
2. Create a ``release-vX.Y.Z`` branch from the target.
3. Tag the target branch with ``vX.Y.Z-rc.N`` where N starts with 1, and
increment for every time you return to this step due to new pull requests.
5. Run performance regression tests on Summit (for performance testing),
Crusher/Frontier (for HIP testing), and an additional machine with debug
assertions enabled (e.g., Wildstyle).
6. [TODO: define high-level validation tests like `geant-val`_ and a test
The tag can be pushed to your fork, or to the main repository if it should
be shared with other team members
4. Run performance regression tests on Summit/Perlmutter (for performance
testing), Crusher/Frontier (for HIP testing), and an additional machine
with debug assertions enabled (e.g., Wildstyle).
5. [TODO: define high-level validation tests like `geant-val`_ and a test
matrix correlating capability areas (code files/directories changed) to
test names.] Rerun and perform a cursory check on all validation tests that
might be affected by changes since the previous release. More complete
validation (since a change in results might not be an error) can be done
separately.
7. Postpone the release temporarily if major new bugs or performance
6. Postpone the release temporarily if major new bugs or performance
regressions are detected. Create new pull requests for the serious errors
using the standard :ref:`contributing <contributing>` process, and once the
fixes are merged into develop, merge develop into the release branch.
Return to step 3.
8. If only minor updates are needed to fix the build or tests on a particular
machine, include those as part of the "pre-release" pull request that
includes new documentation.
9. Ensure the code documentation builds, preferably without warnings, on a
configuration that has Sphinx, Doxygen, and Breathe active. [TODO: automate
this with CI for doc publishing]
Return to step 2.
7. If only minor updates are needed to fix the build or tests on a particular
machine, include those as part of the release branch.
8. If this is a "major" release (see :ref:`deprecations`),
check for and remove code marked as ``DEPRECATED: to be removed
in vX.Y``.
9. Update documentation with release notes from all pull requests newly
included in the release. *Make sure this happens after all pull requests
targeted for this milestone have been merged*.
Follow the format for previous releases: add a
summary of highlights, and enumerate the pull requests (with PR numbers and
authorship attribution) separated by features and bug requests. Use the
`helper notebook`_ in the Celeritas documents repository to automate this.
10. Submit a pull request with the newly added documentation and any
release-related tweaks, and wait until it's reviewed and merged.
release-related tweaks, and wait until it's reviewed and merged. The unit
tests and documentation should all build and pass the CI.
11. If releasing a backported version branch, cherry-pick this documentation
commit into the backport branch.
12. Use the GitHub interface to create a new release with the documentation
Expand Down
2 changes: 1 addition & 1 deletion src/accel/Logger.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace celeritas
Logger MakeMTLogger(G4RunManager const&);

//---------------------------------------------------------------------------//
//! Manually create a multithread-friendly logger (remove in v0.4)
//! Manually create a multithread-friendly logger (remove in v1.0)
[[deprecated]] inline Logger make_mt_logger(G4RunManager const& rm)
{
return MakeMTLogger(rm);
Expand Down
4 changes: 2 additions & 2 deletions src/celeritas/em/AtomicRelaxationParams.hh
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ class AtomicRelaxationParams final
explicit AtomicRelaxationParams(Input const& inp);

//! Access EADL data on the host
HostRef const& host_ref() const final { return data_.host(); }
HostRef const& host_ref() const final { return data_.host_ref(); }

//! Access EADL data on the device
DeviceRef const& device_ref() const final { return data_.device(); }
DeviceRef const& device_ref() const final { return data_.device_ref(); }

private:
// Whether to simulate non-radiative transitions
Expand Down
4 changes: 2 additions & 2 deletions src/celeritas/em/FluctuationParams.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class FluctuationParams final : public ParamsDataInterface<FluctuationData>
MaterialParams const& materials);

//! Access physics properties on the host
HostRef const& host_ref() const final { return data_.host(); }
HostRef const& host_ref() const final { return data_.host_ref(); }

//! Access physics properties on the device
DeviceRef const& device_ref() const final { return data_.device(); }
DeviceRef const& device_ref() const final { return data_.device_ref(); }

private:
CollectionMirror<FluctuationData> data_;
Expand Down
4 changes: 2 additions & 2 deletions src/celeritas/em/UrbanMscParams.hh
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ class UrbanMscParams final : public ParamsDataInterface<UrbanMscData>
// along-step kernels?

//! Access UrbanMsc data on the host
HostRef const& host_ref() const final { return mirror_.host(); }
HostRef const& host_ref() const final { return mirror_.host_ref(); }

//! Access UrbanMsc data on the device
DeviceRef const& device_ref() const final { return mirror_.device(); }
DeviceRef const& device_ref() const final { return mirror_.device_ref(); }

private:
// Host/device storage and reference
Expand Down
2 changes: 1 addition & 1 deletion src/celeritas/em/interactor/EPlusGGInteractor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ CELER_FUNCTION Interaction EPlusGGInteractor::operator()(Engine& rng)
secondaries[1].direction[i] = eplus_moment * inc_direction_[i]
- inc_energy_ * inc_direction_[i];
}
normalize_direction(&secondaries[1].direction);
secondaries[1].direction = make_unit_vector(secondaries[1].direction);
}

return result;
Expand Down
3 changes: 2 additions & 1 deletion src/celeritas/em/interactor/KleinNishinaInteractor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ CELER_FUNCTION Interaction KleinNishinaInteractor::operator()(Engine& rng)
= inc_direction_[i] * inc_energy_.value()
- result.direction[i] * result.energy.value();
}
normalize_direction(&electron_secondary->direction);
electron_secondary->direction
= make_unit_vector(electron_secondary->direction);

return result;
}
Expand Down
2 changes: 1 addition & 1 deletion src/celeritas/em/interactor/MollerBhabhaInteractor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ CELER_FUNCTION Interaction MollerBhabhaInteractor::operator()(Engine& rng)
* secondary_direction[i];
inc_exiting_direction[i] = inc_momentum_ijk - secondary_momentum_ijk;
}
normalize_direction(&inc_exiting_direction);
inc_exiting_direction = make_unit_vector(inc_exiting_direction);

// Construct interaction for change to primary (incident) particle
const real_type inc_exiting_energy = inc_energy_ - secondary_energy;
Expand Down
2 changes: 1 addition & 1 deletion src/celeritas/em/interactor/MuBremsstrahlungInteractor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ CELER_FUNCTION Interaction MuBremsstrahlungInteractor::operator()(Engine& rng)
* inc_direction_[i]
- epsilon * gamma_dir[i];
}
normalize_direction(&inc_direction);
inc_direction = make_unit_vector(inc_direction);

// Construct interaction for change to primary (incident) particle
Interaction result;
Expand Down
2 changes: 1 addition & 1 deletion src/celeritas/em/interactor/detail/BremFinalStateHelper.hh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ CELER_FUNCTION Interaction BremFinalStateHelper::operator()(Engine& rng)
* secondary_->direction[i];
result.direction[i] = inc_momentum_i - gamma_momentum_i;
}
normalize_direction(&result.direction);
result.direction = make_unit_vector(result.direction);

secondary_->particle_id = gamma_id_;
secondary_->energy = gamma_energy_;
Expand Down
4 changes: 2 additions & 2 deletions src/celeritas/em/model/CombinedBremModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ class CombinedBremModel final : public Model
}

//! Access data on the host
HostRef const& host_ref() const { return data_.host(); }
HostRef const& host_ref() const { return data_.host_ref(); }

//! Access data on the device
DeviceRef const& device_ref() const { return data_.device(); }
DeviceRef const& device_ref() const { return data_.device_ref(); }

private:
//// DATA ////
Expand Down
4 changes: 2 additions & 2 deletions src/celeritas/em/model/LivermorePEModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class LivermorePEModel final : public Model
}

//! Access data on the host
HostRef const& host_ref() const { return data_.host(); }
HostRef const& host_ref() const { return data_.host_ref(); }

//! Access data on the device
DeviceRef const& device_ref() const { return data_.device(); }
DeviceRef const& device_ref() const { return data_.device_ref(); }

private:
// Host/device storage and reference
Expand Down
4 changes: 2 additions & 2 deletions src/celeritas/em/model/RayleighModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class RayleighModel final : public Model
}

//! Access Rayleigh data on the host
HostRef const& host_ref() const { return mirror_.host(); }
HostRef const& host_ref() const { return mirror_.host_ref(); }

//! Access Rayleigh data on the device
DeviceRef const& device_ref() const { return mirror_.device(); }
DeviceRef const& device_ref() const { return mirror_.device_ref(); }

private:
//// DATA ////
Expand Down
4 changes: 2 additions & 2 deletions src/celeritas/em/model/RelativisticBremModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ class RelativisticBremModel final : public Model
}

//! Access data on the host
HostRef const& host_ref() const { return data_.host(); }
HostRef const& host_ref() const { return data_.host_ref(); }

//! Access data on the device
DeviceRef const& device_ref() const { return data_.device(); }
DeviceRef const& device_ref() const { return data_.device_ref(); }

private:
//// DATA ////
Expand Down
4 changes: 2 additions & 2 deletions src/celeritas/em/model/SeltzerBergerModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ class SeltzerBergerModel final : public Model
}

//! Access SB data on the host
HostRef const& host_ref() const { return data_.host(); }
HostRef const& host_ref() const { return data_.host_ref(); }

//! Access SB data on the device
DeviceRef const& device_ref() const { return data_.device(); }
DeviceRef const& device_ref() const { return data_.device_ref(); }

private:
// Host/device storage and reference
Expand Down
4 changes: 2 additions & 2 deletions src/celeritas/em/model/WentzelModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class WentzelModel final : public Model

//!@{
//! Access model data
WentzelHostRef const& host_ref() const { return data_.host(); }
WentzelDeviceRef const& device_ref() const { return data_.device(); }
WentzelHostRef const& host_ref() const { return data_.host_ref(); }
WentzelDeviceRef const& device_ref() const { return data_.device_ref(); }
//!@}

private:
Expand Down
64 changes: 2 additions & 62 deletions src/celeritas/ext/detail/GeantProcessImporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,25 +224,14 @@ void append_table(G4PhysicsTable const* g4table,
switch (table_type)
{
case ImportTableType::dedx:
case ImportTableType::dedx_process:
case ImportTableType::dedx_subsec:
case ImportTableType::dedx_unrestricted:
case ImportTableType::ionization_subsec:
table.x_units = ImportUnits::mev;
table.y_units = ImportUnits::mev_per_cm;
break;
case ImportTableType::csda_range:
case ImportTableType::range:
case ImportTableType::secondary_range:
table.x_units = ImportUnits::mev;
table.y_units = ImportUnits::cm;
break;
case ImportTableType::inverse_range:
table.x_units = ImportUnits::cm;
table.y_units = ImportUnits::mev;
break;
case ImportTableType::lambda:
case ImportTableType::sublambda:
table.x_units = ImportUnits::mev;
table.y_units = ImportUnits::cm_inv;
break;
Expand Down Expand Up @@ -300,10 +289,10 @@ bool all_are_assigned(std::vector<T> const& arr)
* Construct with a selected list of tables.
*/
GeantProcessImporter::GeantProcessImporter(
TableSelection which_tables,
TableSelection,
std::vector<ImportMaterial> const& materials,
std::vector<ImportElement> const& elements)
: materials_(materials), elements_(elements), which_tables_(which_tables)
: materials_(materials), elements_(elements)
{
CELER_ENSURE(!materials_.empty());
CELER_ENSURE(!elements_.empty());
Expand Down Expand Up @@ -389,55 +378,6 @@ GeantProcessImporter::operator()(G4ParticleDefinition const& particle,
append_table(
process.LambdaTable(), ImportTableType::lambda, &result.tables);

if (which_tables_ > TableSelection::minimal)
{
// Inverse range is redundant with range
append_table(process.InverseRangeTable(),
ImportTableType::inverse_range,
&result.tables);

// None of these tables appear to be used in Geant4
if (process.IsIonisationProcess())
{
// The "ionization table" is just the per-process de/dx table for
// ionization
append_table(process.IonisationTable(),
ImportTableType::dedx_process,
&result.tables);
}

else
{
append_table(process.DEDXTable(),
ImportTableType::dedx_process,
&result.tables);
}

#if G4VERSION_NUMBER < 1100
// DEPRECATED: remove in v0.4
append_table(process.DEDXTableForSubsec(),
ImportTableType::dedx_subsec,
&result.tables);
append_table(process.IonisationTableForSubsec(),
ImportTableType::ionization_subsec,
&result.tables);
append_table(process.SubLambdaTable(),
ImportTableType::sublambda,
&result.tables);
// Secondary range is removed in 11.1
append_table(process.SecondaryRangeTable(),
ImportTableType::secondary_range,
&result.tables);
#endif

append_table(process.DEDXunRestrictedTable(),
ImportTableType::dedx_unrestricted,
&result.tables);
append_table(process.CSDARangeTable(),
ImportTableType::csda_range,
&result.tables);
}

CELER_ENSURE(result && all_are_assigned(result.models));
return result;
}
Expand Down

0 comments on commit cb176ff

Please sign in to comment.