- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I try to run the following program:
PROGRAM TEST
implicit none
INTEGER, PARAMETER:: nx=100, ny=100
REAL, DIMENSION(:,:), ALLOCATABLE :: S
INTEGER:: i, j
ALLOCATE( S( -nx:nx, -ny:ny ) )
PRINT *,"Starting... "
do i=-nx,nx
do j=-ny,ny
S(i,j) = exp(-1.0 * ( i**2 + j**2 ) )
end do
end do
END PROGRAM
the following Error is thrown at runtime:
forrtl: severe (174): SIGSEGV, segmentation fault occurred
(If I remove the print line, the error sudenly disappears)
If I compile with the -O1 option, everything works as expected.
I suspect that the problem might be related to vectorisation - how can I disable vectorisation for one loop in fortran with ifort?
PROGRAM TEST
implicit none
INTEGER, PARAMETER:: nx=100, ny=100
REAL, DIMENSION(:,:), ALLOCATABLE :: S
INTEGER:: i, j
ALLOCATE( S( -nx:nx, -ny:ny ) )
PRINT *,"Starting... "
do i=-nx,nx
do j=-ny,ny
S(i,j) = exp(-1.0 * ( i**2 + j**2 ) )
end do
end do
END PROGRAM
the following Error is thrown at runtime:
forrtl: severe (174): SIGSEGV, segmentation fault occurred
(If I remove the print line, the error sudenly disappears)
If I compile with the -O1 option, everything works as expected.
I suspect that the problem might be related to vectorisation - how can I disable vectorisation for one loop in fortran with ifort?
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I doubt it's vectorization. But there is a !DEC$ NOVECTOR directive you can put before the loop.
On which line does the segv occur?
On which line does the segv occur?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried the !DEC$ NOVECTOR directive, and the code worked.
I can't say what line the segv occurs exactly, it only says unknown for line number.
If I add a PRINT statement in the outer loop, it prints the message once and then the segv occurs.
If I add a print statement in the inner loop, the code works as expected (and the loop isn't vectorized)
I also tried the !DEC$ NOVECTOR directive for vector operations, and it worked for simple ones (ie. a[:]=b[:]), but it doesn't seem to work for more complicated assignments like
a[1:n,1:n]=a[1:n,1:n]+a[0:n-1,0:n-1]
The compiler just spits out the following warning:
The statement following this DEC loop optimization directive must be an iterative do-stmt, a vector assignment, an OMP pdo-directive, or an OMP parallel-do-directive.
...and then vectorizes it anyways.
I can't say what line the segv occurs exactly, it only says unknown for line number.
If I add a PRINT statement in the outer loop, it prints the message once and then the segv occurs.
If I add a print statement in the inner loop, the code works as expected (and the loop isn't vectorized)
I also tried the !DEC$ NOVECTOR directive for vector operations, and it worked for simple ones (ie. a[:]=b[:]), but it doesn't seem to work for more complicated assignments like
a[1:n,1:n]=a[1:n,1:n]+a[0:n-1,0:n-1]
The compiler just spits out the following warning:
The statement following this DEC loop optimization directive must be an iterative do-stmt, a vector assignment, an OMP pdo-directive, or an OMP parallel-do-directive.
...and then vectorizes it anyways.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please report the SEGV problem to Intel Premier Support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just reported the issue to Premier Support.... (Took me some time to sign up and answer all those security questions...)
Thanks for your help!

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page