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

fortran matmul function overflows

tihomir
Beginner
699 Views
I get stack overflow with the matmul function with a simple code of this type:

a=matmul(b,c)

where a, b and c are pretty large allocatable arrays. Unfortunately I can not know in advance the size of these matrices to request bigger stack at compilation time.

Is there a way to avoid this problem and still use the matmul function or an equivalent of some sort?

Why is the result placed on the stack and it is not stored directly in a?

Thanks a lot for any suggestions.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
699 Views
It would be interesting to see a small but complete example that shows the problem, as well as the compiler version you are using. But if a temp is being created, there is no way I can think of to avoid having it be on the stack.

Steve
0 Kudos
Reply