Skip to content
Back to formatted view

Raw Message

Message-ID: <CAH8E6Uv7P3zXXEaAYFO14jFDx0k6tLqNP7Ex-sv=0eWh1d-0+w@mail.gmail.com>
Date: 2019-07-04T11:21:21Z
From: Elias Carvalho
Subject: [R-pkg-devel] Parallel processing

*I am building a package a package and one of its functions need parallel
procesing.*
*Then I created the function because my final use are not technical:*

create.cluster <-function()
{
  # Calculate the number of cores
  no_cores <-parallel::detectCores() - 1
  # Initiate cluster
  cl <- parallel::makeCluster(no_cores)
  return(cl)
} # create.cluster <-function()

*Then the final use need to execute:*

cl <- create.cluster()
Commands
parallel::stopCluster(cl);

*When preparing my package with "R CMD check --as-cran mypackage" the
following error occurs:*
*Error in .check_ncores(length(names)) : 3 simultaneous processes spawned*
*I know the limit of cores is 2 for package check and my laptop has 4, I
believe this is the error cause.*

*How I would fix this error?*

-- 


*In Jesu et Maria*

*Thank you*
*Prof. Elias Carvalho*

*"Felix, qui potuit rerum cognoscere causas" (Virgil 29 BC)"Blessed is he
who has been able to understand the cause of things"*

	[[alternative HTML version deleted]]