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

Specify temporal_id for interpolation in interpolation target tags #3421

Conversation

moxcodes
Copy link
Contributor

@moxcodes moxcodes commented Aug 9, 2021

Proposed changes

Apologies to @wthrowe , whose commit I found I needed to revert to make this work.

To construct the coupled CCE-GH system without fairly radical rethinking of the communication pattern, we need to perform interpolation during self-start, and that can only be accomplished unambigously if we use a key for the interpolator maps that distinguishes between self-start stage -- so, a double that represents the current time won't work.

The control-flow of interpolation during self start will not use dense triggers.

To support the events and dense triggers needed for most use-cases, I've changed the interpolation framework to use a tag specified by the temporal_id type alias that must now be specified in the interpolation target tags. For almost all cases, that should be ::Tags::Time, but for interpolation during self start can be ::Tags::TimeStepId.

Upgrade instructions

Interpolation target tags must now specify a temporal_id. In almost all cases it should be using temporal_id = ::Tags::Time;.

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

moxcodes added a commit to moxcodes/spectre that referenced this pull request Aug 9, 2021
moxcodes added a commit to moxcodes/spectre that referenced this pull request Aug 9, 2021
Comment on lines 10 to 18
double get_temporal_id_value(const TimeStepId time_id) noexcept {
return time_id.substep_time().value();
}
double evaluate_temporal_id_for_expiration(double time) noexcept {
return time;
}
double evaluate_temporal_id_for_expiration(TimeStepId time_id) noexcept {
return time_id.step_time().value();
}
Copy link
Member

Choose a reason for hiding this comment

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

const&
const
const&

Comment on lines 65 to 68
double get_temporal_id_value(const double time) noexcept;
double get_temporal_id_value(const TimeStepId time_id) noexcept;
double evaluate_temporal_id_for_expiration(const double time) noexcept;
double evaluate_temporal_id_for_expiration(const TimeStepId time_id) noexcept;
Copy link
Member

Choose a reason for hiding this comment

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

No const on the double versions. (The others should change with my previous comment.)

@@ -227,6 +227,7 @@ template <typename PostHorizonFindCallback, typename IsTimeDependent,
struct MockMetavariables {
static constexpr bool use_time_dependent_maps = IsTimeDependent::value;
struct AhA {
using temporal_id = ::Tags::Time;
Copy link
Member

Choose a reason for hiding this comment

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

Drop the alias below in MockMetavariables.

@@ -350,9 +351,7 @@ void test_apparent_horizon(const gsl::not_null<size_t*> test_horizon_called,
// zero iterations.
// Having two temporal_ids tests some logic in the interpolator.
Slab slab(0.0, 1.0);
Copy link
Member

Choose a reason for hiding this comment

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

Delete.

@@ -124,7 +124,7 @@ struct TestSchwarzschildHorizon {
template <typename DbTags, typename Metavariables>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think anything except Time/Tags.hpp should be included from Time.

@@ -88,6 +88,7 @@ struct mock_gh_worldtube_boundary {
struct test_metavariables {
Copy link
Member

Choose a reason for hiding this comment

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

This file is missing several Time includes. I think Slab, Tags, Time, TimeStepId.

} else {
(void)temporal_id;
ERROR("Unsupported temporal id type: " << pretty_type::short_name<
typename metavars::InterpolationTargetA::temporal_id::type>());
Copy link
Member

Choose a reason for hiding this comment

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

static_assert?

} else {
(void)temporal_id;
ERROR("Unsupported temporal id type: "
<< pretty_type::short_name<temporal_id_type>());
Copy link
Member

Choose a reason for hiding this comment

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

static_assert?

CHECK(temporal_id == TimeStepId(true, 0, Time(slab, Rational(14, 15))));
CHECK(temporal_id == TimeStepId(true, 0, Time(slab, Rational(14, 15)))
.substep_time()
.value());
Copy link
Member

Choose a reason for hiding this comment

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

14.0 / 15.0

Same elsewhere, drop any unnecessary includes. If you're concerned about roundoff you can switch to integral values or binary fractions.

@moxcodes
Copy link
Contributor Author

fixup posted.
Cheers!

@wthrowe
Copy link
Member

wthrowe commented Aug 10, 2021

Looks good. Squash.

@moxcodes moxcodes force-pushed the temporal_ids_from_interpolation_targets branch from 62eea1d to ae13208 Compare August 10, 2021 22:27
@moxcodes
Copy link
Contributor Author

Squashed.
Cheers!

Copy link
Member

@kidder kidder left a comment

Choose a reason for hiding this comment

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

only half a review so far; will review changes to tests tomorrow

@moxcodes
Copy link
Contributor Author

@kidder I think several of the comments are regarding the Revert commit -- I'm happy to make the suggested tweaks in a separate commit, but I think we should preserve the git-generated revert as a more honest representation of the commit history (reading a log, I'd expect the Revert to precisely reverse the changes for the specified commit).

@kidder
Copy link
Member

kidder commented Aug 11, 2021

sure, that is fine

Copy link
Member

@kidder kidder left a comment

Choose a reason for hiding this comment

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

I've gone through the tests and have no more requested changes

@moxcodes
Copy link
Contributor Author

posted a fixup commit and the new commit Clean up following reversion to temporal_id for interpolation for the suggested changes to the Revert commit.
Cheers!

Copy link
Member

@kidder kidder left a comment

Choose a reason for hiding this comment

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

you can squash

@moxcodes moxcodes force-pushed the temporal_ids_from_interpolation_targets branch from c69dda6 to cb92120 Compare August 12, 2021 05:12
@moxcodes
Copy link
Contributor Author

fixup squashed in.
Cheers!

@kidder
Copy link
Member

kidder commented Aug 13, 2021

@wthrowe you can merge this if you are happy with it

@wthrowe wthrowe merged commit d97dc8a into sxs-collaboration:develop Aug 13, 2021
@nilsvu nilsvu changed the title specify temporal_id for interpolation in interpolation target tags Specify temporal_id for interpolation in interpolation target tags Sep 5, 2021
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.

None yet

3 participants