Re: [fluka-discuss]: error: Program terminated with signal SIGFPE, Arithmetic exception.

From: Zhiyi Liu <zhiyil_at_triumf.ca>
Date: Wed, 5 Apr 2017 09:07:14 -0700

Thanks for your confirmation about my puzzle, Vasilis.

About the error below, I have figured it out. For reference for other
users, here is the reason:

When I printed all information of the particles, I realized that I trimmed
the precision of energy to 4 digits after dot. This trimming makes some
energy values equal to zero! After fixing it, it is all right now.

Cheers,
Zhiyi.



On Wed, Apr 5, 2017 at 6:17 AM, Vasilis Vlachoudis <
Vasilis.Vlachoudis_at_cern.ch> wrote:

> Hi Liu,
>
> the error is not the same, you have an exception on a different routine.
> To understand what is going wrong it would be nice to have your input
> source particle distribution etc...
>
> It is correct, NPFLKA should be 1. NPFLKA gives the number of particle
> currently in the stack. When the source.f is called NPFLKA should be
> zero and the source.f is pushing one particle in the stack, which increase
> it to one.
>
> Vasilis
>
> ------------------------------
> *From:* Zhiyi Liu [zhiyil_at_triumf.ca]
> *Sent:* Tuesday, April 04, 2017 20:30
> *To:* Vasilis Vlachoudis
> *Cc:* fluka-discuss_at_fluka.org
> *Subject:* Re: [fluka-discuss]: error: Program terminated with signal
> SIGFPE, Arithmetic exception.
>
> Thank you, Vasilis.
>
> With the better understanding on the source code, I modified it based on
> your suggestions, however, unfortunately, still have the same error. I also
> noticed that I did accumulate the variable, NPFLKA, however, it is always
> ==1. This confused me so much, it is supposed to be increased one event by
> one event. Any potential reasons that the variable cannot be increased?
>
> The error of crashing is still:
>
> Program received signal SIGFPE: Floating-point exception - erroneous
> arithmetic operation.
>
> Backtrace for this error:
> #0 0x7EFF9CC15777
> #1 0x7EFF9CC15D7E
> #2 0x7EFF9C351CAF
> #3 0x530D53 in kasneu_ at kasneu.f:457
> #4 0x505307 in kaskad_ at kaskad.f:3850
> #5 0x4EAB16 in feeder_ at feeder.f:257
> #6 0x409144 in flukam_ at flukam.f:3155
> #7 0x40244B in fluka at fluka.f:289
> #8 0x7EFF9C33CF44
> Floating point exception (core dumped)
>
>
>
> Cheers,
> Zhiyi.
>
> On Tue, Apr 4, 2017 at 12:34 AM, Vasilis Vlachoudis <
> Vasilis.Vlachoudis_at_cern.ch> wrote:
>
>> Hi Liu,
>>
>>
>>
>> Your problem is that you deleted the line
>>
>> WEIPRI = WEIPRI + WTFLK(NPFLKA)
>>
>> So at the end of your calculation it divides by zero
>>
>>
>>
>> Another note, please do not move up/down lines in the source file, try
>>
>> To respect the original template.
>>
>> e.g. you are converting the kinetic energy to momentum at line 110
>>
>> before you have set the IONID
>>
>>
>>
>> Cheers
>>
>> Vasilis
>>
>>
>>
>> *From:* owner-fluka-discuss_at_mi.infn.it [mailto:owner-fluka-discuss_at_mi
>> .infn.it] *On Behalf Of *Zhiyi Liu
>> *Sent:* 03 April 2017 21:34
>> *To:* fluka-discuss_at_fluka.org
>> *Subject:* [fluka-discuss]: error: Program terminated with signal
>> SIGFPE, Arithmetic exception.
>>
>>
>>
>> Hi,
>>
>> I am using customised source code to generate primary particles.
>>
>>
>>
>> ​The code crashed with the following error:
>>
>>
>>
>> ​Program received signal SIGFPE: Floating-point exception - erroneous
>> arithmetic operation.
>>
>>
>>
>> Backtrace for this error:
>>
>> #0 0x7F13C6D39777
>>
>> #1 0x7F13C6D39D7E
>>
>> #2 0x7F13C6475CAF
>>
>> #3 0x4C03A8 in genout_ at genout.f:112 (discriminator 8)
>>
>> #4 0x4090B0 in flukam_ at flukam.f:3174 (discriminator 8)
>>
>> #5 0x40244B in fluka at fluka.f:289
>>
>> #6 0x7F13C6460F44
>>
>> Floating point exception (core dumped)
>>
>>
>>
>> ​I use gdb tool to debug it and have the message like:
>>
>>
>>
>> ​Program terminated with signal SIGFPE, Arithmetic exception.
>>
>> #0 genout () at genout.f:112
>>
>> 112 genout.f: No such file or directory.
>>
>>
>>
>>
>>
>> ​My code is attached for your reference. Basically it reads a file
>> containing particles.
>>
>>
>>
>> Any hints?​
>>
>>
>>
>> I am using gfortran in gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
>>
>>
>>
>>
>>
>> ​Thanks.​
>>
>>
>>
>> --
>>
>> Zhiyi Liu
>> Advanced Applied Physics Solutions, TRIUMF
>>
>> 4004 Wesbrook Mall, Vancouver, BC, Canada V6T 2A3
>>
>> Tel: (604)222-7702 <(604)%20222-7702> Email: zhiyil_at_triumf.ca
>>
>>
>>
>>
>>
>
>
>
> --
>
> Zhiyi Liu
> Advanced Applied Physics Solutions, TRIUMF
> 4004 Wesbrook Mall, Vancouver, BC, Canada V6T 2A3
> Tel: (604)222-7702 <(604)%20222-7702> Email: zhiyil_at_triumf.ca
>
>
>
>


-- 
Zhiyi Liu
Advanced Applied Physics Solutions, TRIUMF
4004 Wesbrook Mall, Vancouver, BC, Canada V6T 2A3
Tel: (604)222-7702 Email: zhiyil_at_triumf.ca
__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Wed Apr 05 2017 - 19:14:57 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 05 2017 - 19:15:00 CEST