-
Notifications
You must be signed in to change notification settings - Fork 365
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 compiler dependent bug for betr #1362
Conversation
With the most recent intel compiler, the betr code crashes when running on more than 24 cpus on edison. The cause of this crash was traced and found related to the passing of arrays between different subroutines. Now all arrays are passed with explicit specification of their lower and upper bounds, so betr can run without noticable issue. However, the advection capability of betr has to be turned off, because the new intel compiler does not work well with passing generic data types. A workaround is developed in betr-v2, and will be integrated in the future. This fix does not affect codes other than betr, so is bfb.
Probably a good bug to fix but we're also trying to move away from Intel 15 to Intel 17. |
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.
Looks like local arrays in called functions were declared with explicit indices and that's why the compiler is complaining about "shape mismatch". So it's a good idea to add indices at call sites to let the compiler check array sizes.
@@ -118,8 +118,9 @@ subroutine betr_tracer_massbalance_check(bounds, lbj, ubj, numf, filter, betrtra | |||
call tracerflux_vars%flux_summary(c, betrtracer_vars) | |||
|
|||
do kk = 1, ngwmobile_tracers | |||
errtracer(c,kk) = beg_tracer_molarmass(c,kk)-end_tracer_molarmass(c,kk) & | |||
+ tracer_flx_netpro(c,kk)-tracer_flx_netphyloss(c,kk) | |||
if(c>maxval(filter))print*,'crazy happend' |
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.
Could you add a more informative message here? Maybe print vals of c and maxval(filter).
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.
This looks like a left over. I might just delete it.
@@ -1412,7 +1413,6 @@ subroutine diagnose_advect_water_flux(bounds, num_hydrologyc, filter_hydrologyc, | |||
|
|||
enddo | |||
|
|||
deallocate(h2osoi_liq_copy) |
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.
This deallocate was removed, but not added elsewhere.
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.
This no longer needed.
@@ -1461,7 +1461,6 @@ subroutine diagnose_drainage_water_flux(bounds, num_hydrologyc, filter_hydrology | |||
enddo | |||
enddo | |||
|
|||
deallocate(h2osoi_liq_copy) |
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.
This deallocate was removed, but not added elsewhere. May cause a memory leak?
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.
The deallocation occurs after the code execution is done. So it follows the implicit deallocation rule as in other extended data types.
@rljacob, Yes, I'm aware that we are moving to 17. But that decision to move was made after I explored this bug. |
No test needed! BFB
BeTR failed when running with the 15.x intel compiler. By updating the compiler configuration and enforce some array shapes during argument passing fixed the bug. Fixes #1326 [BFB]
BeTR failed when running with the 15.x intel compiler. By updating the compiler configuration and enforce some array shapes during argument passing fixed the bug. Fixes #1326 [BFB]
Force user to always go through case.submit
BeTR failed when running with the 15.x intel compiler. By updating the compiler configuration and enforce some array shapes during argument passing fixed the bug. Fixes #1326 [BFB]
BeTR failed when running with the 15.x intel compiler. By updating the compiler configuration and enforce some array shapes during argument passing fixed the bug. Fixes #1326 [BFB]
BeTR failed when running with the 15.x intel compiler. By updating the compiler configuration and enforce some array shapes during argument passing fixed the bug. Fixes #1326 [BFB]
BeTR failed when running with the 15.x intel compiler. By updating the compiler configuration and enforce some array shapes during argument passing fixed the bug. Fixes #1326 [BFB]
BeTR failed when running with the 15.x intel compiler. By updating the compiler configuration and enforce some array shapes during argument passing fixed the bug. Fixes #1326 [BFB]
BeTR failed when running with the 15.x intel compiler. By updating
the compiler configuration and enforce some array shapes during
argument passing fixed the bug.
Fixes #1326
[BFB]