PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Couldn't accelated fortran fixed format (f77) file?

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



Joined: 03 Dec 2009
Posts: 6

PostPosted: Thu Mar 11, 2010 3:37 am    Post subject: Couldn't accelated fortran fixed format (f77) file? Reply with quote

I'm trying to accelerate our calculation program.
It is .f file and wroted in f77 fixed-formated.

I compiled it with "-ta=nvidia -Minfo", but nothing about accelation appeared.

Even I tried to use "-Mfixed -ta=nvidia", it doesn't work.

Should I change my program to a free-formated file, or here's some opinion to accelate a f77 file?
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Mar 11, 2010 10:49 am    Post subject: Reply with quote

Hi tiomiya,

The PGI Accelerator model works in both free and fixed form, so something else is wrong.

Did you add "!$acc" directives to your code? If so, can you please post a small example including the compilation output?

- Mat
Back to top
View user's profile
tiomiya



Joined: 03 Dec 2009
Posts: 6

PostPosted: Thu Mar 11, 2010 2:16 pm    Post subject: sample Reply with quote

I made a very small .f file.

ftest.f:
program cuda_test
use accel_lib
real a,b
a=1.0
b=1.0
call acc_init( acc_device_nvidia )
!$acc region
do i=1,50000
a=a*b
enddo
!$acc end region
write(*,*) a
end

> pgfortran ftest.f -ta=nvidia -Minfo
(nothing appears)
>./a.out
1.000000

> pgfortran ftest.f -Mfree -ta=nvidia -Minfo
cuda_test:
9, Loop is parallelizable
Accelerator kernel generated
9, !$acc do parallel, vector(256)
>./a.out
launch kernel file=/home/tiomiya/test.d/./ftest.f function=cuda_test line=9 device=0 grid=196 block=256
1.000000

If I rename the .f file to .f90, it shows the accelation massage too.
But most our programs are in f77 format and must be fix to make them free format. If I use -Mfree opinion, lots of Syntax error will occur.

Is there something wrong in my usage?
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Mar 11, 2010 5:44 pm    Post subject: Reply with quote

Hi tiomiya,

Directives must start in column 1 when using Fixed format, otherwise they turn into inline comments.

For example:
Code:
% cat test.f
        program cuda_test
        use accel_lib
        real a,b
        a=1.0
        b=1.0
        call acc_init( acc_device_nvidia )
!$acc region
        do i=1,50000
        a=a*b
        enddo
!$acc end region
        write(*,*) a
        end

% pgfortran -V10.2 test.f -ta=nvidia -Minfo -o a1.out
cuda_test:
      8, Loop is parallelizable
         Accelerator kernel generated
          8, !$acc do parallel, vector(256)


Hope this helps,
Mat
Back to top
View user's profile
tiomiya



Joined: 03 Dec 2009
Posts: 6

PostPosted: Fri Mar 12, 2010 6:28 am    Post subject: It works! Reply with quote

It helps a lot.
Thank you for solving my problem. :)
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