fortran matmul function overflows

fortran matmul function overflows

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.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today