- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear f 90 programmers
I run a simple code to solve 2-d heat equation using OPENMP
for array size more than (301*301) i got stack overflow error and the code has terminated. But as i defined variables in "MODULE" i got no error. Can anyone explain whay this is for??
Regards
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Module variables are global and statically allocated. If you have local arrays, they will be allocated on the stack, which is good for threading but bad for stack usage. I'd suggest making these ALLOCATABLE arrays and allocating them to the proper size, or increase the stacksize of the application. Static arrays can introduce threading errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may have shifted some of your big arrays from local (default stack) allocation to global heap allocation. When you set /Qopenmp, implying /Qauto, if you don't set heap-arrays, the local arrays have to go on stack, as the compiler doesn't know whether they will be replicated for each thread. This use of MODULE may be a good strategy, to keep shared data off the stack.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Module variables are global and statically allocated. If you have local arrays, they will be allocated on the stack, which is good for threading but bad for stack usage. I'd suggest making these ALLOCATABLE arrays and allocating them to the proper size, or increase the stacksize of the application. Static arrays can introduce threading errors.
Deat Steve
Thanks for reply. Actually i'm so engage with stack overflow error inexecuting my code regarding to what i gonna do in my Ph.d thesis. My main code containsdiffetent variables which defined in common block and most of them are shared between different subroutines. when i run the code in sequential mode i got no error but with OPENMP igot stack overflow and i have to decrease the grid size. may you please tell me what can i do to remove the stack error, in additioni cant define array in allocating mode bacausethe arrays shoulb be share between different program units.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
You may have shifted some of your big arrays from local (default stack) allocation to global heap allocation. When you set /Qopenmp, implying /Qauto, if you don't set heap-arrays, the local arrays have to go on stack, as the compiler doesn't know whether they will be replicated for each thread. This use of MODULE may be a good strategy, to keep shared data off the stack.
Thanks for reply
May you please tell me, how can i use heap-array tocompile a program on intel windows?Inlinux adding this option to command line willdo this, but i don't know whatto doin windows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - ymahmoudi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The property is Fortran > Optiimization > Heap Arrays. Set it to 0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
The property is Fortran > Optiimization > Heap Arrays. Set it to 0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which compiler version are you using?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page