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

use open MP under release configuration

yuezhanwei
Beginner
991 Views
I have a fortran project which uses OpenMP. The program run successfully under the debug configuration on the Win32 platform. But when I choose the release configuration, the program only uses one thread. What should I do? Thank you very much.

I use Visual Studio 2010 and Intel Visual Fortran XE2011. I can post a sample program if needed. Thanks.
0 Kudos
1 Solution
Steven_L_Intel1
Employee
990 Views
You had not enabled OpenMP for the Release configuration, which is why you get link errors and why you didn't see parallelization. When I enable that, the release mode builds and I get 8 threads (on my Core i7 system).

In your real application, which uses IMSL, you had added the directive to bring in the OpenMP library which is why you don't get link errors. But same thing, OpenMP is not enabled in the Release configuration.

View solution in original post

0 Kudos
4 Replies
Steven_L_Intel1
Employee
991 Views
Please do attach a sample program. It would be best if you did a Build > Clean and then ZIPped the whole solution folder. It may be that for the Release version the compiler optimized away the loop you specified should be parallelized.
0 Kudos
yuezhanwei
Beginner
991 Views
Steve, attached are the two zipped sample program. One is for the realse version and one for the debug version. For this sample program, I even have the linking error. In my full program, I can build and run the program under the release configuration. But the program is not parallelized. I am also attaching my full program under the release version just in case. Thank you very much.
0 Kudos
Steven_L_Intel1
Employee
991 Views
You had not enabled OpenMP for the Release configuration, which is why you get link errors and why you didn't see parallelization. When I enable that, the release mode builds and I get 8 threads (on my Core i7 system).

In your real application, which uses IMSL, you had added the directive to bring in the OpenMP library which is why you don't get link errors. But same thing, OpenMP is not enabled in the Release configuration.
0 Kudos
yuezhanwei
Beginner
991 Views
Steve, thank you very much for your help. Now both programs work under the release configuration.

0 Kudos
Reply