🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: vmsnet.alpha
Article #30

(re-posted) cpu time measurement on VMS.

#30
From: Victor Chow
Date: Fri, 22 Jan 1993 17:29
58 lines
2930 bytes
In article <C164Hn.223@dscomsa.desy.de> you write:
|> In article <1993Jan20.164619.8700@eecs.nwu.edu>, shil@eecs.nwu.edu 
|>   (Lei Shi) writes:
|> 
|> |>
|> |>Hi: 
|> |>  ... My question is how I can measure the total CPU used by the 
|> |> execution of the program ... in VMS ...
|> |>					Your Sincerely,
|> |>
|> |>					Lei Shi
|> 
|> The are various alternatives. The simplest way is to run your program as 
|> a batch job.   ...   Otherwise, you can use
|> the $ SHOW PROC /ACC for an interactive session but that cannot (as far as
|> I am aware) be zeroed before execution of a program. Finally, if this is not
|> sufficient you should investigate the run time library timer routine
|> LIB$SHOW_TIMER, LIB$STAT_TIMER ... (try $ HELP RTL LIB$ *TIMER*.
|> 

Lei Shi,

Using LIB$ or SYS$ calls allow you to get accurate accounting information about
a process the way you want.  The disadvantage is that you have to modify your
source code to do so (and provided that you still have the source code).

Submitting an image to a batch job and get the accounting information from the 
log file should get what you need.  However your LOGIN.COM and the system
SYLOGIN.COM should be relatively short and do not run resource hogging command
s or images (relative to your actual image).  Otherwise the accouting info of
the batch job does not accurately reflect the resources used by your image
only. Remember that a VMS batch job includes not only the images/commands you
want run, but also other commands or images (such as LOGIN.COM and SYLOGIN.COM,
etc) that are executed as part of the batch job.

Another simple alternative that requires no modification to your code and LOGIN/SYLOGIN.COM is to do the following steps:

1. create a file, say, your_image.COM like this:
    $ run your_image.EXE        or (@ your_dcl.COM)
    $ logout/full

2. then at the DCL prompt, enter
    SPAWN @your_image.COM

The SPAWN starts a child process which starts with "zeroed" accounting info to 
run your image and the "logout/full" command.  The "Accounting information" 
that logout/full prints should be very close to what "your_image" needs (plus 
the overhead needed by the SPAWN(?), @your_image.COM, and "logout/full",etc).  
(I assume your program takes a lot more resources to run than a simple SPAWN
command.) 

As long as you are not trying to precisely measure a tiny image that uses very 
little resource and that you don't need to get the process' accounting info at 
different parts of your image, this simple method should be adequate. 

Good luck!  8-)

Victor
Technical Details
Message-ID: <10266@cimshop.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!cimshop!helios!vchow

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cimshop!helios!vchow
From: vchow@helios.UUCP (Victor Chow)
Newsgroups: vmsnet.alpha
Subject: (re-posted) cpu time measurement on VMS.
Message-ID: <10266@cimshop.UUCP>
Date: 22 Jan 93 17:29:52 GMT
Sender: root@cimshop.UUCP
Organization: Consilium Inc, Mountain View, CA
Lines: 64