From owner-freebsd-questions@freebsd.org Mon Jan 11 05:04:11 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 321E0A6B947 for ; Mon, 11 Jan 2016 05:04:11 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0BF71F30 for ; Mon, 11 Jan 2016 05:04:09 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id u0B545r1084916; Mon, 11 Jan 2016 16:04:06 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Mon, 11 Jan 2016 16:04:05 +1100 (EST) From: Ian Smith To: "William A. Mahaffey III" cc: freebsd-questions@freebsd.org Subject: Re: Task to busy one CPU 100% for a period of time? In-Reply-To: <56928802.2040802@hiwaay.net> Message-ID: <20160111154616.G93547@sola.nimnet.asn.au> References: <20160111002439.Q93547@sola.nimnet.asn.au> <56928802.2040802@hiwaay.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 05:04:11 -0000 On Sun, 10 Jan 2016 10:39:40 -0553.75, William A. Mahaffey III wrote: > Date: Sun, 10 Jan 2016 10:39:40 -0553.75 That's a seriously strange timezone you're inhabiting, Wiliiam .. fly.hiwaay.net processed this at Sun, 10 Jan 2016 10:34:11 -0600 > On 01/10/16 10:03, Ian Smith wrote: [..] > > 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) > 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. Thanks for your response. However I don't do C, and really need to find something out of the box that I can configure to run at 100% of one CPU for a specified number of iterations, which will then run for a certain amount of CPU time on my hardware, while always on the run queue. Anyone? cheers, Ian