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

Dirk Eddelbuettel edd at debian.org
Fri Aug 26 18:05:44 CEST 2011


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

-- 
Two new Rcpp master classes for R and C++ integration scheduled for 
New York (Sep 24) and San Francisco (Oct 8), more details are at
http://dirk.eddelbuettel.com/blog/2011/08/04#rcpp_classes_2011-09_and_2011-10
http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php


More information about the Rcpp-devel mailing list