-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
fix for #168 #169
fix for #168 #169
Conversation
How about checking if the array index is valid and only execute those lines then? -----Original Message----- The lines of code that caused the error in tardis/cmontecarlo.c are removed. Since these lines are only used for debugging, there should be no side effect on other parts of the code. git pull https://github.com/mklauser/tardis fix_168 Or you can view, comment on it, or merge it online at: -- Commit Summary -- -- File Changes --
-- Patch Links -- https://github.com/tardis-sn/tardis/pull/169.patch Reply to this email directly or view it on GitHub: |
Checking the array index is also a way to go. However, in my opinion, this is more expensive, and (I think) we don't need this value in compute_distance2line at all. |
Maybe move it to the error reporting if clause. -----Original Message----- Checking the array index is also a way to go. However, in my opinion, this is more expensive, and (I think) we don't need this value here at all. Reply to this email directly or view it on GitHub: |
Great @mklauser! I agree with @orbitfold to movie it to the error reporting if clause. I think it would also be great to get some tests going there, which should be relatively easy. |
@mklauser can you move the offending lines to the error clause and rebase this PR (to master that was just fixed). Then we can merge this. |
@mklauser What's going on with this? Can you fix it so we can merge this. |
@@ -132,8 +130,6 @@ inline tardis_error_t compute_distance2line(rpacket_t *packet, storage_model_t * | |||
fprintf(stderr, "comov_nu = %f\n", comov_nu); | |||
fprintf(stderr, "nu_line = %f\n", nu_line); | |||
fprintf(stderr, "(comov_nu - nu_line) / nu_line = %f\n", (comov_nu - nu_line) / nu_line); | |||
fprintf(stderr, "last_line = %f\n", last_line); |
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.
move line 123-124 -> 135, 136
@mklauser looks good - merging |
The lines of code that caused the error in tardis/cmontecarlo.c are removed. Since these lines are only used for debugging, there should be no side effect on other parts of the code.