Hi all,
I'm having issues with the size of the matrices I declare on FORTRAN. First of all, I can't declare matrices that are too large. Second, even if the matrices are not too large, the code still crushes when I pass these matrices to other functions.
I'm attaching two pieces of code. The "MAIN.f90" is the main program where objects are declared. The "Toolbox.f90" is a module that contains a function "kron_vec" which I eventually call from MAIN.
In MAIN I declared three matrices: PHIa, PHIx and PHI. PHIa is of size NS x Na, PHIx is of size NS x Nx, and PHI is of size NS x NS; where Na and Nx are integers to be declared and NS = Na*Nx. The matrices PHIa and PHIx are declared as some random numbers (lines 48 and 49), and PHI is the output of the function kron_vec(PHIa,PHIx) (line 51)
If I use Na = 200 and Nx = 50, the code copiles and can declare the matrices PHIa, PHIx, and PHI. However, when use kron_vec(PHIa,PHIx), I get the following error:
forrtl: severe (170): Program Exception - stack overflow
Image PC Routine Line Source
SIZE_TEST.exe 00CDEC57 Unknown Unknown Unknown
SIZE_TEST.exe 00D3F8F3 Unknown Unknown Unknown
SIZE_TEST.exe 00CDEE59 Unknown Unknown Unknown
SIZE_TEST.exe 00CDED1F Unknown Unknown Unknown
kernel32.dll 760C336A Unknown Unknown Unknown
ntdll.dll 775A9902 Unknown Unknown Unknown
ntdll.dll 775A98D5 Unknown Unknown Unknown
If I use Na = 300 and Nx = 100, I cannot even compile the project ...
So it seems that there is a problem itself with big matrices. I understand the case of Na = 300 and Nx = 100 implies a matrix of size 30,000 , but I think this should be manageable. At the same time, there is an issue with passing even smaller matrices to the function. I don't know why the code crush when moving these matrices to the function.
I'm using Parallel Studio XE 2011. I already added the MKL library to the Properties < Fortran < Libraries < Use Intel Math Kernel Library = Parallel (/Qmkl:parallel)
Thanks in advanced for your help!