Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29271 ディスカッション

use open MP under release configuration

yuezhanwei
ビギナー
989件の閲覧回数
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 件の賞賛
1 解決策
Steven_L_Intel1
従業員
988件の閲覧回数
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.

元の投稿で解決策を見る

4 返答(返信)
Steven_L_Intel1
従業員
989件の閲覧回数
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.
yuezhanwei
ビギナー
989件の閲覧回数
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.
Steven_L_Intel1
従業員
989件の閲覧回数
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.
yuezhanwei
ビギナー
989件の閲覧回数
Steve, thank you very much for your help. Now both programs work under the release configuration.

返信