Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 6d4a2731f57e7b9d593662bc4dfb3763145ab376 authored by Revolution Analytics on 13 February 2014, 00:00:00 UTC, committed by Gabor Csardi on 13 February 2014, 00:00:00 UTC
version 1.0.7
1 parent e2f88b9
  • Files
  • Changes
  • 57c9476
  • /
  • man
  • /
  • registerDoParallel.Rd
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:6d4a2731f57e7b9d593662bc4dfb3763145ab376
directory badge
swh:1:dir:58a54dd306016507d4c20fd1b8db03f892f4a3e5
content badge
swh:1:cnt:09e505c4593e967f63db1bea22112192b7ef9f29

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
registerDoParallel.Rd
\name{registerDoParallel}
\alias{registerDoParallel}
\alias{stopImplicitCluster}
\title{registerDoParallel}
\description{
The \code{registerDoParallel} function is used to register the 
parallel backend with the \code{foreach} package.
}
\usage{
registerDoParallel(cl, cores=NULL, \dots)
stopImplicitCluster()
}
\arguments{
  \item{cl}{A cluster object as returned by \code{makeCluster}, or the number
  of nodes to be created in the cluster. If not specified, on Windows a 
  three worker cluster is created and used.}
  \item{cores}{The number of cores to use for parallel execution. If not
  specified, the number of cores is set to the value of 
  \code{options("cores")}, if specified, or to one-half the number of cores detected
  by the \code{parallel} package.}
  \item{\dots}{Package options.  Currently, only the \code{nocompile} option
  is supported.  If \code{nocompile} is set to \code{TRUE}, compiler
  support is disabled.}
}
\details{
The \code{parallel} package from R 2.14.0 and later provides functions for 
parallel execution of R code on machines with multiple cores or processors 
or multiple computers.  It is essentially a blend of the \code{snow} and 
\code{multicore} packages. By default, the \code{doParallel} package uses 
\code{snow}-like functionality.  The \code{snow}-like functionality
should work fine on Unix-like systems, but the \code{multicore}-like 
functionality is limited to a single sequential worker on Windows systems.
On workstations with multiple cores running Unix-like operating systems, 
the system \code{fork} call is used to spawn copies of the current process. 

The \code{doParallel} backend supports both multicore and snow options passed
through the \code{foreach} function. 
The supported multicore options are \code{preschedule}, \code{set.seed},
\code{silent}, and \code{cores}, which are analogous to the similarly named 
arguments to \code{\link{mclapply}}, and are passed using the
\code{.options.multicore} argument to \code{foreach}. The supported snow options are 
\code{preschedule}, which like its multicore analog can be used to chunk the 
tasks so that each worker gets a prescheduled chunk of tasks, and 
\code{attachExportEnv}, which can be used to attach the export environment
in certain cases where R's lexical scoping is unable to find a needed
export. The snow options are passed to \code{foreach} using the \code{.options.snow}
argument.

The function \code{stopImplicitCluster} can be used in vignettes and other places
where it is important to explicitly close the implicitly created cluster.
}
\examples{
cl <- makePSOCKcluster(2)
registerDoParallel(cl)
m <- matrix(rnorm(9), 3, 3)
foreach(i=1:nrow(m), .combine=rbind) %dopar%  (m[i,] / mean(m[i,]))
stopCluster(cl)
}
\keyword{utilities}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API