Displaying 3 results from an estimated 3 matches for "openmpcontrol".
2019 Feb 02
1
Set the number of threads using openmp with .Fortran?
...o work on Linux, I modified my R script as follows:
#' OpenMP Hello World
#'
#' @param nthreads The number of threads that you want to use
#' @example
#' hello(nthreads=2)
#' @export
#' @useDynLib helloOpenMP, .registration = TRUE
hello <- function(nthreads=4) {
(OpenMPController::omp_set_num_threads(nthreads))
.Fortran("hello")
return('Each thread will say hi to you!')
}
> hello(nthreads = 2) Hello from 0
Hello from 1
[1] "Each thread will say hi to you!"
Alas, on Windows the same command just returns "Eac...
2019 Feb 01
2
Set the number of threads using openmp with .Fortran?
Hi everybody,
I'm trying to develop an R package with Fortran and OpenMP. I wrote a
simple hello world but I'm not able to set the number of threads. I found this
old email chain
<http://r.789695.n4.nabble.com/Set-the-number-of-threads-using-openmp-with-C-td2284685.html>
and
I tried to set my compile instructions accordingly but i had no luck.
*This is my makevars:*
2013 May 24
0
Rcpp with OpenMP - Need example Makevars
Dear R experts,
recently I started developing a Rcpp package "OpenMPTest".
Within that package I want to use OpenMP, as in the following code example:
// header file
#include <omp.h>
using namespace Rcpp ;
RcppExport SEXP testOpenMP( SEXP nThreads ) ;
// cpp file
SEXP testOpenMP( SEXP nThreads ) {
BEGIN_RCPP
NumericVector numberThreads = NumericVector( nThreads );