Questions tagged [rcppparallel]

RcppParallel provides a system for R programmers to easily develop portable parallel algorithms.

The RcppParallel homepage contains usage instructions and examples.

53 questions
0
votes
1 answer

How do I resolve compile error in RcppParallel function which points to an RcppParallel header file

I'm trying to speed up numeric computation in my R code using RcppParallel and am attempting to edit an example that uses the Cpp sqrt() function to take the square root of each element of a matrix. My edited code replaces matrices with vectors and…
Nate Lockwood
  • 3,325
  • 6
  • 28
  • 34
0
votes
0 answers

How to iterate a List in parallel with RcppParallel?

One of my inputs is a List of NumericVector. If I declare this as I would with regular (non paralllel) Rcpp code, I get a correct result at the end, but with the stack imbalance warnings. Warning: stack imbalance in '.Call', 18 then 35 Warning:…
Chechy Levas
  • 2,206
  • 1
  • 13
  • 28
0
votes
0 answers

Rscript execution error when installing RcppParallel on cluster

I tried to install the package RcppParallel on a cluster but encountered the error below. Content type 'application/x-gzip' length 1967672 bytes (1.9 MB) ================================================== downloaded 1.9 MB * installing *source*…
Zoey
  • 1
0
votes
1 answer

Why does my RcppParallel implementation of a user-defined function crash unexpectedly?

I have developed a dual chain markov monte carlo model designed to forecast loan portfolios in the excellent package Rcpp but have run into an issue trying to implement a parallelised version of these functions with RcppParallel. I have based my…
0
votes
2 answers

Add RcppParallel requisites to the NAMESPACE of an R package automatically when compiling the package

I'm using RcppParallel in my own R package. I know that I need to add Imports: RcppParallel to the DESCRIPTION file and importFrom(RcppParallel, RcppParallelLibs) to the NAMESPACE file. My current workflow to compile my R package is: run…
Ding Li
  • 673
  • 1
  • 7
  • 19
0
votes
0 answers

Having installation issues with RcppParallel ( R)

I am a newbie/student to rstanarm and I having issues installing RcppParallel. I have tried devtools::install_github("RcppCore/RcppParallel") and install.packages("RcppParallel", dependencies = TRUE) and I am still getting non-zero errors. Any help…
0
votes
0 answers

RcppParallel using References in workers

I have been experiment with using references for speed improvements. The (not working) trivial example below, probably won't see any improvements. However, I think by not copying the data into a separate (cost) function, should save some time for a…
skatz
  • 115
  • 7
0
votes
0 answers

How to debug persistent perfomance issues with RcppParallel

I have have c++ code in which I parallelize some Monte Carlo Simulations using Rcpp and RcppParallel's parallelFor. The execution is, as expected, much faster then when using a non-parallel loop. However, after running the code for a night or two,…
sheß
  • 484
  • 4
  • 20
0
votes
1 answer

RcppParallel worker with additional arguments

This is my first try with the RcppParallel package and I have to work with C++17 (Ubuntu) I tried to stay close to the ParallelFor example of the developers site, but I need an additional (non-iterative) argument for the worker threshold. This is…
Daniel R
  • 57
  • 5
0
votes
0 answers

Inconsistent results between dqrng and R API for PRNG in RCPP

I am attempting to implement a particle filter within Rcpp and use OpenMP to parallelise the transition step. I am using dqrng to create threadsafe RNG with using the boost distribution functions as per here. The code for the R API can be found here…
proverIdr
  • 13
  • 3
0
votes
0 answers

R session aborted using RcppParallel

I'm trying to build an R package implementing Dijkstra algorithm using Rcpp and RcppParallel. You can see my work here. Now I want to add a new function and a strange behavior appears. When I compile this function via sourceCpp function and try it,…
vlarmet
  • 71
  • 1
  • 3
0
votes
1 answer

RcppParallel result changes with multiple threads

I'm new to Rcpp and RcppParallel. I'm trying to use RcppParallel to optimize my R code and now I'm making some toy codes for studying them. Now I made a RcppParallel code and the result is different from what I thought. Result changes whenever I try…
vicent
  • 3
  • 1
0
votes
0 answers

convert RMatrix::Column to a NumericVector

How do you convet an RMatrix::Column to a NumericVector in RcppParallel? e.g. // [[Rcpp::depends(RcppParallel)]] // [[Rcpp::plugins("cpp11")]] #include #include a = RMatrix(4,5,1.0); RMatrix::Column a0 =…
cmo
  • 3,762
  • 4
  • 36
  • 64
0
votes
1 answer

Adding function pointers to Parallel Worker

Building off the example here Parallel Worker in namespace, I would like to employ function pointers with the Parallel Worker. The code below produces an error along the lines of: "cannot initialize a new value of type (**) with a return value of…
skatz
  • 115
  • 7
0
votes
2 answers

Parallel Worker in namespace

This example is a follow up example from this earlier post. I am trying to move the Parallel Worker to its own cpp file and and declare it in the header file. Calling 'mypackage' function within public worker The two errors are as follows: 1)…
skatz
  • 115
  • 7