このページの更新は終了しました。

最新の情報はTSUBAME3.0計算サービスのWebページをご覧ください。

TSUBAME2.5からTSUBAME3.0へのデータ移行方法の資料はこちら

I would like to compile the fortran program for GPU with a PGI compiler. ?

The compiler of PGI can compile the program for GPU. 
The usage is the following two kinds.

1.directive
  A directions line is added to the program described by the usual fortran. 
  Thereby, it can compile so that it may operate as a program for GPU. 

 ex)
    !$acc region
          DO k=1,100
             DO J = 1,600
                DO I = 1,5000
                   c(j,i) = c(j,i) + A(I,J) * B(J,I)
                ENDDO
             ENDDO
          ENDDO
    !$acc end region

A GPU target part is pinched in a directions line.

 > pgf95 -Minfo=all -fastsse -o tesla  -ta=nvidia cuda.f wclock.c
    An option(-ta=nvidia) is added and compiled.  

  【note】
   a) The version of cuda can be specified.
       -ta=nvidia,cuda3.0  etc. 
       The  cuda version which can be specified changes with versions of a compiler. 
   b) Coexistence is impossible "-mcmodel=medium". 

2.cuda-fortran
  The program described in cuda compatible form can be compiled.

 ex)
    module mmul_mod
        use cudafor
        contains
        attributes(global) subroutine mmul_kernel( A, B, C, N, M, L )
           real,device :: A(N,M), B(M,L), C(N,L)
           integer, value :: N, M, L
           integer :: i, j, kb, k, tx, ty
           real, shared :: Asub(16,16), Bsub(16,16)
          :

 The program described in this way is compiled. 

  ※ Please refer to the following for programming.
      GPUコンピューティング研究会
      http://gpu-computing.gsic.titech.ac.jp/node/62

 > pgfortran -Mcuda cudam.cuf
    An option(-Mcuda) is added and compiled.

  【note】
  a) The version of cuda can be specified.
        -Mcuda=ptxinfo,cuda3.2 etc.
     The  cuda version which can be specified changes with versions of a compiler.
     "ptxinfo" The optimization history of a cuda portion is outputted. 
  b) It can live together with "-mcmodel=medium".

【note】About a compiler 
   pgfortran is Fortran-2003. Usual should use this. 
   Please use, when compatibility with a compiler with pgf95 and pgf77 [ old for a certain reason ] is required. 
※Although the command of mpif90 is pgf95, it can be used like pgfotran. 
Reference of guidance of use:
http://tsubame.gsic.titech.ac.jp/docs/guides/tsubame2/html/programming.h...