- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
I use Visual Studio 2010 and Intel Visual Fortran XE2011. I can post a sample program if needed. Thanks.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, thank you very much for your help. Now both programs work under the release configuration.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page