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

Using project-wide setting of integer(8) and real(8) in VS2010 kills OpenMP

Geoff_Hall
Beginner
1,148 Views
Hi,
(I initially posted this in the Intel Clusters and HPC Technology forum, but was told this is the better place for this question.)

I have what I think is a bug. I have a very simple OpenMP program with two threads. When compiled with integer(4) real(4) the print statements show that the parallelness is working (the "parallel variables" are defined). When compiled with integer(8) real(8) the parallelness doesn't work. I have attached/uploaded a zipped VS2010 project showing this problem. The project is currently set to int8/rl8 to show the "not working" state. If you change project properties / Fortran / Data / Default Integer KIND and Default Real KIND back to 4, it works.

In some ways I hope I just made a mistake - I hope there is a simple fix for this problem!

Cheers, Geoff
0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,148 Views
There is a simple fix. Your program incorrectly declares the omp_ routines as "default integer". When you change that to integer(8), it is inconsistent with the actual routines.

Remove the declarations of the omp_ routines. Add:

use omp_lib

just before the "implicit none".

View solution in original post

0 Kudos
4 Replies
jimdempseyatthecove
Honored Contributor III
1,148 Views
I've been running successfully with default integer(4) real(8) and have had no problems with OpenMP

Jim Dempsey
0 Kudos
Steven_L_Intel1
Employee
1,149 Views
There is a simple fix. Your program incorrectly declares the omp_ routines as "default integer". When you change that to integer(8), it is inconsistent with the actual routines.

Remove the declarations of the omp_ routines. Add:

use omp_lib

just before the "implicit none".
0 Kudos
Geoff_Hall
Beginner
1,148 Views
Ohhhh! (bangs head against wall)
Thanks for your answer. I'd also missed along the way the doco that idenified the module omp_lib. So double thanks.
Hope you enjoy the rest of your weekend.
Cheers, Geoff
0 Kudos
Steven_L_Intel1
Employee
1,148 Views
This is just one instance of a general problem caused by use of "big hammer" options such as changing the default integer size. It can have effects you have not considered, such as this one where functions now have the wrong type. This is why I strongly recommend against use of such options - if you want individual entities to be some non-default kind, declare them that way. (I do recognize that these options may have a use when porting from architectures such as Cray.)
0 Kudos
Reply