ok, got it:
library(multicore)
ncore = multicore:::detectCores()



Best regards,

Kaiyin ZHONG
------------------------------
FMB, Erasmus MC
k.zhong@erasmusmc.nl
kindlychung@gmail.com


On Thu, Apr 18, 2013 at 3:13 PM, Jon Olav Skoien <
jon.skoien@jrc.ec.europa.eu> wrote:

> I dont think this has anything to do with the snow package, you should
> rather start by checking what is the output of system('nproc') is on your
> computer, and also whether it is possible to assign this to a variable. I
> tried on a redhat linux (R 2.15.0) server:
>
>
> > ncore = system('nproc')
> 16
> > ncore
> [1] 0
> # the result is printed, not returned
>
>
> Best wishes,
> Jon
>
>
> On 18-Apr-13 10:52, Kaiyin Zhong (Victor Chung) wrote:
>
>> Dear all,
>>
>> I found a strange thing with the snow package.
>>
>> This will work:
>> y = matrix(1:4, 2)
>> cl = makeCluster(rep('localhost', 8), type='SOCK')
>> parMM(cl, y, y)
>>
>> This will not:
>>
>> y = matrix(1:4, 2)
>> ncore = system('nproc')
>> parMM(cl, y, y)
>> Error in cut.default(i, breaks) : invalid number of intervals
>>
>> I also tried:
>> cl = makeCluster(rep('localhost', ncore), type='SOCK')
>> cl = makeCluster(rep('localhost', as.integer(ncore)), type='SOCK')
>>
>> no luck.
>>
>>
>> Could anyone please help? Thanks!
>>
>>
>>
>>
>>
>>
>> Best regards,
>>
>> Kaiyin ZHONG
>> ------------------------------
>>
>> FMB, Erasmus MC
>> k.zhong@erasmusmc.nl
>> kindlychung@gmail.com
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________**________________
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>> PLEASE do read the posting guide http://www.R-project.org/**
>> posting-guide.html <http://www.R-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
> --
> Jon Olav Skøien
> Joint Research Centre - European Commission
> Institute for Environment and Sustainability (IES)
> Land Resource Management Unit
>
> Via Fermi 2749, TP 440,  I-21027 Ispra (VA), ITALY
>
> jon.skoien@jrc.ec.europa.eu
> Tel:  +39 0332 789206
>
> Disclaimer: Views expressed in this email are those of the individual and
> do not necessarily represent official views of the European Commission.
>
>
>

	[[alternative HTML version deleted]]

