Permalink
Browse files

profiler

  • Loading branch information...
1 parent 49697b7 commit 70e7c530b879c342024b7a093f93447ac31cf4d3 @kaskr committed Jan 11, 2014
Showing with 21 additions and 1 deletion.
  1. +4 −1 tmb_examples/Makefile
  2. +7 −0 tmb_examples/README.md
  3. +10 −0 tmb_examples/profiler.R
View
@@ -10,4 +10,7 @@ report: $(outputfiles)
R --vanilla < unittest.R
clean :
- rm -f *.o *.so *~ core *.output.RData Rplots.pdf
+ rm -rf *.o *.so *~ core *.output.RData Rplots.pdf *.profile
+
+%.profile : %.R %.cpp
+ example=$(basename $<) R --vanilla < profiler.R
View
@@ -127,3 +127,10 @@ Result details:
rw_sparse 1.993961e-13
socatt 0.000000e+00
spatial 0.000000e+00
+
+Profiling:
+----------
+Examples can be profiled using intel vtune. To profile e.g. example "spatial" run
+* make spatial.profile
+This requires "amplxe-cl" on your path. Then view the profile with
+* amplxe-gui spatial.profile/spatial.profile.amplxe
View
@@ -0,0 +1,10 @@
+## ===============================================================
+## Profile using intels vtune application
+## Script input
+## example: Name of example.
+example <- Sys.getenv("example")
+## ===============================================================
+
+Rexe <- paste(Sys.getenv("R_HOME"),"bin/exec/R",sep="/")
+cmd <- paste("amplxe-cl -collect hotspots -result-dir ",example,".profile"," -- ",Rexe," --vanilla < ",example,".R",sep="")
+system(cmd)

0 comments on commit 70e7c53

Please sign in to comment.