[R-sig-hpc] Loading Fortran subroutine in Rsge?

Hesen Peng hesen.peng at gmail.com
Mon Nov 8 20:53:44 CET 2010


Hello HPC,

I have a function called "haha" which uses an external fortran
subroutine "xixi.so". And I'm trying to use Rsge to parallelize the
execution of some data with haha. Then I run into some problems. I was
using:


dyn.load("xixi.so")
haha <- function(x){
  .Fortran("xixi",x)[[1]]
}

sge.options(sge.save.global=TRUE)
out <- sge.parSapply(1:10, haha,njobs=10)

But the return from each node shows that xixi.so was not included in
the information passed to each node. So I had to include the
dyn.load("xixi.r") in the haha function definition and had it executed
again and again and again (probably millions of times). Is there a
better way than that? Thanks a lot.

Best wishes,

-- 
Hesen Peng



More information about the R-sig-hpc mailing list