[R-sig-hpc] multicore 0.1-4 for Windows
Ross Boylan
ross at biostat.ucsf.edu
Sat Aug 15 17:22:49 CEST 2009
On Sat, 2009-08-15 at 22:02 +0800, huang min wrote:
> Yep. I got similar results. Some person recommands to use some non-trival
> examples. My concern is that the package doesn't give the correct answer
> even for the non-trival example, how can you expect it to work for other
> examples? See one of my example:
I didn't make the suggestion, but in the recent case the advice to use
non-trivial examples concerned performance measurement. For
correctness, the simplest failure is the best.
Ross
>
> > mclapply(1:10, function(x)rnorm(x), mc.cores=1)
> [[1]]
> [1] -0.3462702
> [[2]]
> [1] -2.02105262 -0.09585892
> [[3]]
> [1] 1.77221975 -0.46601980 -0.07315387
> [[4]]
> [1] -2.1283152 -0.6079173 0.4305617 0.3908323
> [[5]]
> [1] -1.1565899 2.5569418 2.1897070 1.0436908 -0.5969151
> [[6]]
> [1] 0.9828604 -0.1479499 -0.1284607 -0.3347436 1.8018194 -1.4417220
> [[7]]
> [1] 0.55425627 -0.09030843 -0.60091740 0.12777185 -0.13998607 0.35154851
> [7] -0.04631663
> [[8]]
> [1] -0.35164946 0.97417980 -1.49269589 -0.18409462 0.06105646 0.26404434
> [7] -0.18976067 -1.14565065
> [[9]]
> [1] 0.22496664 1.06111320 2.01179778 -0.27569373 -0.42400996 -0.05679749
> [7] 0.30982861 1.52450703 -0.21109130
> [[10]]
> [1] -1.3539043 -1.3596462 0.5039675 -1.1326639 0.2802417 -0.1049306
> [7] -0.3243349 0.4130826 0.9384500 1.3505106
> > mclapply(1:10, function(x)rnorm(x), mc.cores=2)
> [[1]]
> [1] -0.6564236
> [[2]]
> [1] 0.2981595 -0.9662663 -0.1586778
> [[3]]
> [1] 0.20283018 1.91891067 -0.03065513 -1.25895660 -1.43237050
> [[4]]
> [1] -0.97452271 1.95556392 -0.01407120 -1.45767782 0.83977490 1.20149231
> [7] -0.65395606
> [[5]]
> [1] -0.36855293 0.57518030 -1.52608826 -1.01052287 0.07453356 -1.47265355
> [7] -0.05276850 -0.97598956 -0.43125376
> > mclapply(1:10, function(x)rnorm(x), mc.cores=2)
> list()
> > mclapply(1:10, function(x)rnorm(x), mc.cores=2)
> list()
> > mclapply(1:10, function(x)rnorm(x), mc.cores=2)
> [[1]]
> NULL
> [[2]]
> [1] 0.4338477 -0.2756795
> [[3]]
> NULL
> [[4]]
> [1] -0.08792539 -0.21166520 -0.07175587 -1.44629997
> [[5]]
> NULL
> [[6]]
> [1] -0.11538155 1.47215456 0.12418766 -0.09469826 1.24639136 -2.08412950
> [[7]]
> NULL
> [[8]]
> [1] 0.59884313 -0.69780323 -1.50954506 -0.04156023 0.20434899 -0.59812782
> [7] 0.88432575 -0.41230545
> [[9]]
> NULL
> [[10]]
> [1] -2.2547262 -0.2821773 0.8624573 0.4983850 0.5977264 1.8459354
> [7] -0.8028298 1.0817651 -2.0418556 -0.2725846
> >
> It even fails to generate the correct number of random numbers. How can I
> use this package to do simulations?
>
> On Tue, Aug 11, 2009 at 10:18 PM, <davidr at rhotrading.com> wrote:
>
> > I understand that the support for Windows is experimental,
> > so I thought I'd just try it out.
> > Maybe I don't understand some things.
> > Can someone explain what's going on here?
> > Is this as expected, and what am I doing wrong?
> > (I am on Windows XP SP2, and have 8 cores. SessionInfo below.)
> >
> > > install.packages('multicore',,'http://www.rforge.net/')
> > trying URL
> > 'http://www.rforge.net/bin/windows/contrib/2.9/multicore_0.1-4.zip'
> > Content type 'application/zip' length 90538 bytes (88 Kb)
> > opened URL
> > downloaded 88 Kb
> >
> > package 'multicore' successfully unpacked and MD5 sums checked
> >
> > The downloaded packages are in
> > C:\Documents and Settings\davidr\Local
> > Settings\Temp\Rtmpv52Ozb\downloaded_packages
> > updating HTML package descriptions
> > > library(multicore)
> > > mclapply(1:10, sqrt, mc.cores=1)
> > [[1]]
> > [1] 1
> > [[2]]
> > [1] 1.414214
> > [[3]]
> > [1] 1.732051
> > [[4]]
> > [1] 2
> > [[5]]
> > [1] 2.236068
> > [[6]]
> > [1] 2.449490
> > [[7]]
> > [1] 2.645751
> > [[8]]
> > [1] 2.828427
> > [[9]]
> > [1] 3
> > [[10]]
> > [1] 3.162278
> >
> > > mclapply(1:10, sqrt, mc.cores=2)
> > [[1]]
> > [1] 1
> > [[2]]
> > [1] 1.732051
> > [[3]]
> > [1] 2.236068
> > [[4]]
> > [1] 2.645751
> > [[5]]
> > [1] 3
> >
> > > sessionInfo()
> > R version 2.9.1 (2009-06-26)
> > i386-pc-mingw32
> >
> > locale:
> > LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> > States.1252;LC_MONETARY=English_United
> > States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
> >
> > attached base packages:
> > [1] stats graphics grDevices utils datasets methods base
> >
> >
> > other attached packages:
> > [1] multicore_0.1-4
> >
> > loaded via a namespace (and not attached):
> > [1] tools_2.9.1
> >
> > Thanks for any insight,
> > David L. Reiner
> > Rho Trading Securities, LLC
> >
> >
> >
> > This e-mail and any materials attached hereto, including, without
> > limitation, all content hereof and thereof (collectively, "Rho Content") are
> > confidential and proprietary to Rho Trading Securities, LLC ("Rho") and/or
> > its affiliates, and are protected by intellectual property laws. Without
> > the prior written consent of Rho, the Rho Content may not (i) be disclosed
> > to any third party or (ii) be reproduced or otherwise used by anyone other
> > than current employees of Rho or its affiliates, on behalf of Rho or its
> > affiliates.
> >
> > THE RHO CONTENT IS PROVIDED AS IS, WITHOUT REPRESENTATIONS OR WARRANTIES OF
> > ANY KIND. TO THE MAXIMUM EXTENT PERMISSIBLE UNDER APPLICABLE LAW, RHO
> > HEREBY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS AND IMPLIED, RELATING TO
> > THE RHO CONTENT, AND NEITHER RHO NOR ANY OF ITS AFFILIATES SHALL IN ANY
> > EVENT BE LIABLE FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, INCLUDING, BUT NOT
> > LIMITED TO, DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL AND PUNITIVE DAMAGES,
> > LOSS OF PROFITS AND TRADING LOSSES, RESULTING FROM ANY PERSON'S USE OR
> > RELIANCE UPON, OR INABILITY TO USE, ANY RHO CONTENT, EVEN IF RHO IS ADVISED
> > OF THE POSSIBILITY OF SUCH DAMAGES OR IF SUCH DAMAGES WERE FORESEEABLE.
> >
> > _______________________________________________
> > R-sig-hpc mailing list
> > R-sig-hpc at r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-hpc
> >
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-hpc mailing list
> R-sig-hpc at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc
More information about the R-sig-hpc
mailing list