Displaying 20 results from an estimated 300 matches similar to: "Set the number of threads using openmp with .Fortran?"
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
2019 Feb 02
0
Set the number of threads using openmp with .Fortran?
I was able to make some progress by using this
<https://github.com/bert9bert/ParallelForest/blob/master/src/Makevars> as a
reference. Now:
*This is my makevars:*
##### Compiler flags #####
PKG_FCFLAGS = $(SHLIB_OPENMP_FFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS)
##### Phony target for R's build system to invoke #####
all: $(SHLIB)
##### Clean target #####
clean:
rm -f *.o *.mod
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 );
2015 Jul 27
2
R package with Fortran module on Windows? undefined reference to `__stack_chk_fail'
Hi,
I created a R library that uses a Fortran module. Everything works like a
charm on linux.
Now I'm trying to make it work on Windows. I cloned my git repository
<https://github.com/ignacio82/MyPi> on a windows computer, and when I press
the build and reload button on Rstudio I get these errors:
==> Rcmd.exe INSTALL --no-multiarch --with-keep.source MyPi
* installing to library
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
2014 Apr 18
2
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
On Fri, Apr 18, 2014 at 11:44 AM, Dmitry Vyukov <dvyukov at google.com> wrote:
> On Fri, Apr 18, 2014 at 11:32 AM, Dmitry Vyukov <dvyukov at google.com>wrote:
>
>> 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
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();
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
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 ::
2024 Oct 14
2
Error in .local(x, ...) invalid layer names
¡Buenas tardes!
Antes de nada, dar las gracias por permitirme participar en esta lista.
Soy un usuario recién llegado a R de la mano del análisis geoespacial. Soy un arqueólogo que se ha topado con un package para R creado por un arqueólogo para la ejecución de procesos para a creación de rutas de menor coste cuyo nombre es leastcostpath y que se encuentra en el repositorio de GitHub. Contiene
2015 May 11
1
Foreach %dopar% operator incorrectly load balancing
Dear R-SIG-Debian,
I am using R version 3.1.2 with rstudio-server 0.98.113 on debian build
3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux.
I often use the %dopar% operator in from the foreach package to run code in
parallel. However, the only other use on the box seemingly installed a few
items and suddenly %dopar% will use far more than the number of cores I am
specifying and
2015 Jul 27
0
R package with Fortran module on Windows? undefined reference to `__stack_chk_fail'
You should be able to set PKG_FCFLAGS="-fno-stack-protector" when
compiling to ensure that the stack protector is not used.
(Trying that out on a Windows VM, with a simple `R CMD build` + `R CMD
INSTALL`, compilation of your package succeeded but linking failed
saying the DLL 'Fpi' was not found; I imagine that's a separate
issue.)
As an aside, be sure to check out what
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();
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
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:
2014 Aug 07
2
How to (appropropriately) use require in a package?
Dear All,
What is the preferred way for Package A, to initialize a cluster, and load
Package B on all nodes?
I am writing a package that parallelizes some functions through the use of
a cluster if useRs are on a Windows machine (using parLapply and family).
I also make use of another package in some of my code, so it is necessary
to load the required packages on each slave once the cluster is
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:
2013 Apr 18
1
snow: cluster initialization
Dear all,
I found a strange thing with the snow package.
This will work:
y = matrix(1:4, 2)
cl = makeCluster(rep('localhost', 8), type='SOCK')
parMM(cl, y, y)
This will not:
y = matrix(1:4, 2)
ncore = system('nproc')
parMM(cl, y, y)
Error in cut.default(i, breaks) : invalid number of intervals
I also tried:
cl = makeCluster(rep('localhost', ncore),
2010 Dec 14
1
How to specify compiler options when using R CMD SHLIB
Hi
I've built a dll using Fortran code and can call it by either R or
Fortran. Calling by the former gives me the wrong answer and the later
gives the correct answer.
>From what I've read, it looks like I should use the subroutines DBLEPR,
INTPR and REALPR to print to the R console rather than using Fortran
standard I/O and that if I use the command
R CMD SHLIB source.f that these