- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I met a very strange problem and took several days to figure out how to solve it, no success so far. the fortran programs can been compiled successfully by both gfortran and ifort, but only excutable file by gfortran can run no problem, the one by ifort metSegmentation fault immediately. Can anyone help me to find the problem in fortran codes, which is a land surface data program, (can been downloadhttp://www.cnrm.meteo.fr/gmme/PROJETS/ECOCLIMAP/ecoclimap_october04_corseptember06.tar), it is simple to compile. Thanks in advance. by the way, I use the latest version of ifort.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - yongjia.song@gmail.com
thanks Ronald and tim, when I add the option heap_array to ifort, everything is fine, so I wonder what is difference w/wo this option, what is reason to make this problem, thank a lot!
All Fortran compilers sometimes need to make temporary copies of arrays during runtime. Some compilers put those temporary data elements on the heap, some put it on the stack. Intel Fortran uses stack by default for array temporaries for performance reasons. Other compilers, like gfortran, use heap. It's just a simple matter of choice where you put them. Intel tries to default to the most efficient and fastest place to put them, which is stack.
ron
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - yongjia.song@gmail.com
I met a very strange problem and took several days to figure out how to solve it, no success so far. the fortran programs can been compiled successfully by both gfortran and ifort, but only excutable file by gfortran can run no problem, the one by ifort metSegmentation fault immediately. Can anyone help me to find the problem in fortran codes, which is a land surface data program, (can been downloadhttp://www.cnrm.meteo.fr/gmme/PROJETS/ECOCLIMAP/ecoclimap_october04_corseptember06.tar), it is simple to compile. Thanks in advance. by the way, I use the latest version of ifort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - yongjia.song@gmail.com
I met a very strange problem and took several days to figure out how to solve it, no success so far. the fortran programs can been compiled successfully by both gfortran and ifort, but only excutable file by gfortran can run no problem, the one by ifort metSegmentation fault immediately. Can anyone help me to find the problem in fortran codes, which is a land surface data program, (can been downloadhttp://www.cnrm.meteo.fr/gmme/PROJETS/ECOCLIMAP/ecoclimap_october04_corseptember06.tar), it is simple to compile. Thanks in advance. by the way, I use the latest version of ifort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
You should tell us what efforts you have made with setting stack size limits in your shell, or with -heap-arrays option (if not using -openmp). These are described in many other posts on the forum. You appear to be asking for many others to perform or repeat your work for you. Remember that gfortran has a different default which could be imitated by heap-arrays setting.
simple test, with ifort try these:
-g -traceback -heap-arrays -mcmodel=medium
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Ronald W. Green (Intel)
simple test, with ifort try these:
-g -traceback -heap-arrays -mcmodel=medium
ron
thanks Ronald and tim, when I add the option heap_array to ifort, everything is fine, so I wonder what is difference w/wo this option, what is reason to make this problem, thank a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - yongjia.song@gmail.com
thanks Ronald and tim, when I add the option heap_array to ifort, everything is fine, so I wonder what is difference w/wo this option, what is reason to make this problem, thank a lot!
All Fortran compilers sometimes need to make temporary copies of arrays during runtime. Some compilers put those temporary data elements on the heap, some put it on the stack. Intel Fortran uses stack by default for array temporaries for performance reasons. Other compilers, like gfortran, use heap. It's just a simple matter of choice where you put them. Intel tries to default to the most efficient and fastest place to put them, which is stack.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Ronald W. Green (Intel)
All Fortran compilers sometimes need to make temporary copies of arrays during runtime. Some compilers put those temporary data elements on the heap, some put it on the stack. Intel Fortran uses stack by default for array temporaries for performance reasons. Other compilers, like gfortran, use heap. It's just a simple matter of choice where you put them. Intel tries to default to the most efficient and fastest place to put them, which is stack.
ron
As I am not very known, so i followed this thread. stack and heap, in layman's version is in ram and swap, right?
also, i found this boost description
on pool.
is it something else? what is the fastest as long as ifort is concerned?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort has the heap-arrays option to switch from stack to heap for allocations larger than the specified size. In a given situation, there is likely to be an optimum value for this choice, but that might well be large enough to require more than the default stack limit of your shell. Ron mentioned earlier today that stack allocation is better with openmp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
ifort has the heap-arrays option to switch from stack to heap for allocations larger than the specified size. In a given situation, there is likely to be an optimum value for this choice, but that might well be large enough to require more than the default stack limit of your shell. Ron mentioned earlier today that stack allocation is better with openmp.
Thanks Tim and Ronald again, I got idea about temporary arrays and automatic arrays created in runtime.

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