Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Stack problems with RESHAPE

sschneid
Beginner
762 Views
Hello,
i tried to write a simple fortran routine that reads a binary file and stores the values in a two-dimensional array. The routine reads the data in a one-dimensional array and afterwards the RESHAPE function rearrange the data. My problem is, that i get some problems with the stack memory. Both arrays are allocated in the heap memory, i dont know if the RESHAPE function generates a temporary array in the stack.
I increased the stack memory in the c++ project settings to solve the problem. Is there a better solution for such a problem?

Thanks, Stephan
0 Kudos
2 Replies
Steven_L_Intel1
Employee
762 Views
Yes, RESHAPE often creates a temporary copy on the stack. Increasing the stack size is the only option for now. We know that we have to add the ability to allocate temps on the heap.
0 Kudos
sschneid
Beginner
762 Views
Thanks for the quick reply,

Stephan
0 Kudos
Reply