- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
G'day All,
The simple program enclosed seems to indicate a problem in Linux ifort OpenMP compilation of parallel do loop work-sharing directives that distributes increasing numbers of iterations instead of spreading them evenly amongst threads when the loop index variable i is re-used in later loop statements inside a single directive. The problem does not occur in equivalent C code. Nor does it occur if i is declared private or a different variable j is used for the 2nd loop.
Am I doing something wrong or is this a bug? And, where/how should it be reported?
Regards,
Sam
Sam
Code:
$ cat incorrect.f program main integer i, j, omp_get_thread_num, omp_get_num_threads !$omp parallel private(i) !$omp do do i=1,omp_get_num_threads() print *, 'tid =', omp_get_thread_num(), 'i =', i enddo !$omp end do !$omp single do i=1,omp_get_num_threads() print *, 'tid =', omp_get_thread_num(), 'i =', i enddo !$omp end single !$omp end parallel end $ cat correct.c #includemain () { int i,j; #pragma omp parallel private(i) { #pragma omp for for (i=0; i !$omp single private(i) $ ifort -openmp correct1.f -o correct1 correct1.f(4) : (col. 6) remark: OpenMP DEFINED LOOP WAS PARALLELIZED. correct1.f(3) : (col. 6) remark: OpenMP DEFINED REGION WAS PARALLELIZED. $ ./correct1 tid = 0 i = 1 tid = 1 i = 2 tid = 2 i = 3 tid = 3 i = 4 tid = 0 i = 1 tid = 0 i = 2 tid = 0 i = 3 tid = 0 i = 4 $ diff incorrect.f correct2.f 10,11c10,11 < do i=1,omp_get_num_threads() < print *, 'tid =', omp_get_thread_num(), 'i =', i --- > do j=1,omp_get_num_threads() > print *, 'tid =', omp_get_thread_num(), 'j =', j $ ifort -openmp correct2.f -o correct2 correct2.f(4) : (col. 6) remark: OpenMP DEFINED LOOP WAS PARALLELIZED. correct2.f(3) : (col. 6) remark: OpenMP DEFINED REGION WAS PARALLELIZED. $ ./correct2 tid = 0 i = 1 tid = 1 i = 2 tid = 2 i = 3 tid = 3 i = 4 tid = 0 j = 1 tid = 0 j = 2 tid = 0 j = 3 tid = 0 j = 4 $
Message Edited by samlor on 02-23-2006 09:36 AM
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Samlor,
I have exactly the same problem as you posted here using Intel ifort 9.0 on SGI altix machine. Have you got the answer or solution to fix it? Thanks.
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