home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / vmsnet / alpha / 130 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  2.8 KB

  1. Path: sparky!uunet!cimshop!helios!vchow
  2. From: vchow@helios.UUCP (Victor Chow)
  3. Newsgroups: vmsnet.alpha
  4. Subject: (re-posted) cpu time measurement on VMS.
  5. Message-ID: <10266@cimshop.UUCP>
  6. Date: 22 Jan 93 17:29:52 GMT
  7. Sender: root@cimshop.UUCP
  8. Organization: Consilium Inc, Mountain View, CA
  9. Lines: 64
  10.  
  11. In article <C164Hn.223@dscomsa.desy.de> you write:
  12. |> In article <1993Jan20.164619.8700@eecs.nwu.edu>, shil@eecs.nwu.edu 
  13. |>   (Lei Shi) writes:
  14. |> 
  15. |> |>
  16. |> |>Hi: 
  17. |> |>  ... My question is how I can measure the total CPU used by the 
  18. |> |> execution of the program ... in VMS ...
  19. |> |>                    Your Sincerely,
  20. |> |>
  21. |> |>                    Lei Shi
  22. |> 
  23. |> The are various alternatives. The simplest way is to run your program as 
  24. |> a batch job.   ...   Otherwise, you can use
  25. |> the $ SHOW PROC /ACC for an interactive session but that cannot (as far as
  26. |> I am aware) be zeroed before execution of a program. Finally, if this is not
  27. |> sufficient you should investigate the run time library timer routine
  28. |> LIB$SHOW_TIMER, LIB$STAT_TIMER ... (try $ HELP RTL LIB$ *TIMER*.
  29. |> 
  30.  
  31. Lei Shi,
  32.  
  33. Using LIB$ or SYS$ calls allow you to get accurate accounting information about
  34. a process the way you want.  The disadvantage is that you have to modify your
  35. source code to do so (and provided that you still have the source code).
  36.  
  37. Submitting an image to a batch job and get the accounting information from the 
  38. log file should get what you need.  However your LOGIN.COM and the system
  39. SYLOGIN.COM should be relatively short and do not run resource hogging command
  40. s or images (relative to your actual image).  Otherwise the accouting info of
  41. the batch job does not accurately reflect the resources used by your image
  42. only. Remember that a VMS batch job includes not only the images/commands you
  43. want run, but also other commands or images (such as LOGIN.COM and SYLOGIN.COM,
  44. etc) that are executed as part of the batch job.
  45.  
  46. Another simple alternative that requires no modification to your code and LOGIN/SYLOGIN.COM is to do the following steps:
  47.  
  48. 1. create a file, say, your_image.COM like this:
  49.     $ run your_image.EXE        or (@ your_dcl.COM)
  50.     $ logout/full
  51.  
  52. 2. then at the DCL prompt, enter
  53.     SPAWN @your_image.COM
  54.  
  55. The SPAWN starts a child process which starts with "zeroed" accounting info to 
  56. run your image and the "logout/full" command.  The "Accounting information" 
  57. that logout/full prints should be very close to what "your_image" needs (plus 
  58. the overhead needed by the SPAWN(?), @your_image.COM, and "logout/full",etc).  
  59. (I assume your program takes a lot more resources to run than a simple SPAWN
  60. command.) 
  61.  
  62. As long as you are not trying to precisely measure a tiny image that uses very 
  63. little resource and that you don't need to get the process' accounting info at 
  64. different parts of your image, this simple method should be adequate. 
  65.  
  66. Good luck!  8-)
  67.  
  68. Victor
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.