[R] More than doubling performance with snow

Hesen Peng hesen.peng at emory.edu
Mon Nov 24 03:45:04 CET 2008


Hey my R buddies,

I installed the "snow" and "rpvm" package on my Lenovo Thinkpad T400
today. The experiment below gave me a surprise. The time consumed by
serial processing was several times larger than that taken by parallel
processing. I'm very curious how this happened. Thank you very much.

> library(snow)
>
> cc <- makePVMcluster(2)
>
> temp <- list(matrix(rnorm(1000000),1000),matrix(rnorm(1000000),1000))
>
> system.time(tt <- clusterApply(cc,temp,"solve"))
   user  system elapsed
  0.584   0.144   4.355
> system.time(ttt <- sapply(temp,"solve"))
   user  system elapsed
  4.777   0.100   4.901

I'm using Ubuntu 8.10. And here's my CPU info:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Core(TM)2 Duo CPU     P8400  @ 2.26GHz
stepping        : 6
cpu MHz         : 800.000
cache size      : 3072 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx
lm constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr sse4_1 lahf_lm
bogomips        : 4521.96
clflush size    : 64
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Core(TM)2 Duo CPU     P8400  @ 2.26GHz
stepping        : 6
cpu MHz         : 800.000
cache size      : 3072 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx
lm constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr sse4_1 lahf_lm
bogomips        : 4521.97
clflush size    : 64
power management:

-- 
彭河森 Hesen Peng
http://hesen.peng.googlepages.com/


More information about the R-help mailing list