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

ifort12 Bug: OpenMP segmentation fault

luis_gc_rego
Beginner
590 Views

Hello,

openmp codes that use to run safely and well with ifort11 crash with ifort12 producing the error message forrtl: severe (174): SIGSEGV, segmentation fault occurred.

An example of the openmp code that does not run with ifort12 is reproduced below.

!$OMP parallel    
    !$OMP single
    do i = 1 , dim_bra
        !$OMP task
        do j = 1 , dim_basis   
            right(j,i) =  QM%L(DP%bra_PTR(i),j)
        end do
        !$OMP end task
    end do
    !$OMP end single
!$OMP end parallel   

I have also had problems with the O3 optimization flag in ifort12, which I did not have with ifort11. Does the new ifort13 present the same problems as ifort12?

0 Kudos
4 Replies
TimP
Honored Contributor III
590 Views
Evidently, since you don't mention it, a possible explanation is that you didn't check whether you need to increase thread or overall stack size. If you call that a problem, yes, it's likely to still be a "problem" with ifort 13, if it was for ifort 12. I hope Steve has been able to restore access to the paper with advice about diagnosing seg faults.
0 Kudos
luis_gc_rego
Beginner
590 Views
Dear Tim, thanks for the message. I shall do as you suggest. Nevertheless, I still have the ifort11 installed in my computer and the code runs smoothly and stably with it. When I use ifort12 I am forced to downgrade the optimization flag from -O3 to -O1 (is this related to the stack size?) and some openmp parts of the code crash as I described. I decided to update the compiler version (ifort11 to ifort12) for using some object oriented features of the new fortran and, may be, start playing with co-arrays. But it seems now that was a bad move.
0 Kudos
TimP
Honored Contributor III
590 Views
Yes, it's entirely possible that -O3 requires more stack than -O1. Starting an OpenMP region likely uses considerably more stack, particularly if there are private arrays. Both the general stack (ulimit) and the thread stack (KMP_STACKSIZE) may be involved. Default value for KMP_STACKSIZE is 2MB for 32-bit mode, 4MB for 64-bit mode.
0 Kudos
luis_gc_rego
Beginner
590 Views
Tim, my attempts to increase the KMP_STACKISZE did not solve the segmentation faults, but the equivalent procedure of sharing some of the OMP variables worked out, like in the case do xyz = 1 , 3 matrix = DP_matrix_AO(:,:,xyz) CALL gemm(a,matrix,left,'N','N',one,zero) !$OMP parallel !$OMP single do j = 1 , dim_ket !$OMP task shared(origin_Independent , left , right) do i = 1 , dim_bra origin_Independent(i,j)%DP(xyz) = sum( left(i,:) * right(:,j) ) / two end do !$OMP end task end do !$OMP end single !$OMP end parallel end do Although I feel a bit suspicious of incurring into racing conditions by sharing variables. I wonder why these problems are arising only with ifort12.
0 Kudos
Reply