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

/O3 and /Qopenmp

xman_hawkeye
Beginner
651 Views

Hello all,

If a piece of code crashes with /O3 on and works fine without the optimization, what could be the possible reasons? Where can I find information about the optimization option?

BTW,the file was set to /Qopenmp initially even though there is no OpenMP directives in it. If I disable /Qopenmp,the code doesn't crash.

Any suggestions on how to debug this? Thanks a lot.

X.

0 Kudos
3 Replies
Steven_L_Intel1
Employee
651 Views
I just worked on a customer issue with a similar symptom. The cause was the use of several uninitialized variables of derived type. Without OpenMP they were allocated statically, but with /Qopenmp they were allocated on the stack and had unpredictable values.

Try this - rather than /Qopenmp use /automatic instead and see if you also get the "crash". If so, try to isolate the one (hopefully) source for which this switch makes a difference and look for uninitialized variables.

You can also turn on uninitialized variable detection or use the Static Verifier feature, but these may not find the culprit.
0 Kudos
xman_hawkeye
Beginner
651 Views

Yup. With /Qauto the code crashed at the same spot as with /Qopenmp. Good call!Thanks.

Now I have to find the uninitialzed variables.

0 Kudos
xman_hawkeye
Beginner
651 Views

I found it. Thank you very much.

X.

0 Kudos
Reply