PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Determining running timing problem
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
deeppow



Joined: 02 Feb 2012
Posts: 51

PostPosted: Sun Apr 29, 2012 6:41 am    Post subject: Determining running timing problem Reply with quote

Just wanted to roughly time my run time. All I can get is zero from either timcpu, cpu_time, system_clock, or clock. Using PGI VF in Visual Studio 2008 on Win7 64-bit. Code is below and the call to submain typically takes a couple minutes for the case being exercised. I wonder if I have a setting wrong in VS2008.

*******************************
program macro3d
implicit none

real start_time, end_time, cputime, conversion
c integer(kind=8) count, count_rate, count_max

data conversion/1.e-9/
c
c call timcpu(start_time)
call cpu_time(start_time)
write(6,20) start_time
c
call submain
c
c call timcpu(end_time)
call cpu_time(end_time)
write(6,30) end_time
c
cputime = (end_time - start_time)
write(6,100) cputime, cputime/60., cputime/3600.
write(74,100) cputime, cputime/60., cputime/3600.
c
20 format(' start time =',e16.9)
30 format(' end time =',e16.9)
100 format(//,' Total CPU time is',1pe16.9,' sec =',1pe14.7,
& ' min =',1pe12.5,' hr')

stop
end
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Apr 30, 2012 11:25 am    Post subject: Reply with quote

Hi deeppow,

The granularity of the Window's system timer is quite poor, roughly 1 second. So anything smaller then a second will be zero.

- Mat
Back to top
View user's profile
deeppow



Joined: 02 Feb 2012
Posts: 51

PostPosted: Mon Apr 30, 2012 11:45 am    Post subject: Reply with quote

Thanks Mat but as I noted the subroutine between the 2 timing calls takes a couple minutes. It isn't a granularity issue.

I have a separate Intel Fortran compiler and this works fine on it. I suspect I must have something setup wrong in my PGI VS2008 settings but don't see what that might be.
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Apr 30, 2012 11:53 am    Post subject: Reply with quote

Quote:
I suspect I must have something setup wrong in my PGI VS2008 settings but don't see what that might be.
Possible but I don't what since timing routines just hook into the Windows timers. Can you post the code for "submain"? I put a call to sleep in it's place and the timers we correct.

- Mat
Back to top
View user's profile
deeppow



Joined: 02 Feb 2012
Posts: 51

PostPosted: Tue May 01, 2012 2:47 pm    Post subject: Reply with quote

Submain is pretty simple too. It is solve where the work is done.

*dk submain
subroutine submain
implicit none
c
c******************************************************************
c *
c s u b m a i n *
c *
c******************************************************************
c

include 'constant.h'
include 'paramset.h'

real(kind=8) dzi(nlevm)
c
c read in code input from file "macro3d.inp"
c
call input (dzi)
c
c solve for the specified problem
c
call solve (dzi)
c
return
end

INCLUDE files
constant.h

c
real(kind=8) zero, one, two, half, pi, grav

parameter (zero = 0.0, one = 1.0, two = 2.0, half = 0.5)
parameter (pi = 3.1415926535897932, grav = 9.807)
c
c zero the number 0, [real]
c one the number 1, [real]
c two the number 2, [real]
c half the fraction 1/2, [real]
c pi the number 3.141593..., [real]
c grav gravitational constant in si units 9.807..., [real]
c

parameter.h
c
integer npolym, nlevm, ncnmax, ncnmaxp2
integer nelemm, ndrymax
parameter (npolym=2503, nlevm=11, ncnmax=13, ncnmaxp2=ncnmax+2)

parameter (nelemm = npolym * nlevm)
parameter (ndrymax = 180)
c
c npolym maximum number of radial nodes per level, [integer]
c nlevm maximum number of axial levels, [integer]
c nelemm maximum number of nodes (npolym*nlevm), [integer]
c ndrymax maximum number of sites or dry spots, [integer]
c
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
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
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