Skip to content

parallel optimization for common operators like +, sum and many others #2919

@jangorecki

Description

@jangorecki

We can use openmp to parallelize some common aggregations like sum.
It has to play nice with gforce optimization, which makes it a little bit more tricky to do than implementation shown below.
It can give nice speed up, on rnorm(1e9)

> system.time(a1<-sum(x))
   user  system elapsed 
  1.263   0.040   1.304 
> system.time(a2<-fsum(x))
   user  system elapsed 
  9.382   0.009   0.343 

and roundoff

> format(a1-a2,scientific=F)
[1] "0.000000000003637979"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions