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

Different results between Debug and Release results

Matteo
Novice
1,713 Views

I found different results between Debug and Release version of the same program.
I have just read some posts in this topic.
I would like to set my compiler in order to have a NaN for not initialized scalar and array. 
In this way, with /fpe:0, I should have an error, avoiding errors in release version.
What shall I set in the compiler?

0 Kudos
10 Replies
mecej4
Honored Contributor III
1,685 Views

Matteo,

I am afraid that there is no simple solution. There are many causes for the single symptom that you stated: results changing when compiler options are changed. Not surprisingly, there is no single compiler option to help you to locate and fix the problems in your code. 

See the Intel documentation for details regarding the various /check and /warn options. 

If you can post the code and show us what kinds of differences you see, someone may be able to make suggestions for a solution.

0 Kudos
Matteo
Novice
1,665 Views
Thank you for your reply.
Unfortunately the code is very large and a non disclosure agreement doesn't let me to share that.
In some thread I found Qinit:snan,arrays could initialize as NaN the variables, but my compiler doesn't recognize this command.
Which is the correct set?
0 Kudos
Matteo
Novice
1,649 Views
Thank you.
/Qinit:snan,arrays is the solution?
Why doesn't it work in my compiler?
0 Kudos
IanH
Honored Contributor II
1,643 Views

What specifically does your compiler say?

0 Kudos
Matteo
Novice
1,620 Views

 


@IanH  ha scritto:

What specifically does your compiler say?


Hi, that's the warning:
1>ifort: command line warning #10006: ignoring unknown option '/Qinit:arrays'

I set that in Project>Command Line

0 Kudos
IanH
Honored Contributor II
1,606 Views
What compiler version? If it isn't current, check its version specific documentation to make sure it is recent enough to support that option.
0 Kudos
andrew_4619
Honored Contributor II
1,601 Views

C:\test>ifort reproducer.f90 /Qinit:arrays /c
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.1.216 Build 20200306
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

 

Works fine for me, what version are you using? Maybe post the full command line and output as above.

 

0 Kudos
mecej4
Honored Contributor III
1,594 Views

The /Qinit:arrays option works with Ifort Version 15.0.7.287 and later versions. It does not work with the next older version that I still have, which is 14.0.4.237.

Matteo
Novice
1,561 Views

Thank for your reply.

Unfortunately I use a 14.0.6 version and I understood it is too old for that setting.
Anyway I solved by an hard debug

0 Kudos
Reply