- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
The problem that I have is the following.
In my program I have DO-loops which look like this:
Using CSHIFT it is possible to write it much shorter:
The program successfully compiles with the following line:
But when I launch created a.out - it exits with Segmentation fault.
I found the way to get rid of Segmentation fault. I have to modify the code in the following way:
Does anybody know why CSHIFT does work for (h*b) and does not for h?
I must also say that if turn off all the optimization with -O0 option, then segmentation fault goes away.
The problem that I have is the following.
In my program I have DO-loops which look like this:
c--h-is-(NxN)-matrix---
do i=1,N
ip=i+1
if(i.eq.N) ip=1
im=i-1
if(i.eq.1) im=N
do j=1,N
jp=j+1
if(j.eq.N) jp=1
jm=j-1
if(j.eq.1) jm= N
hx(i,j)=h(ip,j)-h(im,j)
end do
end do
Using CSHIFT it is possible to write it much shorter:
hx = cshift(h,1,1) - cshift(h,-1,1)
The program successfully compiles with the following line:
ifort -O3 -m64 -static -parallel -par-report1 program.f -L"/opt/intel/Compiler/11.1/046/mkl/lib/em64t" -lfftw2xf_intel -L"/opt/intel/Compiler/11.1/046/mkl/lib/em64t" "/opt/intel/Compiler/11.1/046/mkl/lib/em64t"/libmkl_intel_lp64.a -Wl,--start-group "/opt/intel/Compiler/11.1/046/mkl/lib/em64t"/libmkl_intel_thread.a "/opt/intel/Compiler/11.1/046/mkl/lib/em64t"/libmkl_core.a -Wl,--end-group -L"/opt/intel/Compiler/11.1/046/mkl/lib/em64t" -liomp5 -lpthread -lm
But when I launch created a.out - it exits with Segmentation fault.
I found the way to get rid of Segmentation fault. I have to modify the code in the following way:
But the result is different from what I got before with DO-loops.b=1.0
hx = cshift(h*b,1,1) - cshift(h*b,-1,1)
Does anybody know why CSHIFT does work for (h*b) and does not for h?
I must also say that if turn off all the optimization with -O0 option, then segmentation fault goes away.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in our Knowledge Base pointers in the right-hand column of this Forum is this article
http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/
for sigsegv errors. Have you read this and tried these suggestions?
ron
http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/
for sigsegv errors. Have you read this and tried these suggestions?
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I wondered about -static, but it's not necessarily a problem. Your cshift code appears likely to force creation of local temporary arrays, in case that is a clue.
It's preferable not to add redundant options, although I assume you're using the same MKL and OpenMP libraries you would get by default in your compiler installation .
It's preferable not to add redundant options, although I assume you're using the same MKL and OpenMP libraries you would get by default in your compiler installation .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
The options -static -parallel conflict.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Ronald W. Green (Intel)
in our Knowledge Base pointers in the right-hand column of this Forum is this article
http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/
for sigsegv errors. Have you read this and tried these suggestions?
ron
http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/
for sigsegv errors. Have you read this and tried these suggestions?
ron
I've read it a little bit before.
But interesting thing is that there is no segmentation fault if I use CSHIFT(A*B). It appears if I use CSHIFT(C), where C=A*B.
Why is that? I would think that the latter should be a "safer" thing to do....

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