home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.wizards
- Path: sparky!uunet!wupost!zaphod.mps.ohio-state.edu!sdd.hp.com!usc!sol.ctr.columbia.edu!csa!kibirev
- From: kibirev@csa.bu.edu (oleg kibirev)
- Subject: Re: MP CPU-time phenomena
- Organization: Computer Science Department, Boston University, Boston, MA, USA
- References: <1992Aug6.214740.164@socrates.umd.edu> <15250002@hprpcd.rose.hp.com> <1992Aug14.063450.25740@fcom.cc.utah.edu>
- Message-ID: <1992Aug15.172139.13498@ctr.columbia.edu>
- Sender: news@ctr.columbia.edu (The Daily Lose)
- Date: Sat, 15 Aug 1992 17:21:39 GMT
- X-Posted-From: csa.bu.edu
- X-Posted-Through: sol.ctr.columbia.edu
- Lines: 42
-
- In article <1992Aug14.063450.25740@fcom.cc.utah.edu> terry@cs.weber.edu (A Wizard of Earth C) writes:
- >In article <15250002@hprpcd.rose.hp.com> tmilner@hprpcd.rose.hp.com (Tom Milner) writes:
- >>In comp.unix.wizards, boyd@prl.dec.com (Boyd Roberts) writes:
- >>
- >>| In article <1992Aug6.214740.164@socrates.umd.edu>, steves@socrates.umd.edu (Steven Sonnenberg) writes:
- >>| > The cpu-bound application is:
- >>| >
- >>| > while (1) i++;
- >>| >
- >>| > I am measuring process CPU utilization based on u.u_utime + u.u_stime
- >>| > over the elapsed time (CPU seconds). For example, in 10 seconds
- >>| > there are 20 seconds on CPU time (assuming 2 processors).
- >>| >
- >>| And just how is your while loop going to run on both processors at the same time?
- >>There's no reason that a processor switch could not occur anywhere in
- >>the code... In a 10 second window, all processors could have a chance to
- >>execute the code stream.
- >
- >At the same time, or are you switching processors (ie: serializing)? I suspect
- >that even if you forced a processor switch, that's all it'd be. I mean, you
- >can't seriously be expecting i to increment n times as fast for n processors!
- >
- >What you need to do to force concurrent utilization is to take a concurrent
- >benchmark and compile it with the right compiler (that knows about breaking
- >concurrent code into multiple threads of execution) and then run it. Even
- >then, you probably aren't going to get aggregate CPU time, especially if you
- >are runing an SMP'able kernel (it might be possible to get aggregate time if
- >you are using an ASMP box and measuring using the master... but not likely).
- >
- >The only alternative to this might be to gather statistics in the scheduler...
- >but then, of course, you have to subtract out your statistics gathering to
- >be accurate, and then subtract out your subtract time, etc.
- >
- Hmmm, won't this work?
-
- while(fork()>0);
- for(;;i++);
-
- Oleg
-
-
-
-