- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am a new Intel Fortran and Openmp user. Just found this forum. Hope I can get some help pointers.
I just converted a large CVF code to Intel. Found some Intel problems along the way. Now I am trying out Openmp on simple do loops.
If I set the openmp directive on the whole program, I get stack overflow. I found I can just set openmp directive on one subroutine file and compile it. What problems would this cause me down the road? Is this related to my next problem.
I set a parallel do loop. It crashed. On printing iteration counter, it seemed the loop counter was one more than the specified.The arrays were dimensioned to iteration counter. The last iteration exceeded the array dimensions. What caused the iteration counter to exceed the specified no of loop iterations?
Thanks for any help.
Thomas
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should be able to turn OpenMP on and off by subroutine with the compile switch. Removing -Qopenmp for a subroutine should be the same as removing the OpenMP directives. You are likely to need the /link /stack:nnnnnnn options to increase stack size when you parallelize, or use the utility to change the stack size in the .exe without rebuilding it.
If you display the loop counter variable after the loop terminates normally, the Fortran standard requires it to have the value which would be valid on the next loop iteration. I'm not certain whether the OpenMP default would be lastprivate; if not, and you didn't specify it, almost anything could happen. The set of private values seen within the loop by each thread should be within the specified range, of course.
If you display the loop counter variable after the loop terminates normally, the Fortran standard requires it to have the value which would be valid on the next loop iteration. I'm not certain whether the OpenMP default would be lastprivate; if not, and you didn't specify it, almost anything could happen. The set of private values seen within the loop by each thread should be within the specified range, of course.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Tim.
The write displaying the current iteration counter, and thread numberexecuting the current iteration counter was placed inside and at the beginning of the parallelized do loop. As you said, I expected the set of private iteration counter values seen within the loop by each thread should be within the specified do loop counter range. The displayed counter ranged from the first iteration counter to 1 + the last iteration counter. How can this be possible?
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
My problem has been resolved by Intel Premier Support with my thanks. An updated release has the bug fix.
One further question if anybody has experience with Openmp
For local variables in the lexical extent of a do loop, these should be declared private. What about the local variables in the dynamic extent of a parallel region, ie in subroutines called from within a parallel region? Do they have to be declared private too? And where?
Thanks,
Thomas

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