PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

call system_clock

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



Joined: 04 Apr 2005
Posts: 2

PostPosted: Mon Apr 04, 2005 6:07 am    Post subject: call system_clock Reply with quote

Hi,
I am using a fortran 90 code that makes a call to system_clock,
something that looks like this:

program test
implicit none
integer :: clock0, hz, cmax
call system_clock(count=clock0,count_rate=hz,count_max=cmax)
print*, clock0,hz,cmax
end program test

When I compile it with intel complier, it works fine, however if I use the porland complier
(pgf90 on linux) I get 0 returned as the first argument (clock0).
Does anybody know why this happens?
Any solution?

Many thanks!
Mad
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Apr 04, 2005 10:34 am    Post subject: Reply with quote

Hi Mad,

The first time you call "system_clock", the count will always be zero since you are initializing the "clock". Each subsequent call to "system_clock" will yield the number of "tics", where there are 1000 tics per second, that have passed since the initial call. Note that PGI and Intel are both correct, but just have slightly different intrepetations of what the inital value should be.

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



Joined: 04 Apr 2005
Posts: 2

PostPosted: Tue Apr 05, 2005 5:48 am    Post subject: Reply with quote

Hi Mat,
thanks for your help, it works!

Cheers,
Mad
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