Dear Vinh, list,

Thanks, this works like a charm.  I first have to find the location of the
.so file in a way that won't depend on the install or working directory, in
case any one else is curious, this was my approach:

    loc <- system.file(package="BranchingTime")
    lib <- paste(loc, "/libs/BranchingTime.so", sep="")
    sfExport("lib")
    sfClusterEval(dyn.load(lib) )

Cheers,

Carl


On Fri, Apr 23, 2010 at 7:13 AM, Vinh Nguyen <vqnguyen@uci.edu> wrote:

> > Dear R-sig-hpc,
> >
> > I am having trouble using sfSapply on a function that calls a C function
> > through the .C interface.  When executing in serial I have no errors, but
> in
> > parallel I have the error that each node cannot find the function called
> by
> > .C
> >
> > i.e. if I have
> >
> > myfn <- function(){  .C("myfunction") }
> >
> > I get the error
> > C symbol name "myfunction" not in load table
> >
> >
> >
> > I use sfExportAll() and sfLibrary(mylibrary) before calling the parallel
> > code.  Thanks so much for your help!
> >
> > Sincerely,
> > Carl
>
> You will also need to do:
> sfClusterEval(.dynload("file.so"))
> to load the shared object in each node.
>
> Vinh
>
> _______________________________________________
> R-sig-hpc mailing list
> R-sig-hpc@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc
>



-- 
Carl Boettiger
Population Biology, UC Davis
http://two.ucdavis.edu/~cboettig

	[[alternative HTML version deleted]]

