fix pgbinary window bug#954
Conversation
|
Either this is a placebo and not actually fixing anything, or I am seeing a very different issue (although I have the exact same stack trace as was shown on slack). The problem I am seeing is
This patch does not fix that for me (it seems unlikely that it could). The following does however (this just guards the limit calculations against bad numbers): diff --git a/star/private/pgstar_support.f90 b/star/private/pgstar_support.f90
index 232dada2b..48544ec06 100644
--- a/star/private/pgstar_support.f90
+++ b/star/private/pgstar_support.f90
@@ -854,17 +854,23 @@ contains
if (use_given_ymin) then
ymin = given_ymin
else
- ymin = minval(yvec(1:npts))
+ ymin = minval(yvec(1:npts), mask=.not. is_bad(yvec(1:npts)))
end if
use_given_ymax = abs(given_ymax + 101.0) > 1e-6
if (use_given_ymax) then
ymax = given_ymax
else
- ymax = maxval(yvec(1:npts))
+ ymax = maxval(yvec(1:npts), mask=.not. is_bad(yvec(1:npts)))
end if
dy = ymax - ymin
+ if (is_bad(dy)) then
+ ymax = given_ymax
+ ymin = given_ymin
+ dy = ymax - ymin
+ end if
+
if (.not. use_given_ymin) ymin = ymin - ymargin * dy
if (.not. use_given_ymax) ymax = ymax + ymargin * dy |
|
Oh good catch @VincentVanlaer! I tried it with the default |
|
Do you mean you only tested Eb's fix with the default inlists, or did you hit the same problem with the default inlists? |
|
Original issue (found in MESA 24.08.1): I'm encountering a weird pgbinary behavior: with Setting I originally thought it was just some interplay between the flags, unrelated to the choice of period -- this seems now incorrect. |
I only tested Eb's fix with the default and found no issues (once a |
|
My fix is just a patch/guard for bad numbers, not the real solution. I believe Vincent has identified the actual source of bad numbers. I can't test though, i can't reproduce on arm. |
|
@Debraheem Did your patch fix this issue for you? Cause that's what I am still somewhat confused about, since it doesn't seem that it can fix this issue. |
Do you have a workdir that reproduces this? I'm trying to get this to happen, but I don't know what exactly your setup is. |
|
Mathieu's original backtrace and files attached Backtrace for this error: |
|
Hashed it out with @mathren over slack. The reproducer for the |
|
Just for reference, to get the segfault issue because of the lack of a So it appears there may be two problems at once:
|
|
I think it is not a segfault for the lack of |
186321d to
2d782a0
Compare
|
@Debraheem I have replaced your changes with mine. While it won't be needed with the upcoming refactor of the inlist readers, I have kept @mathren's changes, since people might wonder what Since the changes are separate, it would be best I think to merge this without squashing |
|
I can't remember if it was written rule or just an informal one, but i think we do not squash commits being merged to main. I don't know if there is a specific reason, but it's something we can discuss later. |
|
It can be useful if there is a bunch of small iterations on the same thing, with potentially broken commits in between, |
|
Scratch what i said, here are the guidelines https://docs.mesastar.org/en/latest/developing/contributing.html#merging-a-pull-request. |
|
Yeah that makes sense to me |
|
can you run one test before we merge this? |
|
Do you mean one of the test cases, the entire test suite, or just that this bug is gone? I did test with the 1e99 orbit and that worked fine. |
|
I meant the test_suite, does not need to be an optional test. |
If copying the template and setting `pgbinary_flag=.true.` in binary_job will error and stop if there isn't a pgbinary namelist in inlist_project
2d782a0 to
0767959
Compare
|
Test suite has passed: https://testhub.mesastar.org/main/commits/2d782a0 I have force pushed in the meantime, but that only contains changes to the |
|
See #970 for the follow-up |
This branch attempts to address some pgbinary bugs raised by @mathren. @mathren can you document here how to reproduce your initial issue.