Skip to content
Prev 2779 / 10988 Next

[Rcpp-devel] New self-contained OpenMP example (Was: Stack imbalance warning when using Rcpp and OpenMP)

That's what I get with Davor's additions:

edd at max:~/svn/rcpp/pkg/Rcpp/inst/examples/OpenMP$ r OpenMPandInline.r
Loading required package: methods
                    test replications elapsed relative user.self sys.self
2           funOpenMP(z)          100   3.996 1.000000     30.53     0.91
5       funSerialRcpp(z)          100   8.960 2.242242      8.57     0.39
3 funSerialStdAlgRcpp(z)          100   8.975 2.245996      9.39     0.34
6        funSugarRcpp(z)          100   9.225 2.308559      9.00     0.22
4     funSerialStdAlg(z)          100  10.003 2.503253      9.22     0.77
1           funSerial(z)          100  10.092 2.525526      9.42     0.67
edd at max:~/svn/rcpp/pkg/Rcpp/inst/examples/OpenMP$ 

OpenMP still wins in 'elapsed' and using the STL algorithm is good for
marginal gains over manual loops.

Dirk