easy way to handle an element of distributed array

2 views
Skip to first unread message

Noriyuki Kushida

unread,
Mar 25, 2020, 11:09:24 AM3/25/20
to omni-c...@googlegroups.com
Hi,

I have another question.
However, could you let me know the easiest way to handle an element of a distributed array?
Namely, in fortran, I would like to do;

real(8) :: arr(nx,ny)
write(*,*) arr(nx/2, ny/2).

I tried the following two ways, but neither worked.
(1)
!$xmp loop(i,j) on t(i,j)
do i = 1, nx
   do j= 1, ny
       if (i==nx/2 .and. j==ny/2) then
            write(*,*) arr(i,j)
       endif
    enddo
enddo
(2)
!$xmp loop(i,j) on t(i,j)
do i = nx/2, nx/2
   do j= ny/2, ny/2
            write(*,*) arr(i,j)
    enddo
enddo

Best regards,
Noriyuki

Hitoshi Murai

unread,
Mar 27, 2020, 3:13:51 AM3/27/20
to omni-c...@googlegroups.com
Dear Kushida-san,

Thank you for your interest in the Omni compiler.

I believe both of the two work well. Actually, I verified they worked.
How do you find they did not work?

Another and the easiest way is to use a "task" construct as follows.

!$xmp task on t(nx/2, ny/2)
write(*,*) arr(nx/2, ny/2)
!$xmp end task

Best regards,
Hitoshi MUrai
--
村井 <h-m...@riken.jp>
Reply all
Reply to author
Forward
0 new messages