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

Initialized var reports as uninitialized w OpenMP

jimdempseyatthecove
Honored Contributor III
866 Views

This may be a problem that has been corrected by now. I am posting this her to provide my work around.

When using IVF EM64T V 9.1 Build 20060925 (will install update)

And when compiling with all the runtime diagnostics enabled, in particular test for uninitialized variables.

I have a section of code that initializes a variable (integer local variable to subroutine)then enters an "!$OMP PARALLEL" section where the mentioned initialized variable is declared as SHARED. Then inside the parallel section when this variable is referenced an uninitialized variable trap is signaled.

Interestingly, if I declare the variable with SAVE attribute I can then make it through the section without a problem.

Additional info. There are a few other shared variables used in the parallel section and the error occurs on the 2nd variable referenced.

I will upgrade to the newer version of the compiler and see if this problem has been fixed.

If the problem persists for othersoth this forumthen try adding SAVE attribute the the variable (if functionally benign to the operation)

Jim Dempsey

0 Kudos
3 Replies
Steven_L_Intel1
Employee
866 Views
Jim,

If the problem is still in the newer version, please submit a test case to Intel Premier Support so that we can fix it. As you imply, SAVE is not always the right thing to do in an OpenMP application.
0 Kudos
jimdempseyatthecove
Honored Contributor III
866 Views

Steve,

The problem is not occuring in IFVV10. So either the problem was fixed or by chance it is not occuring (at least in the file exhibiting the problem).

In my case using a SAVE was safe to useas the shared variable was not written in the parallel section. Had it been read/write I would have been hosed. Interestingly though the value was correct (the been written flag address must have been wacko).

Jim

0 Kudos
TimP
Honored Contributor III
866 Views
I filed a similar issue against ifort 9.1. It was impossible to use the uninitialized warning, along with -openmp, due to the high volume of false reports. No progress report has been issued. The only satisfactory procedure was to run thread checker.
0 Kudos
Reply