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

segmentation fault

anupam_mu
Beginner
1,168 Views
hi,
I work on linux red-hat 7.3.I have both the compiler intel 7.0 and 8.0 (free version) installed.
I have written here a small program which shows segmentation fault whenever i try to compile it and the run it with intel 8.0 version, with a bigger array size.but if i compile it with intel 7.0 version it perfectly works.
could anyone point out what is the problem ?

***the pourpose of the test program is this it replaces the element of a matrix by the sum of its nearest neighbour i.e if i start with matrix whose all elements set to 1,i'll get a matrix whose all elements equal to 4; since
no of nearest neighbour is 4.


***************************************************************
program matrix
integer,parameter :: k=1624
real,target :: mat(k,k)
real,pointer :: pm(:,:)
integer,target :: x1(k),x_1(k),x(k)
integer,pointer :: p1(:),p_1(:),p(:)
integer :: i

mat=1.0

x=reshape( (/(i,i=1,k)/) ,(/k/))

p=>x
x1=cshift(x, shift=1)
x_1=cshift(x, shift=-1)
pm=>mat
p1=>x1
p_1=>x_1


pm=pm(p1,p)+pm(p_1,p)+pm(p,p1)+pm(p,p_1)

print*,mat
end program matrix
*****************************************************
0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,168 Views
The 8.0 compiler tends to use more stack than the 7.0 compiler did, especially for array expressions and temporaries. Try raising your stacksize limit and see if that helps.
0 Kudos
TimP
Honored Contributor III
1,168 Views
My laptop had no trouble with this, using ifort 8.0.044, aside from the overwhelming 40MB of screen output.
I've found the performance of CSHIFT() disappointing. Ifort has specific peeling optimizations which help only with the vectorized f77 form of that operation.
0 Kudos
anupam_mu
Beginner
1,168 Views
hi,
thank you for your kind information. but i don't have much knowledge in computer, and i dont understand what u mean to say by raising the stacksize limit.i also read 'intel Fortran Compiler 8.0 for Linux* Systems Release Notes'; they have sugested to' link libpthreads dynamically'.

please could you explain me in detail how to do it
thank you,
0 Kudos
anupam_mu
Beginner
1,168 Views
hi,
thank you for yuor suggestion. inceasing the stack size solve the problem; but if i want to optimize it with -fast option sementation fault again appears.
can u tell me what is wrong?
0 Kudos
Reply