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

openmp 3.0????!!!!

yingwu
Beginner
436 Views

Hi,

The version I download is Noncommercial Intel Fortran Compiler Professional Edition for Linux and the version is 11.1. Could I ask what the version of openmp in the compiler is used??

I got this question because I try to put an array in REDUCTION in a loop. My code is like below:

real, allocatable:: A(:,:), B(:,:),C(:,:)

allocate(A(100,100),B(100,100),C(100,100))

A=rand(A)
B=rand(B)
C=0

!$OMP PARALLEL DO REDUCTION(+:C) NUM_THREADS(4)
do i=1,10000
C=C+A
end do
!$OMP END PARALLEL DO

But, I get error message:

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
. 4001D422 Unknown Unknown Unknown
libiomp5.so 41570F38 Unknown Unknown Unknown
libpthread.so.0 4159F80E Unknown Unknown Unknown
libc.so.6 416A67EE Unknown Unknown Unknown

I guess the code is right. I know Prior to OpenMP 3.0, Allocatable arrays may not appear in a reduction clause. But I find after intel fortran 11.0, openmp 3.0 is used. So why is there such erroe message?

By the way, I find for the intel fortran for linux, there are two links. One is Non-commercial (I am using this) and the other is not free. Is there any difference between these two? For example, the non-commercial one uses openmp 2.5 and the commercial one uses 3.0?

Thanks very much.

Ying

0 Kudos
5 Replies
Steven_L_Intel1
Employee
436 Views

Intel Fortran 11.1 supports OpenMP 3.0. There is no difference between the non-commercial and commercial license types other than what you are allowed to do with the compiler. You are getting a run-time error, not one that reflects lack of support for a feature,

It's most likely that you need to expand the amount of stack available. See this article for tips, though I would try -heap-arrays anyway. You may also need to expand the OpenMP stack by setting the environment variable KMP_STACKSIZE to a larger value.

0 Kudos
yingwu
Beginner
436 Views

Hi,

I have unlimited the stack size in my .bashrc before. And I also enlarge the KMP_STACKSIZE now.So now, in my machine:

yingwu@yingwu-laptop:~$ echo $KMP_STACKSIZE
2048000000
yingwu@yingwu-laptop:~$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 16382
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited


For testing, I develop a new, simple code, as below:

program test3
use omp_lib

integer :: i
real, dimension(:), allocatable :: a
real, dimension(:), allocatable :: b

allocate (a(100))
allocate (b(100))

a = 10
b = 20

!$OMP PARALLEL DO REDUCTION(+:a) NUM_THREADS(4)
do i = 1, 20
a = a+b
end do
!$OMP END PARALLEL DO

print *, a
print *, b
end

It is more strange. I only get a message:

/home/yingwu/Desktop/IMSLtest $ make
ifort -I/opt/intel/Compiler/11.1/056/mkl/include/ -I/opt/imsl/imsl/fnl600/lnxin100i32/include/ -c test3.f90 -O3 -lpthread -lm -openmp -warn -heap-arrays
ifort -I/opt/intel/Compiler/11.1/056/mkl/include/ -I/opt/imsl/imsl/fnl600/lnxin100i32/include/ -o test3 test3.o -L/opt/intel/Compiler/11.1/056/mkl/ -L/opt/imsl/imsl/fnl600/lnxin100i32/lib -Bdynamic -limsl -limslsuperlu -limslscalar -limslblas -limslmpistub -Xlinker -rpath -Xlinker /opt/imsl/imsl/fnl600/lnxin100i32/lib -Wl,--start-group /opt/intel/Compiler/11.1/056/mkl/lib/32/libmkl_intel.a /opt/intel/Compiler/11.1/056/mkl/lib/32/libmkl_intel_thread.a /opt/intel/Compiler/11.1/056/mkl/lib/32/libmkl_core.a -Wl,--end-group /opt/intel/Compiler/11.1/056/mkl/lib/32/libiomp5.so -O3 -lpthread -lm -openmp -warn -heap-arrays
rm test3.o
/home/yingwu/Desktop/IMSLtest $ ./test3
aborted
/home/yingwu/Desktop/IMSLtest $ ./test3
aborted
/home/yingwu/Desktop/IMSLtest $ ./test3
aborted

I don't know what this is. ABORTED!!!!!

Please, help me!!!

Ying

0 Kudos
yingwu
Beginner
436 Views

I am keeping trying. Now error message is like:

/home/yingwu/Desktop/IMSLtest $ ./test3
aborted
/home/yingwu/Desktop/IMSLtest $ ./test3
aborted
/home/yingwu/Desktop/IMSLtest $ ./test3
aborted
/home/yingwu/Desktop/IMSLtest $ ./test3
aborted
/home/yingwu/Desktop/IMSLtest $ ./test3
aborted
/home/yingwu/Desktop/IMSLtest $ ./test3
0
3
1
2
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
. 4001D422 Unknown Unknown Unknown
libiomp5.so 41570F38 Unknown Unknown Unknown
libpthread.so.0 415C580E Unknown Unknown Unknown
libc.so.6 416A67EE Unknown Unknown Unknow

"aborted" firstly and then after several times, it becomes, " SIGSEGV, segmentation fault occurred"

0 Kudos
Martyn_C_Intel
Employee
436 Views

Hi Ying,

You seem to have a rather complex command line, replete with various libraries.

I was able to reproduce a problem with the command line

ifort -openmp -openmp-report2 reduce.f90; ./a.out

The problemseems to be related to the use of an allocatable array as the reduction variable. If you replace it by a static declaration, e.g. real, dimension(100) :: a, then your test case works.

I'm not sure I understand the purpose of your programs -as written,these aren'ttypical reductions, since the same array is being added in every loop iteration. (So why not just multiply by 20, instead of adding 20 times)/ A typical array reduction would look like this:

program reduce2

use omp_lib

integer :: i

real, dimension(:), allocatable :: a

real, dimension(:,:), allocatable :: b

allocate (a(100))

allocate (b(100,20))

a = 10.

b = 20.

!$OMP PARALLEL DO REDUCTION(+:a) NUM_THREADS(4)

do i = 1, 20

a(:) = a(:) +b(:,I)

end do

!$OMP END PARALLEL DO

print *, a

print *, b(1,1), b(100,20)

end

However, this fails in a similar way. It works if a(100) is declared statically.

The OpenMP standard states that reduction variables may be allocatable arrays, provided that they are already allocated and the allocation status doesn't change within the region. Therefore, this seems to be a bug. I shall escalate it to the compiler developers to be fixed. In the meantime, please use static allocation as a workaround.

0 Kudos
Martyn_C_Intel
Employee
436 Views

Hi Ying,

I believe this is already fixed; I tested with a more recent compiler and did not see the problem. Please download the latest 11.1 compiler, and see if you agree.

As you indicated, support for allocatable arrays as reduction variables is new in OpenMP 3.0.

Martyn

0 Kudos
Reply