ERROR forrtl: severe (174): SIGSEGV

General OpenMP discussion

ERROR forrtl: severe (174): SIGSEGV

Postby vsbgonzalez » Mon Jul 16, 2012 8:33 am

Hi all,

I try to execute this code


!----------------------------------------------------------------------------------------------------------------------------------------------
PROGRAM HOLA
IMPLICIT NONE
REAL, SAVE :: A
REAL, DIMENSION (5), SAVE :: B
REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: C
!$OMP THREADPRIVATE(A,B,C)
A=5.0
B = 10.0

ALLOCATE(C(2,2))
C = 666.0
!$OMP PARALLEL DEFAULT(NONE) COPYIN(A,B,C)
!$OMP SECTIONS
!$OMP SECTION
WRITE(*,*)"HELLO",A,B
WRITE(*,*)"%%%%%%%%%%%%%%%%%%%%"
WRITE(*,*)C
!$OMP SECTION
WRITE(*,*)"HI",A,B
WRITE(*,*)"@@@@@@@@@@@@@@@@@@@@@@"
WRITE(*,*)C
!$OMP END SECTIONS
!$OMP END PARALLEL

STOP
END PROGRAM HOLA

!--------------------------------------------------------------------------------------------------------------------------------------

and i obtain the message

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
a.out 00000000004118B6 Unknown Unknown Unknown
a.out 00000000004036B5 Unknown Unknown Unknown
libiomp5.so 00007F00739BA0D3 Unknown Unknown Unknown

Could someone explain to me what i do wrong ?

i use Intel® Fortran Composer XE 2011 for Linux
and
the code of compilation is
ifort -openmp -parallel -fpp Hello.f90

thanks

Victor
vsbgonzalez
 
Posts: 5
Joined: Thu Oct 20, 2011 12:03 pm

Re: ERROR forrtl: severe (174): SIGSEGV

Postby anv » Fri Jul 20, 2012 9:15 am

Your program is not conforming to the OpenMP specification, because in order to use allocatable threadprivate variable in copyin clause it should either have allocation status of not currently allocated (see lines 8-10 on page 108 of OpenMP API 3.1) or each thread's copy must be allocated with the same bounds (see lines 23-24 on the same page of the spec).

So in order to use allocated allocatable array in copyin clause you should allocate it with the same bounds in all threads first (put "allocate" statement into special extra parallel region before one with the copyin clause, and make sure the dynamic adjustment of threads is disabled just in case). E.g.:

...
!$OMP PARALLEL DEFAULT(NONE)
ALLOCATE(C(2,2))
!$OMP END PARALLEL
C = 666.0
!$OMP PARALLEL DEFAULT(NONE) COPYIN(A,B,C)
...

Regarsd,
Andrey
anv
 
Posts: 31
Joined: Wed Dec 12, 2007 9:36 am

Re: ERROR forrtl: severe (174): SIGSEGV

Postby vsbgonzalez » Wed Jul 25, 2012 9:18 am

Thanks you Andrey
vsbgonzalez
 
Posts: 5
Joined: Thu Oct 20, 2011 12:03 pm


Return to Using OpenMP

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 4 guests