hello all 
 
 
i am busy testing some code that will be used for parallel computations
on a Moab cluster. I have written a C++ program and am linking it with R
using the .C command - this works correctly.
 
Extracts of the r code (as well as the *.sh file) is included below. I
am able to run the code successfully if I remove all of the doMPI
commands. i.e. outs=.C("prog1", all of the args )
 executes correctly if one uses a loop. When I try and use doMPI i get
the following errors:
 
 
Error in { : task 1 failed - "C symbol name "prog1" not in load table"
Calls: %dopar% -> <Anonymous>

 
 
eg.r code
----------------------------------------------------------------------------------------------------
 
 library(doMPI)
 
 cl <- startMPIcluster(count=2)    #this will be changed later
 registerDoMPI(cl)
 
 #the input parameters!
 ...

 #some vecs and matrices for the C program
  
  ...
 
 #load the C code
  dyn.load("/export/home/example/Runs/eg.so")
  
  Est_Results<-foreach(data_iter = 1:nsamp, .combine="cbind",
.inorder=TRUE ) %dopar% 
  {

       outs=.C("prog1", all of the args )
                  
       do more things
 
       return( some things)
  }

  dyn.unload("/export/home/example/Runs/eg.so")
 
  closeCluster(cl)
  save.image("/export/home/example/Runs/eg.RData")
 
 mpi.quit(save = "no") 
----------------------------------------------------------------------------------------------------
 
 
 
eg.sh code
----------------------------------------------------------------------------------------------------
 
#MSUB -l nodes=1:ppn=1
#MSUB -l walltime=100:00:00
#MSUB -m be
#MSUB -V
#MSUB -o /export/home/example/Runs/eg.out
#MSUB -e /export/home/example/Runs/eg.err
#MSUB -d /export/home/example/Runs
 
mpirun --mca mpi_warn_on_fork 0 -np 1 /export/home/R-2.12.1/bin/R
--slave -f /export/home/example/Runs/eg.r 
echo "DONE multiple run!"
----------------------------------------------------------------------------------------------------
 
 
 


 

###
UNIVERSITY OF CAPE TOWN 

This e-mail is subject to the UCT ICT policies and e-mai...{{dropped:16}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to