From owner-freebsd-questions@FreeBSD.ORG Thu Feb 2 00:09:50 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30527106564A for ; Thu, 2 Feb 2012 00:09:50 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirj.bris.ac.uk (dirj.bris.ac.uk [137.222.10.78]) by mx1.freebsd.org (Postfix) with ESMTP id DE7D98FC1D for ; Thu, 2 Feb 2012 00:09:49 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirj.bris.ac.uk with esmtp (Exim 4.72) (envelope-from ) id 1RskFI-0006JD-Hk for freebsd-questions@freebsd.org; Thu, 02 Feb 2012 00:09:48 +0000 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1RskFI-0002OM-F4 for freebsd-questions@freebsd.org; Thu, 02 Feb 2012 00:09:48 +0000 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5) with ESMTP id q1209m9F071416 for ; Thu, 2 Feb 2012 00:09:48 GMT (envelope-from mexas@bris.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5/Submit) id q1209m1E071415 for freebsd-questions@freebsd.org; Thu, 2 Feb 2012 00:09:48 GMT (envelope-from mexas@bris.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bris.ac.uk using -f Date: Thu, 2 Feb 2012 00:09:48 +0000 From: Anton Shterenlikht To: freebsd-questions@freebsd.org Message-ID: <20120202000947.GA71405@mech-cluster241.men.bris.ac.uk> Mail-Followup-To: freebsd-questions@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Subject: OpenMP on FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 00:09:50 -0000 I'm new to OpenMP. I wonder if there are any special considerations when running OpenMP on FreeBSD? For example, I have this OMP parallelised fortran program, nested do loops, compiled with gfortran46. When I run it with 2 threads on a 2-cpu box, I see in top(1): PID UID PRI NICE SIZE RES STATE C TIME CPU COMMAND 63995 1001 89 0 57048K 34272K CPU1 1 1:06 55.08% dummy.sx{dummy.sx} 63995 1001 87 0 57048K 34272K RUN 1 1:02 52.39% dummy.sx{dummy.sx} 11 0 155 ki31 0K 32K RUN 0 376:58 51.46% idle{idle: cpu0} 11 0 155 ki31 0K 32K RUN 1 368:18 45.36% idle{idle: cpu1} I wonder why, even after a minute of run time, I still have nearly a whole cpu idle? As a result the run time with 2 threads is nearly identical to run time with 1 thread. It's likely that I'm not using OMP correctly, but I wanted to check if there are any special FreeBSD related issues to bear in mind when coding with OMP. Thanks -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423