I have a code to write a large array.
WRITE(EIN,'(1X,i8,2ES20.10)') (i,coord(i,:),i=1,nnode)
it stops at i=63800. Do you know why? Thanks a lot for your help in advance!
連結已複製
>>I think the issue is that coord(i,:) creates a stack temp that is not removed on each iteration through the loop.
I presume that this is due to the newer generation of programmers (compiler writers) favoring recursive algorithms as opposed to iterative algorithms....
... the code passes simple tests.... but fails in the users hands.
Hmmm.... wouldn't it be ironic if the cause was old code contained a GOTO that could be removed by recursively calling the procedure....
;)
Jim Dempsey
For windows add /link /stack:100000000 to the end of the ifort command works. However, for Linux, I can use command ulimit -s unlimited, before executing the code to resolve this issue. If I want to resolve it during compiling and linking, what command should I use?
This bug got fixed a while ago - the program now completes normally with the 2021.4 compiler, but I don't know how far back the fix goes. The compiler now properly cuts back the stack on each iteration (the correct fix.)