I am using Eclipse with GNU Fortran compiler to compute a large arrays to solve a matrix problem. However, I have read and notice that I am unable to read all my data into the array which causes my project.exe to crash when I invoke -fopenmp into my compiler settings; otherwise, the program works fine.
program Top_tier
integer, parameter:: n=145894, nz_num=4608168
integer ia(n+1), ja(nz_num)
double precision a(nz_num), rhs(n)
integer i
open (21, file='ia.dat')
do i=1, n+1
read(21,*) ia(i)
enddo
close(21)
open (21, file='a.dat')
do i=1, nz_num
read(21,*) a(i)
enddo
close(21)
open (21, file='ja.dat')
do i=1, nz_num
read(21,*) ja(i)
enddo
close(21)
open (21, file='b.dat')
do i=1, n
read(21,*) rhs(i)
enddo
close(21)
End
In my quest to find a solution around it, I have found the most probable cause is the limit of the stack size which can be seen by the fact that if I set nz_num to lesser or equal to 26561, the program will run properly. A possible solution is to set environment variable to increase stacksize but the program does not recognise when I type "setenv" or "export" OMP_STACKSIZE into the program. Am I doing something wrong? Is there any advise on how I can solve this problem?
Thanks!