PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

is mclock() supported in PGI fortran?

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Balkrishna



Joined: 22 Mar 2010
Posts: 6

PostPosted: Thu Oct 25, 2012 10:36 pm    Post subject: is mclock() supported in PGI fortran? Reply with quote

Hi

When I tried to use mclock() in PGI fortran,
it complains ": error S0038 : Symbol, mclock, has not been explicitly declared". Do we need to include any module for this to work?

I tried to use system_clock() as an alternative for the timer:

Code:

      program prog
     
      implicit none

     
      integer :: pstart, pend, i,a, j
      integer  :: nprocs, hz, clock0, clock1
      real     :: time
      integer :: t

      call system_clock (count_rate=hz)
!
      call system_clock(count=clock0)
     do i = 1,100000
       write(*,*), ' '
         
      end do

      call system_clock(count=clock1)

      t = (clock1 - clock0)
      time = real(t) / real(hz)

     write(*,*) 'time = ',time

      end 


But it is giving output 0.0000 always, but this is running for few seconds for sure. Any error in the code above?

Thanks in advance.
Back to top
View user's profile
TheMatt



Joined: 06 Jul 2009
Posts: 306
Location: Greenbelt, MD

PostPosted: Fri Oct 26, 2012 6:52 am    Post subject: Reply with quote

I tend to use CPU_TIME() as a timer for code:

Code:
real :: t1, t2

call cpu_time(t1)

 ...code code code...

call cpu_time(t2)
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling 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