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

Stack Size Exceeded #18

Open
adorta opened this issue Feb 23, 2018 · 0 comments
Open

Stack Size Exceeded #18

adorta opened this issue Feb 23, 2018 · 0 comments

Comments

@adorta
Copy link

adorta commented Feb 23, 2018

Hi!

We've been experiencing a recurring error:

At line 332 of file source/alfa.f90
Internal Error: stash_internal_unit(): Stack Size Exceeded

Checking those lines I see:

332   write (filenameformat(1),"(A,I1,A,I1)") "I",floor(log10(real(axes(1))))+1,".",floor(log10(real(axes(1))))+1
333   write (filenameformat(2),"(A,I1,A,I1)") "I",floor(log10(real(axes(2))))+1,".",floor(log10(real(axes(2))))+1

The problem seems to be related to those I/O operations, while read operations are thread-safe, in this case it seems that write ops are not. Maybe this is caused by our particular libraries (we use Fedora26 and gfortran 7.2.1). I've also compiled with -pthread, but problems are still there.

I have fixed this issue adding an OpenMP Critical section:

332 !$OMP CRITICAL
333   write (filenameformat(1),"(A,I1,A,I1)") "I",floor(log10(real(axes(1))))+1,".",floor(log10(real(axes(1))))+1
334   write (filenameformat(2),"(A,I1,A,I1)") "I",floor(log10(real(axes(2))))+1,".",floor(log10(real(axes(2))))+1
335 !$OMP END CRITICAL

Could you please let us know if there is a better way to fix this issue?

Thanks!

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

No branches or pull requests

1 participant