You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Team, we are trying to leverate BatchJobs to submit mpi job to job scheduler. After a bit investigation/enhancement, we tested below approach on OpenLava job scheduler. we want to get some inputs from the team.
R script that submit a Rmpi job using BatchJobs:
library(BatchJobs)
conf = BatchJobs:::getBatchJobsConf()
conf$cluster.functions = makeClusterFunctionsOpenLava("/home/clusteradmin/rmpi.tmpl")
reg = makeRegistry(id = "RMPIJobsExample")
f = function(x) {
library("Rmpi")
…
mpi.spawn.Rslaves(nslaves=slaveno)
…
mpi.remote.exec(paste("I am",mpi.comm.rank(),"of",mpi.comm.size()))
…
}
batchMap(reg, f, 1) specify 1 Rmpi job
submitJobs(reg, np=2) specify number of processors to use
showStatus(reg)
waitForJobs(reg)
showStatus(reg)
the job template: rmpi.tmpl
/opt/openlava/bin/openmpi-mpirun -np 1 R CMD BATCH "<%= rscript %>"
we did a bit code change like below
3.1 R/submitJobs.R
added one more parameter "np" to submitJobs() method. and pass the parameter when call submitJob.
Hi Team, we are trying to leverate BatchJobs to submit mpi job to job scheduler. After a bit investigation/enhancement, we tested below approach on OpenLava job scheduler. we want to get some inputs from the team.
library(BatchJobs)
conf = BatchJobs:::getBatchJobsConf()
conf$cluster.functions = makeClusterFunctionsOpenLava("/home/clusteradmin/rmpi.tmpl")
reg = makeRegistry(id = "RMPIJobsExample")
f = function(x) {
library("Rmpi")
…
mpi.spawn.Rslaves(nslaves=slaveno)
…
mpi.remote.exec(paste("I am",mpi.comm.rank(),"of",mpi.comm.size()))
…
}
batchMap(reg, f, 1) specify 1 Rmpi job
submitJobs(reg, np=2) specify number of processors to use
showStatus(reg)
waitForJobs(reg)
showStatus(reg)
/opt/openlava/bin/openmpi-mpirun -np 1 R CMD BATCH "<%= rscript %>"
3.1 R/submitJobs.R
added one more parameter "np" to submitJobs() method. and pass the parameter when call submitJob.
67c67
< job.delay = FALSE, progressbar = TRUE, np = 1L) {
3.2 R/clusterFunctionsOpenLava.R
add one more parameter to submitJob(). if it is more than 1, give args "-n np" to bsub when call runOSCommandLinux.
33c33
< submitJob = function(conf, reg, job.name, rscript, log.file, job.dir, resources, arrayjobs, np = 1L) {
What we want to get your input are if this makes sense and if this change would break existing features?
thank you!
Feng Li
Teraproc
The text was updated successfully, but these errors were encountered: