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

Updating torus.cpp to run without radiation #141

Closed
wants to merge 3 commits into from

Conversation

AstroBarker
Copy link
Collaborator

After recent updates, the non-radiative torus problem failed when trying to get opacities. I moved all radiation related calls into if (do_rad) {...} and am now able to run both torus.pin and torus_rad.pin without issue.

I also added the c2p_failure_force_fixup_both = false flag to the torus.pin inputs to accommodate those recent changes.

@AstroBarker AstroBarker added the bug Something isn't working label Oct 31, 2022
@@ -277,6 +251,28 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) {

// Radiation
if (do_rad) {
StateDescriptor *opac = pmb->packages.Get("opacity").get();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This won't work on GPU because you're trying to access host side variables (the Opacities object in Params) inside a compute kernel which can be on GPU. Instead, you have to pull out some Opacities object outside of the compute loop and let Kokkos capture that object by value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good to know - thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 I've been tripped up by this a number of times, and it's something to watch out for especially since we still don't quite have the CI running on gpus.

@brryan
Copy link
Collaborator

brryan commented Oct 31, 2022

Nice work getting this working, these are the same issues I noticed and fixed in #142, I recommend we merge that branch instead of this because my changes are a bit different

@AstroBarker AstroBarker deleted the blb/NoRad_torus_fix branch October 31, 2022 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants