Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

I can`t solve SIGSEGV

vsbasto
Beginner
554 Views
Hi all,

I try run this Parallel Programming in Fortran 90 using OpenMP


!
! ifort -openmp -parallel -fpp Hello.f90
!
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

I get this 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 00007F7454EB60D3 Unknown Unknown Unknown



I use this command


ifort -openmp Hello.f90

I am also running the ldd command


linux-vdso.so.1 => (0x00007fff253ff000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2aaa8e2000)
libiomp5.so => /opt/intel/composer_xe_2011_sp1.11.339/compiler/lib/intel64/libiomp5.so (0x00007f2aaa5f3000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2aaa3d5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2aaa040000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2aa9e29000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2aa9c25000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2aaab7c000)

and i read and work with the information in this page

http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/


Could someone help me to solve this problem ?

Thanks very much
Victor
0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
554 Views
The !$OMP COPYIN clause copies from the outside parallel region name space to the PRIVATE copies of those named entities. This does not copy to THREADPRIVATE variables.

Either

a) Remove THREADPRIVATE(A,B,C) and add the OpenMP clause PRIVATE(A,B,C) with COPYIN

b)[fortran]PROGRAM HOLA IMPLICIT NONE REAL, SAVE :: A REAL, DIMENSION (5), SAVE :: B REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: C !$OMP THREADPRIVATE(A,B,C) !$OMP PARALLEL A=5.0 B = 10.0 ALLOCATE(C(2,2)) C = 666.0 !$OMP END PARALLEL ! (other code here if you wish) !$OMP PARALLEL DEFAULT(NONE) ... [/fortran]Jim Dempsey

View solution in original post

0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
555 Views
The !$OMP COPYIN clause copies from the outside parallel region name space to the PRIVATE copies of those named entities. This does not copy to THREADPRIVATE variables.

Either

a) Remove THREADPRIVATE(A,B,C) and add the OpenMP clause PRIVATE(A,B,C) with COPYIN

b)[fortran]PROGRAM HOLA IMPLICIT NONE REAL, SAVE :: A REAL, DIMENSION (5), SAVE :: B REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: C !$OMP THREADPRIVATE(A,B,C) !$OMP PARALLEL A=5.0 B = 10.0 ALLOCATE(C(2,2)) C = 666.0 !$OMP END PARALLEL ! (other code here if you wish) !$OMP PARALLEL DEFAULT(NONE) ... [/fortran]Jim Dempsey
0 Kudos
vsbasto
Beginner
554 Views
Hi Jim,
Thanks
Victor
0 Kudos
Ron_Green
Moderator
554 Views
also http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/

but with OpenMP don't use -heap-arrays, increase the stack with ulimit.
0 Kudos
Reply