From owner-freebsd-smp Tue Jun 22 11:35:48 1999 Delivered-To: freebsd-smp@freebsd.org Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (Postfix) with ESMTP id 8810A15480; Tue, 22 Jun 1999 11:35:36 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id LAA21971; Tue, 22 Jun 1999 11:35:35 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp02.primenet.com, id smtpd021941; Tue Jun 22 11:35:27 1999 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id LAA25521; Tue, 22 Jun 1999 11:35:27 -0700 (MST) From: Terry Lambert Message-Id: <199906221835.LAA25521@usr05.primenet.com> Subject: Re: Multi processor support? To: gsutter@pobox.com (Gregory Sutter) Date: Tue, 22 Jun 1999 18:35:27 +0000 (GMT) Cc: tlambert@primenet.com, dvwd@wwdg.com, freebsd-questions@FreeBSD.ORG, freebsd-smp@FreeBSD.ORG In-Reply-To: <19990621182054.G73528@001101.zer0.org> from "Gregory Sutter" at Jun 21, 99 06:20:54 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > > Also, is there any way to control what processes happen on > > > which cpu? > > > > Heh. That wouldn't be very symmetric... > > No, but having processor affinity would be quite nice. There's > nothing wrong with MP. Processor afinnity is not the same thing as locking a process to a CPU (affinity means that it prefers to stay on the same CPU, as opposed to being forced to stay on the same CPU no matter how loaded that CPU gets vs. the relative cost of a cache bust. Unless you are engaged in L1/L2 cache-busting behaviour (not possible with one process), then locking to a particular CPU buys you only assymetry (kind of like wearing a jaunty hat). INRE: The previous question about one FORTRAN process using multiple CPU's in Linux being better than that on FreeBSD: not possible at the present time. The point is that in order for a single program to benefit from SMP, you must either engage in static scheduling, e.g.: | Compile-time Partitioning and Scheduling of Parallel Programs | V. Sarkar and J. Hennessy | Proceedings of the SIGPLAN '88 Symposium on Compiler | Construction, 1986, pages 17-26 | Compile-Rime Scheduling and Assignment of Data-Flow Program | Graphs | S. Ha and E.A. Lee | IEEE Transactions on Computers, November 1991, pages 1225-1238 Or you must engage in task granularization and partitioning, e.g.: | On the Granularity and Clustering of Directed Acyclic Task | Graphs | A. Gerasoulis and T. Yang | IEEE Transactions on Parallel and Distributed Systems, June | 1993, pages 686-701 | Grain Size Determination for Parallel Processing | B. Kruatrachue and T. Lewis | IEEE Software, January 1988, pages 23-32 | Lazy Task Creation: A Technique for increasing Granularity | of Parallel Programs | E. Mohr, D.A. Kranz, and R.H. Halstead, Jr. | IEEE Transactions on Parallel and Distributed Systems, July | 1991, pages 264-280 (Note: this last describes the method used for lazy kernel thread creation utilized by BSDI -- only 8 years behind the literature). Or you must use scheduling tools, e.g.: | PARSA: A Parallel Program Software Development Tool | B. Shirazi et al. | Proceedings 1994 Symposium on Assessment of Quality Software | Development Tools, 1994, pages 96-111 | Parafrase-2: An Environment for Parallelizing, Partitioning, | Synchronizing, ans Scheduling Programs on Multiprocessors | C.D. Polychronopoulos et al. | Proceedings 1989 International Conference on Parallel | Processing In other words, you need help from your tools, and the GNU FORTRAN compiler just isn't going to cut it. Neither is a commercial FORTRAN compiler without explicit knowledge of the task architecture implemetnation so that it know where to do the trade-offs. The best you are going to get is explicit division of tasks between multiple processes. At *that* point (and *only* then) does CPU affinity become a real issue. Even so, it's not an issue addressed (IMO) by the Linux SMP implementation (any more than the FreeBSD or BSDI implementations). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message