Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646
26866 Discussions

ifort 11.1.072 new req'mnt for init of threadprivate in modules

fractureman
Novice
136 Views
Release notes for new version begin with the (now) new requirement that variables declared theadprivate in modules must be initialized. This requirement seems to break my code with run time
errors (see below). The code works for ifort 11.1.056 on same system. Exampleof a very stripped down module:
module segmental_curves
double precision,dimension (:), allocatable :: sigma_curve_min_values
c
c$OMP THREADPRIVATE( sigma_curve_min_values )
c
end module
How do I "initialize" an allocable array in a module to satisfy this new requirement? Scalars and
arrays with sizes known at compile time are simple.
Thanks much for any guidance.
Bob
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
libpthread.so.0 00007F7FF806BF3B Unknown Unknown Unknown
libiomp5.so 00007F7FF8368E8A Unknown Unknown Unknown
0 Kudos
4 Replies
Steven_L_Intel1
Employee
136 Views
Can you show a complete program that uses this module and gets an error? Clearly, you can't initialize an allocatable array but, if my understanding of this new requirement is correct, you should not need to.
fractureman
Novice
136 Views
Steve,
Thanks for the response. As often happens in complex codes, the runtime error messages can be very misleading. This "issue" turns out to be the next chapter in an ongoing story with selecting the right -On level to generate code that runs correctly. I have a series of .f files that for years have bounced around with combinations of -On that run correctly with each release of ifort (and on each platform Linux, Windows,
Mac OS). This current problem required yet another adjustment of -On levels to gain properly executing code
at 072 vs 056.
I modified the non-allocatable threadprivates in the module to be properly initialized. I can see no difference
in during execution of ifort 056 and 072. Only adjusting the combination of -On levels on these .f files resolved the runtime errors.
Bob
Steven_L_Intel1
Employee
136 Views
We'd very much like to see a test case that shows such a problem.
Lorri_M_Intel
Employee
136 Views
Just a comment here: You only need to initialize threadprivate variables if you want to use the -openmp-threadprivate=compat option.

That's rather unusual, and is necessary for interoperability with C code that has been built with gcc

If you just have "regular" threadprivate variables, they do not need to be initialized.

- Lorri
Reply