User:Carl Boettiger/Notebook/Comparative Phylogenetics/2010/04/22

{| width="800"
 * style="background-color: #EEE"|[[Image:owwnotebook_icon.png|128px]] Comparative Phylogenetics
 * style="background-color: #F2F2F2" align="center"|  |Main project page
 * style="background-color: #F2F2F2" align="center"|  |Main project page


 * colspan="2"|
 * colspan="2"|

compiling with R and C and parallel computing

 * Problem: cannot get the R code to take advantage of parallelization via openMP.

C++ file mangles names in .so, changing the .C call. to get the object name: Carl Boettiger 03:01, 25 May 2010 (EDT): More standard solution: enclose cpp code in extern C {
 * Solution:


 * Problem:  Trouble getting R to export the C library to all nodes.  (Sol'n thanks to Vinh on R-sig-hpc!)
 * Also, locating the .so file in a way that is independent of package installation, needs to find the package install. (Sol'n thanks to Vince on statcompsci).  (Updated on 2010-04-23).
 * Solution: 


 * Problem Random number generator needs to be specified above the parallel computation loop. Easy to do in C, but won't work for R where the random number generator is from GSL but the parallelization is at the R level.  Will need to figure out how to generate different random seeds on each thread and pass that down to the C code...

Now R generates and passes a random seed to the C function. (2010-04-23).
 * Solution:

Git Log

 * }