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

stack overflow error even set heap arrays 0

Haku
초보자
1,752 조회수

I tried a simple fortran code for openmp in visual studio, while the stack overflow error comes up, from the net information, I tried two ways:
1. changed the heap arrays to 0 as the picture below to set memory on heap.

2. increase the reserve size of stack.

as the result, the second method work while the first failed, could anyone explain why? as if I'm concerning that using the dynamic heap setting will be better while it failed.

# even I set the optimization to other level or custom it also failed

Haku_0-1731313083811.png

Haku_1-1731313111925.pngHaku_2-1731313126624.png

 

레이블 (2)
0 포인트
1 솔루션
TobiasK
중재자
1,691 조회수

@Haku You are using static arrays, heap-arrays only affect automatic and temporary arrays. Generally, we recommend to use allocatable arrays instead of relying on -heap-arrays. Since it seems you are trying to measure performance, please also do the initialization of those 3 arrays in a parallel region.

원본 게시물의 솔루션 보기

0 포인트
2 응답
TobiasK
중재자
1,692 조회수

@Haku You are using static arrays, heap-arrays only affect automatic and temporary arrays. Generally, we recommend to use allocatable arrays instead of relying on -heap-arrays. Since it seems you are trying to measure performance, please also do the initialization of those 3 arrays in a parallel region.

0 포인트
Haku
초보자
1,536 조회수

@TobiasKThank you very much for kind suggestion, now I understand to use allocatable arrays are better than static arrays. And also thanks for your suggestions for parallelization part.

0 포인트
응답