Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!nike!ucbcad!ucbvax!TCGOULD.TN.CORNELL.EDU!garry From: garry@TCGOULD.TN.CORNELL.EDU (Garry Wiegand) Newsgroups: mod.computers.vax Subject: Re: VAX CPU usage not reproducible Message-ID: <8609221725.AA00488@tcgould.tn.cornell.edu> Date: Mon, 22-Sep-86 13:25:25 EDT Article-I.D.: tcgould.8609221725.AA00488 Posted: Mon Sep 22 13:25:25 1986 Date-Received: Tue, 23-Sep-86 18:49:45 EDT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: garry%cadif-oak@cu-arpa.cs.cornell.edu Organization: Cornell Engineering && Flying Moose Graphics Lines: 33 Approved: info-vax@sri-kl.arpa In a recent article A105@UWOCC1.BITNET (Brent Sterner) wrote: > > Help again. It has been brought to my attention here that a user >running a fixed job can be charged varying amounts... > Hear ye, hear ye, all those who want to charge for CPU time or make accurate timing measurements: the "CPU time" figure is *not accurate*. If there is more than one user on the system, then it is also *not reproducible*. My suspicion is that CPU only gets charged at "quantum end". If a task is no longer running when that clock tick happens (for example, it runs for a little while, then stops for a page fault or I/O completion just before the tick), it doesn't get charged. Whichever task IS running at that instant does get charged. So: VMS cpu timing is not measuring - it's sampling! For charging, we just live with it. For timing, what I do is: 1) make sure everyone else is off the system 2) log in on another terminal, set priority down, and start a little "pure-compute" program. Empty DO-loops are satisfactory. 3) run the program I want to time, and 4) ask the "pure-compute" program how many machine instructions it managed to get while 3) was in progress. Context-switching between the foreground and the background may be soaking up a little machine time, but this is the most accurate method I've found. Or at least reproducible. PS - don't trust low-priority batch jobs not to scramble your figures either - the page-faulter doesn't seem to care what the nominal job priority is!