fortran,segmentation fault occured

fortran,segmentation fault occured

hi there.  I encounterd a warning when i run my fortran (90) program:

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
run.x 0000000000403982 Unknown Unknown Unknown
run.x 000000000040393C Unknown Unknown Unknown
libc.so.6 00000030D9A1ECDD Unknown Unknown Unknown
run.x 0000000000403839 Unknown Unknown Unknown

 

this problem occurs when I enlarged my domain size(arrays).  and it can be run perfectly if I just changed to a smaller domain size.

I run this on ssh and my commands are:

ulimit -s unlimited

export KMP_STACKSIZE=9999999999

ifort -openmp Console6.f90 -o run.x

qsub Qbatche

./run.x

 

Does anyone know what happended?    and my complier is intel-11.1

 ATTATCHED IS THE CODE.   THANKS 

 

Fichier attachéTaille
Télécharger Console6.f9041.27 Ko
5 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

Your static data may have exceeded an O/S or Linker size limit of 2GB/3GB/4GB depending on circumstances. I suggest you convert your large arrays to ALLOCATABLE, then allocate at start of program. You will have an issue with the arrays that are equivalenced but these arrays can have TARGET on one and POINTER on the other.

! REAL Kappa_ex(ist+1:iet-1), Kex(ist+1:iet-1)
REAL, ALLOCATABLE, TARGET :: Kappa_ex(:)
REAL, POINTER :: Kex(:)

...
! in program
ALLOCATE Kappa_ex(ist+1:iet-1)
Kex(ist+1:iet-1) => Kappa_ex

Also why parallelize:

!$OMP PARALLEL
Kappa_ex=1.; Kappa_ey=1.; Kappa_ez=1.;
Kappa_hx=1.; Kappa_hy=1.; Kappa_hz=1.;
!$OMP END PARALLEL

You could consider

!$OMP PARALLEL SECTIONS
Kappa_ex=1.
!$OMP SECTION
Kappa_ey=1.
!$OMP SECTION
Kappa_ez=1.
!$OMP SECTION
Kappa_hx=1.
!$OMP SECTION
Kappa_hy=1.
!$OMP SECTION
Kappa_hz=1.
!$OMP END PARALLEL SECTIONS

Jim Dempsey

www.quickthreadprogramming.com

I haven't seen any applications which needed more than KMP_STACKSIZE=40M. Too large a value, with many threads, will consume the global stack, as "unlimited" means only "give me the maximum."

Citação:

JimDempseyAtTheCove escreveu:

Your static data may have exceeded an O/S or Linker size limit of 2GB/3GB/4GB depending on circumstances. I suggest you convert your large arrays to ALLOCATABLE, then allocate at start of program. You will have an issue with the arrays that are equivalenced but these arrays can have TARGET on one and POINTER on the other.

! REAL Kappa_ex(ist+1:iet-1), Kex(ist+1:iet-1)
REAL, ALLOCATABLE, TARGET :: Kappa_ex(:)
REAL, POINTER :: Kex(:)

...
! in program
ALLOCATE Kappa_ex(ist+1:iet-1)
Kex(ist+1:iet-1) => Kappa_ex

Also why parallelize:

!$OMP PARALLEL
Kappa_ex=1.; Kappa_ey=1.; Kappa_ez=1.;
Kappa_hx=1.; Kappa_hy=1.; Kappa_hz=1.;
!$OMP END PARALLEL

You could consider

!$OMP PARALLEL SECTIONS
Kappa_ex=1.
!$OMP SECTION
Kappa_ey=1.
!$OMP SECTION
Kappa_ez=1.
!$OMP SECTION
Kappa_hx=1.
!$OMP SECTION
Kappa_hy=1.
!$OMP SECTION
Kappa_hz=1.
!$OMP END PARALLEL SECTIONS

Jim Dempsey

first of all,thank you.
you mentioned the equivalenced arrays: equivalence(Kappa_ex,Kex)
but actually Kex=1./(Kappa_ex*rx*rt) so I can just comment it out. and it shows the same problem of:
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
run.x 000000000040397F Unknown Unknown Unknown
run.x 000000000040393C Unknown Unknown Unknown
libc.so.6 00000030D9A1ECDD Unknown Unknown Unknown
run.x 0000000000403839 Unknown Unknown Unknown

and for the openmp part, you are right, actually I am new to openmp ,so I am not so sure about what I have writen in the code. thank you so much.

Citação:

tcprince escreveu:

I haven't seen any applications which needed more than KMP_STACKSIZE=40M. Too large a value, with many threads, will consume the global stack, as "unlimited" means only "give me the maximum."

thank you . 40M = 40,000,000 actually I tried some smaller number of this,and it show directly SEGMENTATION FAULT,and 40,000,000 is useable ,and I 'll keep that in mind, but unfortunately the same error still occured: forrtl: severe (174): SIGSEGV, segmentation fault occurred Image PC Routine Line Source run.x 000000000040397F Unknown Unknown Unknown run.x 000000000040393C Unknown Unknown Unknown libc.so.6 00000030D9A1ECDD Unknown Unknown Unknown run.x 0000000000403839 Unknown Unknown Unknown so this may not be the main problem, thank you anyway :)

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui