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

Torques bug fixes #29

Merged
merged 12 commits into from
Dec 2, 2024
Merged

Torques bug fixes #29

merged 12 commits into from
Dec 2, 2024

Conversation

rykerfish
Copy link
Contributor

Random collection of bug fixes that I found in my notes.

One important one is that if a mobility function (Mdot, hydrodynamicVelocities, and sqrtMdotW) is called before positions are set, some solvers would throw inscrutable errors. For example, NBody would throw a CUDA memory allocation error. Even though it says you have to call setPosistions first, I wanted to put a more descriptive error in there.

@RaulPPelaez The way I fixed the above bug was a bit gross and involved a getter and setter for a boolean variable in the MobilityInterface. Let me know if you have a better way to fix it!

@RaulPPelaez
Copy link
Contributor

I do not think your solution is a good idea. It is introducing a lot of noise into the interface.
Maybe each solver should be responsible for checking if the positions are valid themselves. They have enough information to know this, for instance by checking if the positions pointer is null, and/or if the number of particles stored for the positions is the same as the current one.
BTW I think this is a symptom of a bad design. Forcing the user to call two functions in sequence always feels strange. I do not have a better alternative, though.

@rykerfish
Copy link
Contributor Author

rykerfish commented Nov 26, 2024

@RaulPPelaez I think (hope) this is good to go! I added the positions check on a per-solver basis which involved pretty minimal changes to most interfaces- good call.

In the process, I refactored a bunch of the testing boilerplate code which added a couple new parameterizations that we had missed. I found an interesting potential bug in the NBody wall kernel that I'm going to open up a separate issue for

@RaulPPelaez
Copy link
Contributor

This is great, thanks Ryker!

@RaulPPelaez RaulPPelaez merged commit 2194b0a into main Dec 2, 2024
1 check passed
@RaulPPelaez RaulPPelaez deleted the torques_bug_fixes branch December 2, 2024 14:54
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.

2 participants