You could try instead -on_error_attach_debugger and see if that is better at 
catching the code when the error occurs

   If the code runs valgrind clean (when it runs) then I would say it is 
reasonable for you to conclude that the current trouble is due to a Intel 
optimization error and not debug further,

  Barry

> On Jan 4, 2016, at 9:34 PM, TAY wee-beng <[email protected]> wrote:
> 
> Hi,
> 
> Ya sorry, that should be the tool to use. Was having some problems using MPI 
> with the debugger.
> 
> I managed to run it as a serial code now.
> 
> My problem is that on the cluster, it works with the gnu fortran. But using 
> Intel compiler, I get segmentation error at some point when running the opt 
> ver. The debug ver works fine.
> 
> I am trying to find if the error is due to a bug in Intel, or it's my own 
> problem.
> 
> Another thing is that on another cluster, the Intel opt ver works, but that's 
> using a newer ver of the compiler.
> 
> I hope to get the Intel one working if possible, because it's about 30% 
> faster.
> 
> So now coming back to the gdb, it worked fine using the debug ver of the 
> code. But when using the opt ver, it only shows segmentation fault. When the 
> X-window appears, the code has already exited. I am already using -g during 
> compile.
> 
> So how should I debug it? The error seems to be when I tried to call 
> DMDAVecRestoreArrayF90, although I still need to be more certain.
> 
> 
> Thank you
> 
> Yours sincerely,
> 
> TAY wee-beng
> 
> On 5/1/2016 10:32 AM, Barry Smith wrote:
>>   You are missing the ,ierr which BTW you would have caught immediately if 
>> you used the debugger.
>> 
>>   Barry
>> 
>>   The debugger is not a scary monster, it is one of your best friends.
>> 
>>> On Jan 4, 2016, at 7:28 PM, TAY wee-beng <[email protected]> wrote:
>>> 
>>> Hi,
>>> 
>>> I am trying to debug my CFD Fortran MPI code. I tried to add:
>>> 
>>> call PetscBarrier(PETSC_NULL_OBJECT); if (myid==0) print *, "xx"
>>> 
>>> to do a rough check on where the error is. xx is a different number for 
>>> each line.
>>> 
>>> I found that whenever I add this line, the code aborts with segmentation 
>>> error.
>>> 
>>> I am using the Intel compiler. Is there any error with my usage?
>>> 
>>> -- 
>>> Thank you
>>> 
>>> Yours sincerely,
>>> 
>>> TAY wee-beng
>>> 
> 

Reply via email to