PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

acc region on derive type

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
escj



Joined: 30 Sep 2009
Posts: 63
Location: Laboratoire d'Aérologie, Toulouse, FRANCE

PostPosted: Mon Sep 20, 2010 9:16 am    Post subject: acc region on derive type Reply with quote

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

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

Code:

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 :

Code:

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 !
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Mon Sep 20, 2010 1:36 pm    Post subject: Reply with quote

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.

Code:
% 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
Back to top
View user's profile
escj



Joined: 30 Sep 2009
Posts: 63
Location: Laboratoire d'Aérologie, Toulouse, FRANCE

PostPosted: Tue Sep 21, 2010 1:26 am    Post subject: Reply with quote

Hello Mat .
Thank you .

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

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
Back to top
View user's profile
escj



Joined: 30 Sep 2009
Posts: 63
Location: Laboratoire d'Aérologie, Toulouse, FRANCE

PostPosted: Thu Sep 29, 2011 3:01 am    Post subject: Reply with quote

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" ??

Quote:

+ 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
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group