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

Remove uses of TimeStepId in interpolation #3592

Conversation

wthrowe
Copy link
Member

@wthrowe wthrowe commented Oct 11, 2021

TimeStepId is not a global identifier, so it cannot be used as an ID
for the interpolator component.

Proposed changes

Upgrade instructions

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.

Further comments

@@ -63,9 +63,7 @@ namespace intrp {

namespace InterpolationTarget_detail {
double get_temporal_id_value(double time);
double get_temporal_id_value(const TimeStepId& time_id);
double evaluate_temporal_id_for_expiration(double time);
Copy link
Member Author

Choose a reason for hiding this comment

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

@markscheel What are these two functions? Do we need both of them?

Copy link
Contributor

Choose a reason for hiding this comment

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

These two functions were added by @moxcodes in #3421 so that certain code would work both for double and for TimeStepId, without writing two different versions of that code.

Jordan needed temporal_id to be something different than a double so that self-start would work with #2323 .

If the temporal_id is now always a double, then these two functions should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we should hold off until #3422 is merged so we can see if there's any interaction?

@wthrowe
Copy link
Member Author

wthrowe commented Oct 11, 2021

There are some more of these that I missed.

@wthrowe wthrowe added the in progress Don't review, used for sharing code and getting feedback label Oct 11, 2021
@wthrowe wthrowe force-pushed the remove_interpolate_time_step_id branch from b72541f to fb4ecfe Compare October 11, 2021 21:55
@wthrowe wthrowe removed the in progress Don't review, used for sharing code and getting feedback label Oct 11, 2021
@wthrowe
Copy link
Member Author

wthrowe commented Oct 11, 2021

Got the rest.

@@ -3,15 +3,7 @@

#include "ParallelAlgorithms/Interpolation/InterpolationTargetDetail.hpp"

#include "Time/TimeStepId.hpp"
Copy link
Member

Choose a reason for hiding this comment

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

Nice, I believe this removes the dependence of ParallelInterpolation on Time. Could you double-check, and then remove the dependency from the CMakeLists.txt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, looks like that's the last one for the main library. The test library still uses it, though. Squashed directly.

TimeStepId is not a global identifier, so it cannot be used as an ID
for the interpolator component.
@wthrowe wthrowe force-pushed the remove_interpolate_time_step_id branch from c15bd06 to 9b914e9 Compare October 13, 2021 17:50
@wthrowe
Copy link
Member Author

wthrowe commented Oct 19, 2021

@markscheel ping

Copy link
Contributor

@markscheel markscheel left a comment

Choose a reason for hiding this comment

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

A minor comment about a variable name.

My biggest concern is that in #3421 @moxcodes reverted a PR similar to this one because he needed interpolation during the self-start of GH+CCE, and he couldn't use double as a time identifier. Has that changed? And how does this PR impact #2323 ?

@@ -37,13 +35,17 @@ namespace intrp {

namespace {

struct OtherId : db::SimpleTag {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this called OtherId? Why not TimeId or something that has Time in it?

Copy link
Member Author

Choose a reason for hiding this comment

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

The one it is "other" to is called "Time", so using "Time" and "TimeId" as the two IDs seemed rather confusing. I could go with "Time2" or something?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the code again, I believe that the only reason that there are 2 tags in this test is to test that interpolation works with both TimeStepId and double. So if interpolation only works with double, then I think there doesn't need to be a 2nd tag at all.

@@ -25,6 +26,10 @@ class DataVector;

namespace {

struct OtherId : db::SimpleTag {
Copy link
Contributor

Choose a reason for hiding this comment

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

TimeId? TimeTag?

Copy link
Member Author

@wthrowe wthrowe left a comment

Choose a reason for hiding this comment

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

Yes, it looks like some of this may still be needed. I really want to get rid of the non-CCE stuff, though, since using it that way is wrong and it keeps getting copy-pasted to more places.

@@ -37,13 +35,17 @@ namespace intrp {

namespace {

struct OtherId : db::SimpleTag {
Copy link
Member Author

Choose a reason for hiding this comment

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

The one it is "other" to is called "Time", so using "Time" and "TimeId" as the two IDs seemed rather confusing. I could go with "Time2" or something?

@markscheel
Copy link
Contributor

Currently, I think the idea is that you are supposed to use doubles instead of TimeStepIds everywhere except in CCE-GH self-start (and interpolation currently works with both doubles and TimeStepIds). But yes it is annoying that people keep using TimeStepIds in most places (probably my fault, because the original version of interpolation used only TimeStepIds and not doubles).

@wthrowe
Copy link
Member Author

wthrowe commented Nov 1, 2021

In addition to needing to figure out CCE, this is on hold until the interactions between the control system and AH finder have been worked out to avoid merge conflicts.

@wthrowe wthrowe added the in progress Don't review, used for sharing code and getting feedback label Nov 1, 2021
@wthrowe
Copy link
Member Author

wthrowe commented Aug 17, 2022

This would need to be done very differently to work with CCE stuff. I may revisit this at some point, but I think it will be as easy to start from scratch.

@wthrowe wthrowe closed this Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Don't review, used for sharing code and getting feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants