Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Fortran allocatable problem with openmp 3

unrue
Beginner
480 Views
Dear all,
i have a problem with ifort using Fortran allocatable arrays delared as lastprivate, using openmp 3.0. The simple example under ifort 11.1 doesn't not work, it dies on the first matrix access:
[fortran]program prova

implicit none
 complex ,dimension(:,:),allocatable:: matrix
 integer  :: i,j

 allocate(matrix(100,100))
 matrix=0

!$OMP PARALLEL DO lastprivate(matrix) private(j)
  do i = 1, 100
    do j = 1, 100
     matrix(i,j) = matrix(i,j) + i + j
    end do
  enddo
!$OMP END PARALLEL DO 

 WRITE(*,*) " matrix " , matrix

 deallocate(matrix)

end program
[/fortran]
According to this paper:
if a compiler agrees to openmp 3.0 standard should permits to declare allocatable arrays as private, lastprivate, and so on.
Maybe is a ifort bug?
Thanks a lot.
0 Kudos
2 Replies
Kevin_D_Intel
Employee
480 Views
This is related to the earlier OpenMP bug discussion.

It is not clear if you are on Linux or Mac OS X, but as with the earlier report, on Linux I verified this test case fails with a segmentation fault when using the 11.1 Update 6 (11.1.072 - Linux) and runs successfully when using 11.1 Update 7 (11.1.073 - Linux).

Please try upgrading to the latest 11.1 Update 7 and let us know if that resolves the issue.


$ ifort -V -openmp u78882.f90
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100414 Package ID: l_cprof_p_11.1.072
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

Intel Fortran 11.1-2739
GNU ld version 2.18.50.0.6-7.fc9 20080403

$ export OMP_NUM_THREADS=2
$ ./a.out
forrtl: severe (174): SIGSEGV, segmentation fault occurred

$ ifort -V -openmp u78882.f90
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100806 Package ID: l_cprof_p_11.1.073
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

Intel Fortran 11.1-2755
GNU ld version 2.18.50.0.6-7.fc9 20080403

$ export OMP_NUM_THREADS=2
$ ./a.out
matrix (0.0000000E+00,0.0000000E+00) (0.0000000E+00,0.0000000E+00)

(198.0000,0.0000000E+00) (218.2004,0.0000000E+00) (200.0000,0.0000000E+00)

0 Kudos
unrue
Beginner
480 Views
Hi Kevin,
thanks for your quick reply. I forgot to specify the platorm. I'm on Linux. I'll try with upgraded version.
Thanks!
0 Kudos
Reply