|
几种解决方法:
(1)Caused by a limited stack size : automatic arrays are often allocated on the stack whereas allocatable arrays are always allocated on the heap... But this feature depends on the compiler and even on the compiler version.
To include in your .bashrc file the following instruction :
ulimit -s unlimited
(2)Use the options -heap-arrays for ifort compiler and -fno-stack-arrays for gfortran compiler.
Also, the -heap-arrays compiler option can take an optional argument [size] to specify the threshold size in Kbytes at which arrays larger than [size] are allocated on heap, all others on stack. For example:
-heap-arrays 10
puts all automatic and temporary arrays larger than 10Kbytes on heap
(3)Using with -O2 or -O1 optimization in compiling
(4)For segmentation fault (core dumped) error: most linux systems the core dump is default behaviour unless your core file is exceeding the maximum size allowed by the shell. Try doing the following before running the program:
ulimit -c
if it returns 0, or a small number of bytes, then type in the following:
ulimit -c unlimited
this will allow the creation of a core file of unlimited size (in the directory from which you ran the program.
(5)To debug your code: to find bugs a very good test is to compile with checking options, with ifort using e.g.
-g -check all -traceback -gen-interfaces -warn interfaces
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-24 10:50
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社