Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion activate more than one core in Mathematica 6.0 (for win)?

View Parsed - Show only message text

Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.247.MISMATCH!news-out.readnews.com!news-xxxfer.readnews.com!newspump.sol.net!10.218.45.203.MISMATCH!newsfeeds.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail
From: michael.p.crouc...@googlemail.com
Newsgroups: comp.soft-sys.math.mathematica
Subject: Re: activate more than one core in Mathematica 6.0 (for win)?
Date: Sat, 4 Aug 2007 10:01:34 +0000 (UTC)
Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Sender: st...@smc.vnet.net
Approved: Steven M. Christensen <st...@smc.vnet.net>, Moderator
Message-ID: <f91ipu$5ud$1@smc.vnet.net>
References: <f8v18h$db8$1@smc.vnet.net>
Lines: 53
NNTP-Posting-Date: 04 Aug 2007 10:01:26 GMT
NNTP-Posting-Host: 61ab30f5.news.twtelecom.net
X-Trace: DXC=3LaH4=X\R<V<cmg?VPSH`YC_A=>8kQj6]Y;@_o827nGSZ^69]Xh>6?QEFiONJ7[GoVVW[UnnQ41ZW
X-Complaints-To: abuse@twtelecom.net

On 3 Aug, 11:49, kristoph <kristophs.p...@web.de> wrote:
> Hi,
>
> How can Mathematica 6.0 use more than one core of a quad core cpu
> under Windows Vista? During calculations the system requires only 25 %
> of its capacity. This implies that it uses only one of the four cores.
>
> Thanks for answer,
> Kristoph

Hi Kristoph

As far as I know it is only certain linear algebra functions that
automatically make use of multiple cores.  On my dual core laptop
under windows and Mathematica 6 this seems to be working by default.
For example If I do

Timing[
 a = RandomReal[1, {1000, 1000}];
 b = SingularValueDecomposition[a];
 ]

I get a time of 5.9 (ish)  seconds.

Now in Mathematica 5.2 you could set the number of threads using the
operating system environment variable OMP_NUM_THREADS so I tried
setting this to 2 to see what happened - nothing!  The time stayed the
same.  However if I set it to 1 then the timing came out at 8.9
seconds.  This leads me to the conclusion that Mathematica 6
automatically makes use of multiple cores when it can but you can over-
ride its behavior using OMP_NUM_THREADS,   What would be nice is a
list of functions that makes use of multiple processors/cores.  I
think it is only certain BLAS/Lapack functions but am not sure.

As for Linux - I am confused!  I dual boot into Ubuntu on the same
laptop and this also has Mathematica 6.  The only thing that has
changed is the operating system - everything else is the same but I
get the following timings for the above code (to 1dp)

OMP_NUM_THREADS unset gives 8.8 seconds
OMP_NUM_THREADS=1 gives 8.5 seconds
OMP_NUM_THREADS=2 gives 8.8 seconds

using top I see the processor usage going over 100% when using 2
threads so it seems to be using both cores (only goes up to 100% on
one core). But using 2 cores is slower than one core and everything is
always slower than when I use my windows partition - so something is
messed up!

Best Regards,
Mike



Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google