home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / wizards / 3626 < prev    next >
Encoding:
Text File  |  1992-08-15  |  2.5 KB  |  56 lines

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