array in type

2 views
Skip to first unread message

Noriyuki Kushida

unread,
Mar 13, 2020, 12:02:05 AM3/13/20
to omni-c...@googlegroups.com
Hi,

I am quite new to Xcalablemp/acc, and probably I may miss a description.
But, if anyone can tell the following is possible, I would appreciate it.

In Fortran 90, I would like to use an array which is a member of a type.
Namely, something like,
==============
type StructureExample
   real(8), allocatable :: realArray(:,:)
end type

type(StructureExample) :: str
allocate(str%realArray(100,100))
===============
In the above example, xmpf90 says "!$xmp align (i,j) with t(i,j) :: str%realArray" is "syntax error".
I can do a similar thing with a normal array without any problem, and without the above pragma, compilation can be done. Thus I suspect "type" is not supported.
Do I understand correctly?
If I am correct and someone knows a quick fix, it would be highly appreciated.

I am using Omini Compiler 1.3.2 with PGI compiler 20.1. ACC is enabled.

Best wishes,

Masahiro Nakao

unread,
Mar 13, 2020, 4:46:14 AM3/13/20
to omni-c...@googlegroups.com
Dear kushida-san

Thank for your inquiry.
The omni compiler will not work when a structure's member is allocatable
and a distributed array.
Sorry, fixing this bug seems to take quite a while.

Instead, when the member isn't allocatable, the omni compiler will work
as follows:
---
program example_omp
implicit none
type StructureExample
real(8) :: realArray(100,100)
end type StructureExample

type(StructureExample) :: str
integer :: j, i
!$xmp nodes p(2,2)
!$xmp template t(100,100)
!$xmp distribute t(block,block) onto p
!$xmp align StructureExample%realArray(j,i) with t(j,i)

!$xmp loop on t(i,j)
do i=1, 100
do j=1, 100
str%realArray(i,j) = i * 100 + j
end do
end do
end program example_omp
---
> --
> You received this message because you are subscribed to the Google
> Groups "omni-compiler" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to omni-compile...@googlegroups.com
> <mailto:omni-compile...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/omni-compiler/CAKx-aKw_Rpg_G_40xVHZEkGjnfcAxqzGe1FsOYgduMnQNWVsAg%40mail.gmail.com
> <https://groups.google.com/d/msgid/omni-compiler/CAKx-aKw_Rpg_G_40xVHZEkGjnfcAxqzGe1FsOYgduMnQNWVsAg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
Masahiro NAKAO
Email : masahir...@riken.jp
Researcher
RIKEN Center for Computational Science (R-CCS)
Reply all
Reply to author
Forward
0 new messages