Date: Sun, 10 Jan 2016 10:39:40 -0553.75 From: "William A. Mahaffey III" <wam@hiwaay.net> To: Ian Smith <smithi@nimnet.asn.au>, freebsd-questions@freebsd.org Subject: Re: Task to busy one CPU 100% for a period of time? Message-ID: <56928802.2040802@hiwaay.net> In-Reply-To: <20160111002439.Q93547@sola.nimnet.asn.au> References: <20160111002439.Q93547@sola.nimnet.asn.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On 01/10/16 10:03, Ian Smith wrote: > Hi crew, hopefully refreshed and sharp as tacks from a holiday! > > I've been doing extensive testing of load average reporting using > different eventtimers (HPET and LAPIC) on stable/9 on a Lenovo X200, > 2.4GHz Core2Duo, at idle and with one, two and four fully CPU-bound > processes that are configured to run for ~15.5 minutes on my system. > > When load averages are being correctly accounted, this produces results > for one-minute averages of 0.00 at idle, 0.99-1.00 with one such task > running, 1.99-2.00 for two and 3.99-4.00 for four, as expected. 5 and > 15 minute LAs respectively take longer to get up toward the same points, > and correspondingly much longer to sink back to 0.00, also as expected. > > When not being correctly accounted, in otherwise the same environment, > this method provides good clues to the extent of errors over this range. > > For this I've been using a program of mine that I know only does a very > large number of fixed and floating point operations, and beyond reading > a config file and around 7 1/2 KB records, uses no I/O nor other system > calls at all in its main loop, when configured with 'nowrite' - or each > instance would generate a 2.4GB 72-minute 96kHz 24-bit stereo .wav file! > > However it's a large Pascal program, not ready for release nor in a form > that others could readily use to reproduce my results, and I'm at the > point where I need to be able to post a method of doing just that. > > So I'm looking for some utility, preferably in the base system but a > port/pkg could do, that can just burn one CPU (ie is single-threaded) > for a specified number of iterations. And not for a specified time - > which would use system time to query time - nor in any interpreted > (syscall-rich) language. > > A little pre- and/or post-loop reporting is not a problem. > > I'm likely missing something quite obvious; suggestions welcome. > > cheers, Ian (please cc me, I'm subscribed to the daily digest) > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > Well, this (benchmarking) really strikes a chord w/ me, I have done *extensive* benchmarking of compiled code (simple benchmarking code & full-up analysis codes) under different compiler/OS combos over 25-ish years. FWIW most compilers I am familiar with have an option to compile single-core/thread/CPU code, which might serve your needs. Also most recent (last 15-ish years) pay attention to environment variables such as OMP_NUM_THREADS & kin, even if they don't use OpenMP coding/directives. This can be used to make 1 process use a specified number of threads/cores/CPU's, up to a compiled-in/hardwired limit. -- William A. Mahaffey III ---------------------------------------------------------------------- "The M1 Garand is without doubt the finest implement of war ever devised by man." -- Gen. George S. Patton Jr.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56928802.2040802>