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 dependence of ParallelInterpolation on higher-level libs #3561

Closed
4 of 5 tasks
nilsvu opened this issue Sep 29, 2021 · 18 comments
Closed
4 of 5 tasks

Remove dependence of ParallelInterpolation on higher-level libs #3561

nilsvu opened this issue Sep 29, 2021 · 18 comments

Comments

@nilsvu
Copy link
Member

nilsvu commented Sep 29, 2021

The ParallelInterpolation library currently depends on a bunch of libraries like ApparentHorizon, that are really using the interpolation framework, not the other way round. My suggestion is to disentangle these dependencies one-by-one, so we end up with a general ParallelInterpolation framework that other parallel algorithms can use. These are the libraries that the ParallelInterpolation library currently depend on, but shouldn't (not all of them are listed in the CMakeLists.txt):

  • ApparentHorizons (The ApparentHorizons lib should move to ParallelAlgorithms/ and depend on ParallelInterpolation. I suggest naming it ApparentHorizonFinder, because later we want to factor out Strahlkorper/Ylm-related things.) Edit: partially addressed in Fix ApparentHorizon dependencies #5267.
  • Cce and GeneralizedHarmonic (The SendGhWorldtubeData and friends should move to the CCE lib)
  • GeneralRelativity (The KerrHorizon interpolation target depends on this. I'm not sure what to do with this one, maybe just leave it for now.)
  • DgSubcell. Edit: Done in Remove DgSubcell from ParallelInterpolation #5274.
  • Time. Edit: Done in Remove Time from ParallelInterpolation #5275.
@nilsvu nilsvu changed the title Remove dependence of ParallelInterpolation on ApparentHorizon, GR, CCE, DgSubcell Remove dependence of ParallelInterpolation on higher-level libs Sep 29, 2021
@nilsvu
Copy link
Member Author

nilsvu commented Sep 29, 2021

@markscheel Do you agree with this? Would you be willing to do the ApparentHorizons lib?

@markscheel
Copy link
Contributor

markscheel commented Feb 9, 2022

Here is my suggestion for ApparentHorizons:

  • Move Strahlkorper, StrahlkorperFunctions, ChangeCenterOfStrahlkorper into NumericalAlgorithms/SphericalHarmonics
  • Similarly, move Tags and ComputeItems that depend only on Strahlkorper to NumericalAlgorithms/SphericalHarmonics
  • Create ParallelAlgorithms/ApparentHorizonFinder, and put into it
    • FastFlow
    • ObjectLabel
    • ComputeHorizonVolumeQuantities
  • What to do with StrahlkorperGr, and Tags/ComputeItems that depend on both Strahlkorper and GR quantities??
  • What to do with StrahlkorperInDifferentFrame? (depends on Domain and FunctionsOfTime)??

@nilsvu
Copy link
Member Author

nilsvu commented Feb 10, 2022

Sounds good to me!

  • What do you think about moving StrahlkorperGr and friends into the GeneralRelativity library? It computes GR quantities like expansion, Ricci scalar etc.
  • Move StrahlkorperInDifferentFrame to Domain? We'll probably need it for non-AH things like excision surfaces, right? It does mostly domain and coord map things, so Domain seems the most appropriate place.

@nilsdeppe
Copy link
Member

  • I don't want the GR library depending on Strahlkorper and then possibly interpolation++++
  • If this only depends on domain things the maybe, but I think that's sort of weird. What's wrong with the AH finder library in ParallelAlgorithms depending on GR and domain? Naively those are dependencies I would expect it to have. Are there are things that would depend on the compute tags that aren't horizons (eg excision boundaries)? If that's the case, maybe having the compute tags in PointwiseFunctions/GeneralRelativity/SurfaceQuantities?

@nilsvu
Copy link
Member Author

nilsvu commented Feb 13, 2022

AH surely depends on GR, domain etc. My question above is if we need the StrahlkorperGr functions also for non-AH things like excision surfaces. Therefore:

  • Moving StrahlkorperGr to PointwiseFunctions/GeneralRelativity/SurfaceQuantities and a new GrSurfaceQuantities lib sounds good to me 👍 It can depend on GR and SphericalHarmonics, but on not much more.
  • StrahlkorperInDifferentFrame depends only on Strahlkorper, Domain and FoT, so moving to Domain seems most appropriate I think. It can't be in SphericalHarmonics because that can't depend on Domain, and GrSurfaceQuantities also isn't the right place because that doesn't depend on Domain and StrahlkorperInDifferentFrame doesn't need GR anyway. Domain depends on SphericalHarmonics anyway, so something that combines SphericalHarmonics and domain things seems OK in Domain.

@nilsdeppe
Copy link
Member

  1. 👍
  2. Maybe this depends on whether we want spherical surfaces in a flat spacetime (presumably yes). I would guess that there are quantities like normal vectors that are also different/simpler in flat space. Maybe a PointwiseFunctions/SphericalSurface (or SurfaceQuantities) in addition to the GR lib?

markscheel added a commit to markscheel/spectre that referenced this issue Feb 18, 2022
This is part of issue sxs-collaboration#3561.

Strahlkorper, StrahlkorperFunctions, and
ChangeCenterOfStrahlkorper have been moved to
NumericalAlgorithms/SphericalHarmonics.
Similar for the associated tests.

There are no code changes except renaming/reordering
includes, and changes to CMakeFiles.
@knelli2
Copy link
Contributor

knelli2 commented Feb 18, 2022

  • Create ParallelAlgorithms/ApparentHorizonFinder, and put into it

    • FastFlow
    • ObjectLabel
    • ComputeHorizonVolumeQuantities

I was planning on moving ObjectLabel somewhere else because it isn't specific to apparent horizons and won't be if we use it for stars as well. It has to be in a very general place so any part of the code base can use it, i.e evolution, elliptic, vacuum, hydro, etc... Any suggestions on where it should go? I was thinking either DataStructures because it's just a label for things, or Domain because everything has a domain.

markscheel added a commit to markscheel/spectre that referenced this issue Feb 18, 2022
  1. NumericalAlgorithms/SphericalHarmonics/Tags.hpp gets all the tags
  that are associated with StrahlkorperFunctions.

  2. ApparentHorizons/Tags.hpp still has StrahlkorperGr tags and
  tags for the AH finder.  Those will be split in a later PR.

NumericalAlgorithms/SphericalHarmonics/TagsDeclarations.hpp
and ApparentHorizons/TagsDeclarations.hpp match the corresponding
Tags.hpp files.

Test_Tags.cpp has been split in the same way.

ApparentHorizons/TagsTypeAliases.hpp has been moved to
NumericalAlgorithms/SphericalHarmonics.

This is part of sxs-collaboration#3561.
@nilsvu
Copy link
Member Author

nilsvu commented Feb 18, 2022

@knelli2 I think something like ObjectLabel can be an executable-specific struct that's passed around as template parameter (if it must be a compile-time choice, which ObjectLabel is currently used for), no need to make it super general. E.g. in a BBH exec you define struct ObjectA with name etc, and then you can use Options::name to get a string label. I'll need to think a bit more about how these things could be defined at runtime (like ExcisionSpheres are, for instance).

@wthrowe
Copy link
Member

wthrowe commented Feb 18, 2022

I agree that OptionLabel shouldn't be super general, but having every executable define its own version of this and pass it around seems like the more-unnecessarily general version to me. What is the advantage of doing it that way over a single enum (or maybe small collection of marker stucts)?

markscheel added a commit to markscheel/spectre that referenced this issue Feb 19, 2022
This is part of sxs-collaboration#3561.

  1. NumericalAlgorithms/SphericalHarmonics/Tags.hpp gets all the tags
     that used to be in ApparentHorizons/Tags.hpp and that are
     associated with StrahlkorperFunctions.

  2. ApparentHorizons/Tags.hpp still has StrahlkorperGr tags and
     tags for the AH finder.  Those will be split again in a later
     PR that moves StrahlkorperGr tags elsewhere.

Note:
 * NumericalAlgorithms/SphericalHarmonics/TagsDeclarations.hpp
   and ApparentHorizons/TagsDeclarations.hpp were split in the same way
   as the corresponding Tags.hpp files.

 * Test_Tags.cpp has also been split in the same way.

 * ApparentHorizons/TagsTypeAliases.hpp has been moved to
   NumericalAlgorithms/SphericalHarmonics.
@nilsvu
Copy link
Member Author

nilsvu commented Feb 19, 2022

Sure, what I mean is that we don't have to try hard to share these tiny structs; they don't incur any code duplication. I have often found it easier to define these label structs per-executable so I can give them the names I want for their context, and where they show up in input files. Of course the label structs can still be shared where it helps.

@wthrowe
Copy link
Member

wthrowe commented Feb 19, 2022

The annoyance isn't duplicating the enums/structs, but adding the code to handle them generically. Everything dealing with the objects now needs more template parameters, which have to be forwarded to other functions and classes correctly. It would mean that anything tied to the binary objects would have to be moved out of cpp files into hpp files.

@nilsvu
Copy link
Member Author

nilsvu commented Feb 20, 2022

I see your point @wthrowe. My proposal is then: We do a simple move of ObjectLabel to a new OrbitalDynamics library, e.g. in PointwiseFunctions/. We'll need such a library anyway I think, e.g. for the BNS force balance equation etc.

markscheel added a commit to markscheel/spectre that referenced this issue Feb 22, 2022
This is part of sxs-collaboration#3561.

  1. NumericalAlgorithms/SphericalHarmonics/Tags.hpp gets all the tags
     that used to be in ApparentHorizons/Tags.hpp and that are
     associated with StrahlkorperFunctions.

  2. ApparentHorizons/Tags.hpp still has StrahlkorperGr tags and
     tags for the AH finder.  Those will be split again in a later
     PR that moves StrahlkorperGr tags elsewhere.

Note:
 * NumericalAlgorithms/SphericalHarmonics/TagsDeclarations.hpp
   and ApparentHorizons/TagsDeclarations.hpp were split in the same way
   as the corresponding Tags.hpp files.

 * Test_Tags.cpp has also been split in the same way.

 * ApparentHorizons/TagsTypeAliases.hpp has been moved to
   NumericalAlgorithms/SphericalHarmonics.
@wthrowe
Copy link
Member

wthrowe commented Feb 23, 2022

Sorry, not a hydro guy. What is the "BNS force balance equation"?

@nilsvu
Copy link
Member Author

nilsvu commented Feb 23, 2022

Eq. (5.2) in https://arxiv.org/pdf/1408.4136.pdf.

On a branch I currently have these functions in an OrbitalDynamics library: https://github.com/nilsvu/spectre/blob/xcts/executable_backup/src/PointwiseFunctions/OrbitalDynamics/ForceBalance.hpp
Also: orbital::Tags::CenterOfMass and orbital::Tags::AngularVelocity

@wthrowe
Copy link
Member

wthrowe commented Feb 23, 2022

That's probably OK. I'm just worried about grouping this with too much other stuff because I expect it to be used in at least one of Domain or DomainCreators to identify excision surfaces, and we don't want that adding any major dependencies.

@nilsvu
Copy link
Member Author

nilsvu commented Feb 23, 2022

I See. Maybe it's Domain after all then 🤷‍♂️

@knelli2
Copy link
Contributor

knelli2 commented Feb 23, 2022

This isn't urgent at the moment so maybe we hold off moving it to Domain until we have more binary/orbital stuff we want/need to do? Am I correct in assuming that BNS stuff is still a ways off since we still have to get BBH working?

@nilsvu
Copy link
Member Author

nilsvu commented Aug 2, 2023

Mostly done in #5267. Remaining tasks are listed in #5282.

@nilsvu nilsvu closed this as completed Aug 2, 2023
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

No branches or pull requests

5 participants