s-news
[Top] [All Lists]

Re: Multiple instances of Splus on dual CPU

To: s-news@lists.biostat.wustl.edu
Subject: Re: Multiple instances of Splus on dual CPU
From: "tomas mann" <mann_tomas@hotmail.com>
Date: Wed, 20 Aug 2003 20:17:08 +0000
It turned out that the main culprit is the hyperthreading (at least for Win 2000 server) - when I turned it off (on a dual CPU machine), I managed to run in parallel 2 identical S+ processes for roughly the same tyme (OK, maybe 1.2-1.3 times slower) as a single process on an identical 1 CPU machine.

A summary of the responses is enclosed. TM

Nels Tomlinson:
I wonder if you'd find that turning off hyperthreading would cause both
processes to complete in five minutes?

Hyperthreading is a clever trick to prevent CPU resources from sitting idle,
in some circumstances.  When you have two processes which don't require the
same CPU resources (e.g., Splus and Word), hyperthreading lets both of them
execute almost simultaneously.  Splus can hog the FPU without entirely
blocking Word. When you have two processes which require the same resources
(e.g., two instances of Splus, which both heavily tax the FPU), they will
contend for those resources, and at best won't slow each other down.

Remember, you really have two CPU's, and hyperthreading doesn't change that. At best, it can help you use those two more efficiently, and at worst you'll
want to turn it off for some jobs.  This could be one of them.

Another possibility would be that the process is I/O bound.  Modern CPU's
are usually I/O bound, for most tasks, since MHz has been hyped for sales
purposes, but bandwidth hasn't.  If getting stuff in and out of RAM (or
worse yet, on and off the disk)is the bottleneck, then hyperthreading
doesn't matter. I would expect that situation to result in two tasks taking
twice as long.  Since you say that the CPU's aren't idling, that doesn't
sound like the case here, but I'm not familiar with the details of the
Windows resource monitors. What are the CPU's busy at? Can you look at the
memory and disk utilization patterns?

I guess that you'll have to identify the bottleneck, and see whether that
second CPU is opening it up or making it tighter.

Some interesting information would be whether your machine uses SDR, DDR or
RDRAM (they have different latency and bandwidth characteristics), what the
bus speed is and whether your code loops tightly on a smidgen of data, or is
pumping gigabytes through the CPU's.  Is the computer swapping with one
process?  With two?  That sort of info might help in guessing about where
the bottleneck lies.

One final thought: could it be that the two instances of Splus are
contending for one copy of some other resource, such as a dll, or standard
output?  Again, I'm not very familiar with Windows, so I don't know if
that's a realistic suggestion.

If you get any hard information about what's happening, I'm sure that I'm
not the only one who'd like to hear it.


John James, Insightful
(This is an informal reply and does not represent the view of Insightful)
One suggestion - and I don't know of a computational way to implement it yet,
although it's on my "to do" list - is to use the task manager to assign each
S-PLUS process to each CPU.
What happens in 2 and 4 cpu tasks is that the OS tries to load balance and swaps
memory. Therefore its common that S+ runs slower on 2 cpu machines cf. 1 cpu
machines.

Vadim Kutsyy:
I would say that there is something wrong with your system setup. I
would check use of SWAP file. I often run multiple processes of Splus on
dual Xeon (Suse Linux) and Dual Pentium 4 (Win2K).  Both works as
expected. :
f<-function(n) for(i in 1:n) y=sqrt(i)
Single procces:
sys.time(f(1000000))
[1] 105.109 107.058
Dual process:
sys.time(f(1000000))
[1] 106.297 109.621
sys.time(f(1000000))
[1] 106.046 109.136

_________________________________________________________________
Find a cheaper internet access deal - choose one to suit you. http://www.msn.co.uk/internetaccess


<Prev in Thread] Current Thread [Next in Thread>
  • Re: Multiple instances of Splus on dual CPU, tomas mann <=