Skip to content

Commit a054c57

Browse files
committed
work on package docs
1 parent 5319a4f commit a054c57

File tree

6 files changed

+102
-27
lines changed

6 files changed

+102
-27
lines changed

DESCRIPTION

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ Package: RcppParallel
22
Type: Package
33
Title: Parallel programming tools for Rcpp
44
Version: 4.2.5
5-
Date: 2014-06-28
6-
Author: RStudio, Inc.; Intel, Inc.
5+
Date: 2014-07-08
6+
Author: RStudio, Inc.; Intel, Inc.; Marcus Geelnard
77
Copyright: RStudio, Inc.
88
Maintainer: JJ Allaire <jj@rstudio.com>
9-
Description: Parallel programming tools for Rcpp
9+
Description: High level functions for doing parallel programming with Rcpp.
10+
For example, the parallelFor function can be used to convert the work of
11+
a standard serial "for" loop into a parallel one and the parallelReduce
12+
function can be used for accumulating aggregate or other values.
1013
SystemRequirements: GNU make
1114
License: GPL-2
1215
Collate:

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TBB 4.2.5
1+
RcppParallel 4.2.5
22
------------------------------------------------------------------------
33

44
* Initial release

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
## RcppParallel Package
2+
3+
High level functions for doing parallel programming with Rcpp. For example, the `parallelFor` function can be used to convert the work of a standard serial "for" loop into a parallel one and the `parallelReduce` function can be used for accumulating aggregate or other values.
4+
5+
The high level interface enables safe and robust parallel programming without direct manipulation of operating system threads. The underlying implementation differs by platform: on Linux and Mac systems the [Intel TBB](https://www.threadingbuildingblocks.org/) (Threading Building Blocks) are used while on Windows systems the [TinyThread](http://tinythreadpp.bitsnbites.eu/) library is used.
6+
7+
### Examples
8+
9+
Here are links to three examples that illustrate using RcppParallel:
10+
11+
[Parallel Matrix Transform](inst/examples/parallel-matrix-transform.cpp) --- Demonstrates using `parallelFor` to transform a matrix (take the square root of each element) in parallel. In this example the parallel version performs about 2.5x faster than the serial version on a 4-core machine.
12+
13+
[Parallel Vector Sum](inst/examples/parallel-vector-sum.cpp) --- Demonstrates using `parallelReduce` to take the sum of a vector in parallel. In this example the parallel version performs 4x faster than the serial version on a 4-core machine.
14+
15+
[Parallel Inner Product](inst/examples/parallel-inner-product.cpp) --- Demonstrates using `parallelReduce` to compute the inner product of two vectors in parallel. In this example the parallel version performs 2.5x faster than the serial version on a 4-core machine.
16+
17+
Note that the benchmark times above are for the TBB back-end (Posix systems only). Performance on Windows is about 30% slower.
18+
19+
### Usage
20+
21+
You can install the RcppParallel package from GitHub as follows:
22+
23+
```s
24+
devtools::install_github("jjallaire/RcppParallel")
25+
```
26+
27+
#### sourceCpp
28+
29+
You can use the RcppParallel library from within a standalone C++ source file as follows:
30+
31+
```cpp
32+
// [[Rcpp::depends(RcppParallel)]]
33+
#include <RcppParallel.h>
34+
```
35+
36+
#### Packages
37+
38+
If you want to use RcppParallel from within an R package you add the following to your DESCRIPTION file:
39+
40+
```yaml
41+
Imports: RcppParallel
42+
LinkingTo: RcppParallel
43+
```
44+
45+
And the following to your NAMESPACE file:
46+
47+
```s
48+
import(RcppParallel)
49+
```
50+
51+
### License
52+
53+
The RcppParallel package is made available under the [GPLv2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
54+
55+
The TinyThread library is licensed under the [zlib/libpng](http://www.opensource.org/licenses/zlib-license.php) license as described [here](https://gitorious.org/tinythread/tinythreadpp/source/master:README.txt).
56+
57+
The Intel TBB Library is licensed under the GPLv2 (as described at https://www.threadingbuildingblocks.org/Licensing):
58+
59+
TBB and other open-source software available from this site is licensed under GPLv2 with the (libstdc++) runtime exception. Specifically, the TBB open-source license is the same license used by the GNU libstdc++ library in gcc 4.2.1 (and earlier). For a complete description of the license, please visit the official GNU website for [GPLv2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) and for the [runtime exception](https://www.threadingbuildingblocks.org/licensing#runtime-exception).
60+
61+
**Runtime Exception**
62+
63+
```
64+
As a special exception, you may use this file as part of a free software
65+
library without restriction. Specifically, if other files instantiate
66+
templates or use macros or inline functions from this file, or you compile
67+
this file and link it with other files to produce an executable, this
68+
file does not by itself cause the resulting executable to be covered by
69+
the GNU General Public License. This exception does not however
70+
invalidate any other reasons why the executable file might be covered by
71+
the GNU General Public License.
72+
```
73+

man/RcppParallel-package.Rd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
\docType{package}
2+
\name{RcppParallel-package}
3+
\alias{RcppParallel}
4+
\alias{RcppParallel-package}
5+
\title{Parallel programming tools for Rcpp}
6+
\description{
7+
High level functions for doing parallel programming with Rcpp.
8+
For example, the parallelFor function can be used to convert the work of
9+
a standard serial "for" loop into a parallel one and the parallelReduce
10+
function can be used for accumulating aggregate or other values.
11+
}
12+
\author{
13+
JJ Allaire \email{jj@rstudio.com}
14+
}
15+
\keyword{package}
16+

man/setThreadOptions.Rd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
\alias{setThreadOptions}
33
\alias{defaultNumThreads}
44
\title{
5-
Thread options for TBB
5+
Thread options for RcppParallel
66
}
77
\description{
88
Set thread options (number of threads to use for task scheduling and stack
9-
size per-thread) for TBB.
9+
size per-thread) for RcppParallel.
1010
}
1111
\usage{
1212
setThreadOptions(numThreads = "auto",
@@ -22,18 +22,19 @@ defaultNumThreads()
2222
\item{stackSize}{
2323
Stack size (in bytes) to use for worker threads. The
2424
default used for "auto" is 2MB on 32-bit systems and
25-
4MB on 64-bit systems.
25+
4MB on 64-bit systems (note that this parameter has
26+
no effect on Windows).
2627
}
2728
}
2829
\details{
29-
The TBB library is automatically initialized with the default number
30+
RcppParallel is automatically initialized with the default number
3031
of threads and thread stack size when it loads. You can call
3132
\code{setThreadOptions} at any time to change the defaults.
3233
}
3334

3435
\value{
3536
The \code{defaultNumThreads} returns the default number of threads
36-
that are used by TBB if another value isn't specified using
37+
that are used by RcppParallel if another value isn't specified using
3738
\code{setThreadOptions}.
3839
}
3940

man/tbb-package.Rd

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)