Quantcast
Channel: Intel® Software - Intel® Many Integrated Core Architecture (Intel MIC Architecture)
Viewing all articles
Browse latest Browse all 1789

Offload compilation problem with -openmp option.

$
0
0

Hi all!

I have problems using openmp and offload directives. The following (reduced) code give right result (1  2  3  4  5  0  0  0  0  0), when it's compiled without openmp ("ifort test.f -o test"), and wrong (1  2  3  4  5  6  7  8  9 10) with openmp ("ifort -openmp test.f -o test").

 

      PROGRAM test
      integer c(10)

      c=0

!DIR$ OFFLOAD_TRANSFER target(mic:0)
     & nocopy(c: length(10) alloc_if(.true.) free_if(.false.))

!DIR$ OFFLOAD begin target(mic:0) nocopy(c)
      do i=1,10
      c(i)=i
      enddo
!DIR$ end OFFLOAD

!DIR$ OFFLOAD_TRANSFER target(mic:0)
     & out(c(1:5): alloc_if(.false.) free_if(.false.) into(c(1:5)))

!DIR$ OFFLOAD_TRANSFER target(mic:0)
     & nocopy(c: alloc_if(.false.) free_if(.true.))

      WRITE(*,'(10(1X,I2))'), c

      END PROGRAM

 

"OFFLOAD_REPORT" when result is wrong: (not full)

[Offload] [MIC 0] [File]            test.f

[Offload] [MIC 0] [Line]            9

[Offload] [MIC 0] [Tag]             Tag 1

[Offload] [HOST]  [Tag 1] [State]   Start Offload

[Offload] [HOST]  [Tag 1] [State]   Initialize function __offload_entry_test_f_9MAIN__ifort1104196052Lk2WXB

[Offload] [HOST]  [Tag 1] [State]   Send pointer data

[Offload] [HOST]  [Tag 1] [State]   CPU->MIC pointer data 0

[Offload] [HOST]  [Tag 1] [State]   Gather copyin data

[Offload] [HOST]  [Tag 1] [State]   CPU->MIC copyin data 0 

[Offload] [HOST]  [Tag 1] [State]   Compute task on MIC

[Offload] [HOST]  [Tag 1] [State]   Receive pointer data

[Offload] [HOST]  [Tag 1] [State]   MIC->CPU pointer data 0

[Offload] [MIC 0] [Tag 1] [State]   Start target function __offload_entry_test_f_9MAIN__ifort1104196052Lk2WXB

[Offload] [HOST]  [Tag 1] [State]   Scatter copyout data

[Offload] [HOST]  [Tag 1] [CPU Time]        0.001025(seconds)

[Offload] [MIC 0] [Tag 1] [CPU->MIC Data]   0 (bytes)

[Offload] [MIC 0] [Tag 1] [MIC Time]        0.000210(seconds)

[Offload] [MIC 0] [Tag 1] [MIC->CPU Data]   40 (bytes)

 

Offload region at line 9 do data transfer, when nocopy is set...

(composer xe 2013 sp1.2.144; ifort version 14.0.2)

(This is a reduced code, which reproduce the error. My full code contain openmp directives.)


Viewing all articles
Browse latest Browse all 1789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>