Displaying 20 results from an estimated 46 matches for "detectcores".
2014 Aug 22
3
parallel::detectCores(TRUE) gives: Error in system(cmd, TRUE) : error in running command
Hi,
Both under the current R-devel (r66456) and a version from about 3
months ago, I experience the following behavior:
> parallel::detectCores(TRUE)
Error in system(cmd, TRUE) : error in running command
> traceback()
3: system(cmd, TRUE)
2: gsub("^ +", "", system(cmd, TRUE)[1])
1: parallel::detectCores(TRUE)
>
This is on Ubuntu 14.04. Does anybody else see this? [I currently have
quite a heavy workload, otherwis...
2018 Aug 17
2
Get Logical processor count correctly whether NUMA is enabled or disabled
Dear R-devel list,
R's detectCores() function internally calls "ncpus" function to get the total number of logical processors. However, this doesnot seem to take NUMA into account on Windows machines.
On a machine having 48 processors (24 cores) in total and windows server 2012 installed, if NUMA is enabled and has 2 node...
2018 Aug 29
2
Get Logical processor count correctly whether NUMA is enabled or disabled
Dear Tomas, thank you very much. I installed r-devel r75201 and tested.
The machine with 88 cores has NUMA disabled. It therefore has 2 processor groups with 64 and 24 processors each.
require(parallel)
detectCores()
# [1] 88
This is great!
Then I went on to test with a simple 'foreach()' loop. I started with 64 processors (max limit of 1 processor group). I ran with a simple function of 0.5s sleep.
require(snow)
require(doSNOW)
require(foreach)
cl <- makeCluster(64L, "SOCK")
register...
2018 Aug 21
2
Get Logical processor count correctly whether NUMA is enabled or disabled
Dear Tomas, thank you for looking into this. Here's the output:
# number of logical processors - what detectCores() should return
out <- system("wmic cpu get numberoflogicalprocessors", intern=TRUE)
[1] "NumberOfLogicalProcessors \r" "22 \r" "22 \r"
[4] "20 \r" "22...
2018 Sep 03
0
Get Logical processor count correctly whether NUMA is enabled or disabled
A summary for reference: the new detectCores() for Windows in R-devel
seems to be working both for logical and physical cores on systems with
>64 logical processors? (thanks to Arun for testing!). If the feature
is important for anyone particularly using an older version of Windows
and/or on a system with >64 logical processors, it...
2018 Aug 27
0
Get Logical processor count correctly whether NUMA is enabled or disabled
Dear Arun,
thank you for checking the workaround scripts.
I've modified detectCores() to use GetLogicalProcessorInformationEx. It
is in revision 75198 of R-devel, could you please test it on your
machines? For a binary, you can wait until the R-devel snapshot build
gets to at least this svn revision.
Thanks for the link to the processor groups documentation. I don't have...
2018 Aug 21
0
Get Logical processor count correctly whether NUMA is enabled or disabled
Dear Arun,
thank you for the report. I agree with the analysis, detectCores() will
only report logical processors in the NUMA group in which R is running.
I don't have a system to test on, could you please check these
workarounds for me on your systems?
# number of logical processors - what detectCores() should return
out <- system("wmic cpu get numberoflo...
2012 Dec 04
2
SUGGESTION: Add get/setCores() to 'parallel' (and command line option --max-cores)
In the 'parallel' package there is detectCores(), which tries its best
to infer the number of cores on the current machine. This is useful
if you wish to utilize the *maximum* number of cores on the machine.
Several are using this to set the number of cores when parallelizing,
sometimes also hardcoded within 3rd-party scripts/package code, but...
2016 Dec 09
1
parallel::detectCores() bug on Raspberry Pi B+
In R 3.3.2 detectCores() in package parallel reports 2 rather than 1 on
Raspberry Pi B+ running Raspbian. (This report is just 'for the record'.
The model is superseded and I think no longer produced.) The problem
seems to be caused by
grep processor /proc/cpuinfo
processor : 0
model name : ARMv6-compatibl...
2023 May 16
1
mclapply enters into an infinite loop....
Dear members,
I am using arfima in an mclapply construction (from the parallel package):
Browse[2]> LYG <- mclapply(LYGH, FUN = arfima, mc.cores = detectCores())
^C
Browse[2]> LYG <- mclapply(LYGH[1:10], FUN = arfima, mc.cores = detectCores())
^C
Browse[2]> LYG <- mclapply(LYGH[1:2], FUN = arfima, mc.cores = detectCores())
^C
You can see that I am aborting the execution of mclapply. It doesn't finish even if I reduce the elements to be i...
2013 Jan 23
3
How to construct a valid seed for l'Ecuyer's method with given .Random.seed?
...eed for l'Ecuyer's rng with
just the information in .Random.seed?
Thanks & Cheers,
Marius
Here is the minimal example:
require(doSNOW)
require(foreach)
doForeach <- function(n, seed=1, type="MPI")
{
## create cluster object
cl <- snow::makeCluster(parallel::detectCores(), type=type)
on.exit(snow::stopCluster(cl)) ## shut down cluster and terminate execution environment
registerDoSNOW(cl) ## register the cluster object with foreach
## seed
if(seed=="L'Ecuyer-CMRG") {
if(!exists(".Random.seed")) stop(".Random.se...
2023 May 17
1
mclapply enters into an infinite loop....
...n try mclapply.
On May 16, 2023 3:10:45 PM PDT, akshay kulkarni <akshay_e4 at hotmail.com> wrote:
>Dear members,
> I am using arfima in an mclapply construction (from the parallel package):
>
>Browse[2]> LYG <- mclapply(LYGH, FUN = arfima, mc.cores = detectCores())
>^C
>Browse[2]> LYG <- mclapply(LYGH[1:10], FUN = arfima, mc.cores = detectCores())
>^C
>Browse[2]> LYG <- mclapply(LYGH[1:2], FUN = arfima, mc.cores = detectCores())
>^C
>
>You can see that I am aborting the execution of mclapply. It doesn't finish even if I...
2018 Feb 10
2
makeCluster hangs
...y, makeCluster() hangs when I run it. I first noticed the
problem when trying to run Rstan with multiple cores and the traced it
back to the core package parallel. The following results in R hanging
after the call to makeCluster.
library(parallel)
# Calculate the number of cores
no_cores <- detectCores() - 1
# Initiate cluster
cl <- makeCluster(no_cores)
I'm running MacOS High Sierra 10.13.3 (17D47) on a MacbookPro 2017
laptop with 4 cores.
platform?????? x86_64-apple-darwin15.6.0
arch?????????? x86_64
os???????????? darwin15.6.0
system???????? x86_64, darwin15.6.0
status
major????????...
2013 Dec 24
2
Parallel computing: how to transmit multiple parameters to a function in parLapply?
...in order to
compute f(x, y) parallelly, I had to define f(x, y) as f(x) and tried to
access y within the function, whereas y was defined outside of f(x).
Script:
library(parallel)
f <- function(x) {
z <- 2 * x + .GlobalEnv$y # Try to access y in the global scope.
return(z)
}
np <- detectCores(logical = FALSE) # Two cores of my laptop
x <- seq(1, 10, by = 1)
y <- 0.5 # Y may be an array in reality.
cl <- makeCluster(np) # initiate the cluster
r <- parLapply(cl, x, f) # apply f to x for parallel computing
stopCluster(cl)
The r was a list with 10 empty elements which mea...
2012 Mar 17
1
parApply vs parCapply
...n parApply returns a matrix?
library(parallel)
x <- matrix(rnorm(8), nc = 2)
apply(x, 2, function(y) y)
[,1] [,2]
[1,] -0.9649685 0.91339851
[2,] -1.4313140 0.13457671
[3,] 1.0499248 1.58967879
[4,] -1.8974411 0.03639876
cl <- makeCluster(getOption("cl.cores", detectCores()))
parApply(cl, x, 2, function(y) y)
[,1] [,2]
[1,] -0.9649685 0.91339851
[2,] -1.4313140 0.13457671
[3,] 1.0499248 1.58967879
[4,] -1.8974411 0.03639876
parCapply(cl, x, function(y) y)
[1] -0.96496852 -1.43131396 1.04992479 -1.89744113 0.91339851 0.13457671
[7] 1.5896787...
2014 Jul 02
1
parLapply on sqlQuery (from package RODBC)
...nameToID<-function(name, dbConn){
#dbConn : active db connection formed via odbcDriverConnect
#name : a char string
sqlQuery(dbConn, paste("select id from table where name='", name, "'", sep=""))
}
mc<-detectCores()
cl<-makeCluster(mc)
clusterExport(cl, c("sqlQuery", "dbConn"))
parSapply(cl, names, nameToID, dbConn=dbConn) #incorrect passing of nameToID's second argument
###
As in the comment, this is not the correct way to assign the second argument to nameToID.
I have also t...
2023 Jul 01
1
Number of Cores limited to two in CRAN
This is the specific error messsage from R CMD check --as-cran
Error in .check_ncores(length(names)) : 16 simultaneous processes spawned
Calls: prepost -> makeCluster -> makePSOCKcluster -> .check_ncores
Execution halted
Thanks,
Ravi
________________________________
From: Ravi Varadhan
Sent: Saturday, July 1, 2023 1:15 PM
To: R-Help <r-help at r-project.org>
Subject: Number
2024 Aug 07
1
Another issue using multi-processing linear algebra libraries
...ns for this. I wonder if R initiates a system environment or options to instruct the packages on the number of cores to use?
It doesn't have to be mandatory for now, but at least package maintainers can have shared consensus and start to adopt this humble settings rather than abusing parallel::detectCores() to max out the number of threads by default.
> On Aug 7, 2024, at 6:00?AM, r-devel-request at r-project.org wrote:
>
>> Would it make sense to add a parameter somewhere, to mclapply(), say,
>> telling R to not use multiprocessing libraries?
>
> It would be great if we...
2018 Feb 11
1
makeCluster hangs
...problem when trying
>> to run Rstan with multiple cores and the traced it back to the core package
>> parallel. The following results in R hanging after the call to makeCluster.
>>
>> library(parallel)
>>
>> # Calculate the number of cores
>> no_cores <- detectCores() - 1
>>
>> # Initiate cluster
>> cl <- makeCluster(no_cores)
>>
>> I'm running MacOS High Sierra 10.13.3 (17D47) on a MacbookPro 2017 laptop
>> with 4 cores.
>>
>> platform x86_64-apple-darwin15.6.0
>> arch x86_64
>>...
2010 Oct 03
4
Programmaticly finding number of processors by R code
Dear List
Sorry if this question seems very basic.
Is there a function to pro grammatically find number of processors in
my system _ I want to pass this as a parameter to snow in some serial
code to parallel code functions
Regards
Ajay
Websites-
http://decisionstats.com
http://dudeofdata.com
Linkedin- www.linkedin.com/in/ajayohri