-
Notifications
You must be signed in to change notification settings - Fork 213
Add self-start procedure to CCE #3304
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
Conversation
|
|
||
| template <typename TagList> | ||
| struct get_all_history_tags { | ||
| using type = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for this to be a lazy metafunction rather than an eager one?
| // Returns true if the last action jumped. | ||
| template <typename Stop, typename Whitelist, bool HasPrimitives> | ||
| template <typename Stop, typename Whitelist, bool MultipleHistories = false, | ||
| bool HasPrimitives> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default isn't useful here. If HasPrimitives can be deduced, then so can MultipleHistories.
| /// \see is_a | ||
| template <template <typename...> class U, typename... Args> | ||
| using is_a_t = typename is_a<U, Args...>::type; | ||
| /// @} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in commit message: "tt::is_a lambda" -> "tt::is_a_lambda"
| l_max, end_time, start_time, number_of_radial_points, | ||
| std::make_unique<::TimeSteppers::DormandPrince5>()}}; | ||
| l_max, end_time, start_time, | ||
| std::make_unique<::TimeSteppers::DormandPrince5>(), | ||
| number_of_radial_points}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my understanding, this is because of the change in InitializeWorldtubeBoundary::const_global_cache_tags, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right -- in this case, the runtime system needed the time stepper regardless, but adding it to InitializeWorldtubeBoundary::const_global_cache_tags reordered the tag list.
| db::get<::Tags::TimeStepId>(box) | ||
| .substep_time() | ||
| .fraction() | ||
| .numerator() != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just .fraction() != 0 is clearer.
|
|
||
| size_t get_l_max() const noexcept { return l_max_; } | ||
|
|
||
| const std::unique_ptr<Solutions::WorldtubeData>& get_generator() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you actually need the unique_ptr, or can you just return a reference to the contained value?
Also, I think this should be in the "Allow non-monotonic steps in RT analytic solution for self-start" commit.
|
fixups posted. |
|
Fixups look fine, but apparently something went wrong because some configurations are segfaulting now. |
Sometimes (particularly in CCE), we need to store multiple histories because the underlying variable types differ. This change permits using multiple histories during self-start, under the constraint that the integration order of the histories must match.
|
fixups squashed in, along with a fix for the segfault. Cheers! |
|
Why is that different here? |
|
hm, you're right, the edge case was more peculiar. I don't properly understand the failure, because the case that caused a segfault in the diff --git a/src/Evolution/Systems/Cce/Actions/InitializeWorldtubeBoundary.hpp b/src/Evolution/Systems/Cce/Actions/InitializeWorldtubeBoundary.hpp
index db638051a0..761b6f4ba3 100644
--- a/src/Evolution/Systems/Cce/Actions/InitializeWorldtubeBoundary.hpp
+++ b/src/Evolution/Systems/Cce/Actions/InitializeWorldtubeBoundary.hpp
@@ -61,8 +61,8 @@ struct InitializeWorldtubeBoundaryBase {
if constexpr (std::is_same_v<Tags::AnalyticBoundaryDataManager,
tmpl::front<ManagerTags>>) {
if (dynamic_cast<const Solutions::RobinsonTrautman*>(
- std::addressof((db::get<Tags::AnalyticBoundaryDataManager>(box)
- .get_generator()))) != nullptr) {
+ &(db::get<Tags::AnalyticBoundaryDataManager>(box)
+ .get_generator())) != nullptr) {
if(db::get<::Tags::TimeStepper<>>(box).number_of_substeps() != 1) {
ERROR(
"Do not use RobinsonTrautman analytic solution with a "
diff --git a/tests/Unit/Evolution/Systems/Cce/Actions/Test_InitializeWorldtubeBoundary.cpp b/tests/Unit/Evolution/Systems/Cce/Actions/Test_InitializeWorldtubeBoundary.cpp
index 1f593c7eab..634af40ac8 100644
--- a/tests/Unit/Evolution/Systems/Cce/Actions/Test_InitializeWorldtubeBoundary.cpp
+++ b/tests/Unit/Evolution/Systems/Cce/Actions/Test_InitializeWorldtubeBoundary.cpp
@@ -14,6 +14,7 @@
#include "Domain/Structure/ElementId.hpp"
#include "Evolution/Systems/Cce/Actions/InitializeWorldtubeBoundary.hpp"
#include "Evolution/Systems/Cce/AnalyticSolutions/RobinsonTrautman.hpp"
+#include "Evolution/Systems/Cce/AnalyticSolutions/RotatingSchwarzschild.hpp"
#include "Evolution/Systems/Cce/BoundaryData.hpp"
#include "Evolution/Systems/Cce/Components/WorldtubeBoundary.hpp"
#include "Evolution/Systems/Cce/InterfaceManagers/GhLockstep.hpp"
@@ -209,8 +210,10 @@ void test_analytic_initialization() noexcept {
{l_max, 100.0, 0.0, std::make_unique<::TimeSteppers::RungeKutta3>()}};
runner.set_phase(AnalyticMetavariables::Phase::Initialization);
- ActionTesting::emplace_component<component>(&runner, 0,
- AnalyticBoundaryDataManager{});
+ ActionTesting::emplace_component<component>(
+ &runner, 0,
+ AnalyticBoundaryDataManager{
+ 12_st, 20.0, std::make_unique<Solutions::RotatingSchwarzschild>()});
// this should run the initialization
for (size_t i = 0; i < 3; ++i) {
ActionTesting::next_action<component>(make_not_null(&runner), 0);I also added a commit "Include ExpectedOutput in CCE Robinson-Trautman test" to fix a test failure that appeared on the most recent CI run. Cheers! |
|
a test failed again, this time with a timeout on the RT test case, so I tweaked the parameters to make it run a bit more quickly. I guess now that it does self-start, it's a little slower because it needs to take more steps. |
wthrowe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see anything wrong with either version of the code, so I'm going to call it a compiler bug and not worry about it.
nilsdeppe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one question. If you decide to change anything, please squash immediately :)
| ERROR( | ||
| "Do not use RobinsonTrautman analytic solution with a " | ||
| "substep-based timestepper. This is to prevent severe slowdowns " | ||
| "in the current RobinsonTrautman implementation"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is what these slowdowns are documented somewhere? If not, would it be useful to list them in the error message here so that if someone really wants to use a substep integrator they can?
But also prohibit using substep methods, because that will cause performance problems
- tweak parameters to make run faster for fewer timeouts - include `ExpectedOutput` so directories are cleaned up before re-running the test
|
Added an additional note to the |
Proposed changes
Previously, CCE did not participate in self-start. We seem to have 'gotten away' with it in cases of multistep methods on the rare standalone run that used it, but it's definitely not the right way to do things.
This makes a few tweaks to the self start procedure necessary to support CCE, and includes the self start procedure in the CCE actions.
Upgrade instructions
Any changes to the CCE initialization procedure involving the time step will likely need to be rethought in light of these changes.
Code review checklist
make docto generate the documentation locally intoBUILD_DIR/docs/html.Then open
index.html.code review guide.
bugfixormajor new featureif appropriate.