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

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