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

Compiler warns that wrapped libphsh functions are not thread safe due to large arrays not fitting into stack memory #6

Open
Tracked by #17
Liam-Deacon opened this issue Jan 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Liam-Deacon
Copy link
Owner

Liam-Deacon commented Jan 13, 2024

gfortran emits worrying warnings such as the following which may prevent the code from being used concurrently and inhibit its use in downstream python packages:

phaseshifts/lib/libphsh.f:287:40:

  287 |        dimension orb(nrmax,iorbs),rpower(nrmax,0:15)
      |                                        1
Warning: Array ‘rpower’ at (1) is larger than limit set by ‘-fmax-stack-var-size=’, moved from stack to static storage.
This makes the procedure unsafe when called recursively, or concurrently from multiple threads. Consider increasing
the ‘-fmax-stack-var-size=’ limit (or use ‘-frecursive’, which implies unlimited ‘-fmax-stack-var-size’) - or change the
code to use an ALLOCATABLE array. If the variable is never accessed concurrently, this warning can be ignored, and
the variable could also be declared with the SAVE attribute. [-Wsurprising]

NOTE: tested with gfortran versions 11 and 12

@Liam-Deacon Liam-Deacon added the bug Something isn't working label Jan 13, 2024
@Liam-Deacon
Copy link
Owner Author

This is an issue with the Fortran77 compilation mode, with suggestions online to move to FORTRAN90 source with ALLOCATABLE arrays.

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

No branches or pull requests

1 participant