acc region on derive type

Hello , I’m new here ( from France ) .

Will the next release of “pgf90” ( 11.0 ) support, acc region on derive type on Fermi GPU ?

PROGRAM test_derive_type

  IMPLICIT NONE

  INTEGER , PARAMETER     :: N=64

  TYPE GRID
     REAL , DIMENSION(N) :: H2O,O3
  END TYPE GRID

  TYPE(grid) :: tgrid

  !$acc region
  tgrid%H2O(:) = 1.0
  tgrid%O3(:)  = 1.0 / ( 1.0 * N )
  !$acc end region

  print *, "TGRID=",  tgrid%H2O(N) , tgrid%O3(N)

END PROGRAM test_derive_type

With the pgf90-10.9 :

pgf90 -V
pgf90 10.9-0 64-bit target on x86-64 Linux -tp nehalem-64

pgf90 -ta=nvidia,cuda3.1,cc20  -Minfo=accel simple_acc_derive_type.f90 -o simple_acc_derive_type
test_derive_type:
     13, Accelerator region ignored
     14, Accelerator restriction: struct/union/derived type variables not yet supported: tgrid%h2o
         Accelerator restriction: struct/union/derived type variables not yet supported: tgrid%o3
         Accelerator restriction: struct/member references are not yet supported

Thank you !

Hi escj,

The problem here is not that derived types aren’t supported (they are) rather accelerating an array within a single derived type is not. Changing the code to make an array of derived types will allow the code to work.

% cat dt.f90

PROGRAM test_derive_type

  IMPLICIT NONE

  INTEGER , PARAMETER     :: N=64
  INTEGER :: i

  TYPE GRID
     REAL :: H2O,O3
  END TYPE GRID

  TYPE(grid),dimension(N) :: tgrid

  !$acc region
  tgrid(:)%H2O = 1.0
  tgrid(:)%O3  = 1.0 / ( 1.0 * N )
  !$acc end region

  print *, "TGRID=",  tgrid(N)%H2O , tgrid(N)%O3

END PROGRAM test_derive_type
% pgf90 -ta=nvidia -Minfo=accel dt.f90 -V10.9
test_derive_type:
     15, Generating copyout(tgrid(1:64))
         Generating compute capability 1.0 binary
         Generating compute capability 1.3 binary
     16, Loop is parallelizable
         Accelerator kernel generated
         16, !$acc do parallel, vector(64)
             CC 1.0 : 3 registers; 20 shared, 16 constant, 0 local memory bytes; 66 occupancy
             CC 1.3 : 3 registers; 20 shared, 16 constant, 0 local memory bytes; 50 occupancy
% a.out
 TGRID=    1.000000       1.5625000E-02

Hope this helps,
Mat

Hello Mat .
Thank you .

The problem with this form , I think is that this kind of derived type didn’t vectorize wery well .

TYPE GRID
REAL :: H2O,O3
END TYPE GRID

TYPE(grid),dimension(N) :: tgrid

tgrid(:)%H2O = 1.0
tgrid(:)%O3 = 1.0 / ( 1.0 * N )

The H2O data are not stride1 , and that will affect the performance because in our code and the “true” derived type contain about 70 chemicals species , and 100th of reactions are computed in the subroutines .
It’s why we use the derived type, with array as member’s , to pass only 1 argument to subroutine and not 100 of them …

I will try your suggestion and report the performance of the 2 differents forms .

Thank you again, Mat

Hello , I’m back …

Alway the same ‘basic’ problem.

This ‘basic’ functionality is not already supported with the PGI 10.8 version .

With cuda4.0 a lot a new functionally have been added for the management of
pointer & memory between CPU & GPU . I don’t see were is the ‘difficult point’ with this problem ?

So my question is when it would be ?

Do I have to post this question in an other forum <=> “Wish List” ??

  • pgf90 -V -g -Mcuda -ta=nvidia,cc20,cuda4.0,keepgpu -Minfo=accel,intensity,ccff -O2 simple_acc_derive_type.f90 -o simple_acc_derive_type_host
  • tee error_cuda
    PGF90/x86-64 Linux 11.8-0
    Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
    Copyright 2000-2011, STMicroelectronics, Inc. All Rights Reserved.
    PGF90/x86-64 Linux 11.8-0
    Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
    Copyright 2000-2011, STMicroelectronics, Inc. All Rights Reserved.
    PGF90-W-0155-Accelerator region ignored; see -Minfo messages (simple_acc_derive_type.f90: 13)
    test_derive_type:
    13, Intensity = 0.0
    Accelerator region ignored
    14, Intensity = 0.0
    Accelerator restriction: struct/union/derived type variables not yet supported: tgrid%h2o
    Accelerator restriction: struct/union/derived type variables not yet supported: tgrid%o3
    Accelerator restriction: struct/member references are not yet supported

I have read the PGI article on the Fortran 2003 Object-Oriented Programming …

… but the ACC part alway miss the simple “derive type” syntax for intensive computation .


For use it’s a priority as all our code <=> 1 millions lines of Fortran90 , use already “object-oriented” style with “stream computing” like “array syntax” .

In France & Europe we have now a new big Petaflopic BULLX cluster ‘CURIE’ with last Fermi GPU & PGI compiler <=> see here http://www-hpc.cea.fr/fr/complexe/tgcc-curie.htm
… but we could not use it in the ‘Grand Challenge Project’ because of this lack ‘basic’ functional .

Thank you, in advance for your answer