Displaying 20 results from an estimated 200 matches similar to: "Rcpp with OpenMP - Need example Makevars"
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:*
2019 Feb 02
1
Set the number of threads using openmp with .Fortran?
I got this to work on Linux but it is not working on Windows. *My
understanding is that this should also work on windows, is that correct?*
If so, what should I do? differently?
To get it to 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
2010 Jul 10
1
Set the number of threads using openmp with .C
Hi everybody! Could somebody help me with the following?
I'm trying to run a simple Hello World code in openmp using .C function. The
C code i have is:
#include <omp.h>
#include <stdio.h>
#include <R.h>
void hello_omp(int *n) {
int th_id, nthreads;
omp_set_num_threads(*n);
#pragma omp parallel private(th_id)
{
th_id = omp_get_thread_num();
2013 Jun 08
2
Compile error with gfortran-4.6
Dears,
I am writing a code in Fortran using OpenMP directives.
When compiling the code in gfortran 4.4 does not occur any problem.
When compiling the code in gfortran 4.6, an error message appears.
In other compilers the error does not occur.
A small example.
## Code in Fortran
subroutine hello()
implicit none
integer :: nthreads, tid
integer ::
2015 Dec 02
2
clang only spawns one thread
Hi,
I am using LLVM 3.6.1 to test the following code:
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
int tid, nthreads;
#pragma omp parallel sections private(nthreads, tid)
{
#pragma omp section
{
tid = omp_get_thread_num();
printf("Hello, tid = %d\n ", tid);
}
#pragma omp section
{
tid = omp_get_thread_num();
2020 Oct 08
1
Installing package fails at "testing if installed package can be loaded from temporary location"
Dirk, thank you a thousand times.
Indeed, src/Makevars was wrong. I modified Makevars so that now looks like
the below and the package now compiled and linked properly.
CXX_STD = CXX11
PKG_LIBS += $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
$(shell ${R_HOME}/bin/Rscript -e "RcppParallel::RcppParallelLibs()")
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -I../inst/include
2014 Sep 26
1
Why is my R package still compiling with the O2 flag?
When I install an R package with cpp codes such as rrcov via CRAN (under
R 3.1.1, using no Makevars file and under Ubuntu 14.04 using GCC 4.8),
the cpp code is compiled with the -o3 flag (in fact, looking at the
Makeconf file this seem to again be the default since R 3.1.1) But when
I install my own package via CRAN it is compiled with the -o2 flag.
My questions are what is causing my
2007 Oct 08
16
Fileserver performance tests
Hi all,
i want to replace a bunch of Apple Xserves with Xraids and HFS+ (brr) by Sun x4200 with SAS-Jbods and ZFS. The application will be the Helios UB+ fileserver suite.
I installed the latest Solaris 10 on a x4200 with 8gig of ram and two Sun SAS controllers, attached two sas-jbods with 8 SATA-HDDs each und created a zfs pool as a raid 10 by doing something like the following:
[i]zpool create
2020 Oct 08
3
Installing package fails at "testing if installed package can be loaded from temporary location"
Hi,
I can not install packages from source which links to RcppArmadillo on
Ubuntu 20.04 (after upgrading from 18.04). The following problem occurs:
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for 'myPackage' in
dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object
2011 Aug 29
3
How to safely using OpenMP pragma inside a .C() function?
I am trying to parallelize part of a C function that is called from R (via
.C) using OpenMP's "parallel for" pragma. I get mixed results: some runs
finish with no problem, but some lead to R crashing after issuing a long
error message involving memory violations.
I found this post, which describes how a .Call() function can be made to
avoid crashing R by raising the stack limit:
2019 Nov 19
2
Why is matrix product slower when matrix has very small values?
Hi,
I experience surprisingly large timing differences for the
multiplication of matrices of the same dimension. An example is given
below. How can this be explained?
I posted the question on Stackoverflow:
https://stackoverflow.com/questions/58886111/r-why-is-matrix-product-slower-when-matrix-has-very-small-values
Somebody could reproduce the behavior but I did not get any useful
explanations
2015 Oct 11
2
How to add NOP?
Can you send the IR you are using?
Volkan
On Thu, Oct 8, 2015 at 6:28 AM Erdem Derebaşoğlu <
erdemderebasoglu at hotmail.com> wrote:
> Thanks. I enabled my pass. I have one resolved issue though:
> MachineMemOperand::getAddrSpace() always returns zero. How can I use it to
> distinguish private memory accesses?
>
> Erdem
>
> ------------------------------
> From:
2018 Jan 10
5
OpenBLAS in everyday R?
I didn't do the compile; is there a way to check whether that was used?
If not, I'll inquire with our sysadmin and report back.
In any case, my suggestion was motivated by the fact that some parts of
R use OpenMP while others do not, in the hope that the former could have
their OpenBLAS omelet without breaking the OpenMP eggs, so to speak.
On 01/09/2018 06:41 PM, Keith O'Hara
2018 Jan 09
2
OpenBLAS in everyday R?
Please pardon my ignorance, but doesn't OpenBLAS still not always play
nicely with multi-threaded OpenMP? (for example, don't race conditions
sometimes crop up)? If so, it might be nice to have the ability to
temporarily disable multi-threaded OpenMP (effectively:
omp_set_num_threads(1)) for the duration of operations using OpenBLAS.
Regards
Ben
> Julia using OpenBLAS is *very*
2014 Apr 18
4
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
On Apr 17, 2014, at 2:04 PM, Chandler Carruth <chandlerc at google.com> wrote:
> On Thu, Apr 17, 2014 at 1:27 PM, Justin Bogner <mail at justinbogner.com> wrote:
> Chandler Carruth <chandlerc at google.com> writes:
> > if (thread-ID != main's thread-ID && shard_count < std::min(MAX, NUMBER_OF_CORES)) {
> > shard_count = std::min(MAX,
2013 Jun 08
0
Compile error gfortran-4.6
Dears,
I am writing a code in Fortran using OpenMP directives.
When compiling the code in gfortran 4.4 does not occur any problem.
When compiling the code in gfortran 4.6, an error message appears.
In other compilers the error does not occur.
A small example.
## Code in Fortran
subroutine hello()
implicit none
integer :: nthreads, tid
integer ::
2010 Mar 02
9
Filebench Performance is weird
Greeting All
I am using Filebench benchmark in an "Interactive mode" to test ZFS
performance with randomread wordload.
My Filebench setting & run results are as follwos
------------------------------------------------------------------------------------------
filebench> set $filesize=5g
filebench> set $dir=/hdd/fs32k
filebench> set $iosize=32k
filebench> set
2014 Apr 18
2
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
On Fri, Apr 18, 2014 at 11:13 AM, Dmitry Vyukov <dvyukov at google.com> wrote:
> Hi,
>
> This is long thread, so I will combine several comments into single email.
>
>
> >> - 8-bit per-thread counters, dumping into central counters on overflow.
> >The overflow will happen very quickly with 8bit counter.
>
> Yes, but it reduces contention by 256x (a thread
2018 Jan 11
2
OpenBLAS in everyday R?
Thanks Keith. We checked, and indeed libopenblas is not linked against
libomp nor libgomp. We suspect this is because we used conda to install
R and OpenBLAS. So I guess we should be barking up the conda tree instead?
By the way, I also noticed on my home machine (Ubuntu),
/usr/lib/libopenblas.so.0 is also not linked against those, for what
that's worth.
Regards,
Ben
On 01/10/2018 12:04
2013 May 14
2
invalid operands of types ‘SEXPREC*’ and ‘R_len_t’ to binary ‘operator/’ with Rcpp.
Dear R-Developers,
I just started learning how to use Rcpp. Earlier while using it, I
encountered an error as shown below:
file74d8254b96d4.cpp: In function ‘Rcpp::NumericVector
foo(Rcpp::NumericVector, Rcpp::NumericVector, Rcpp::NumericVector,
Rcpp::Function, Rcpp::Function)’:
file74d8254b96d4.cpp:10: error: invalid operands of types ‘SEXPREC*’ and
‘R_len_t’ to binary ‘operator/’
make: ***