HPCC How to run grid jobs on TechGrid using

advertisement
HPCC
How to run grid jobs on TechGrid using
Condor:Advanced Grid Job Submission with R
High Performance Computing Center
Texas Tech University
HPCC
2
Table of Contents
1.
Pre-requisite.......................................................................................................................................... 3
2.
Grid enabling R ...................................................................................................................................... 3
3.
Description of R files ............................................................................................................................. 3
4.
Logging in .............................................................................................................................................. 4
5.
Preparing a grid job with R.................................................................................................................... 5
6.
Running a single run grid job with R ..................................................................................................... 6
7.
Check your Work ................................................................................................................................... 6
8.
Output ................................................................................................................................................... 7
http://www.hpcc.ttu.edu
HPCC
3
1. Pre-requisite
Condor has to be installed before doing any job submission with R.
2. Grid enabling R
a. Install R locally on your PC
b. Copy and capture R executable environment using WinZip to compress the following directory:
C:\Program Files\R
c. Create a batch file that will remotely unzip R executable environment and launch R macro.
3. Description of R files
a. di2.txt
##--------------------------------------------------------------------------------##
##
Estimates double integrals using montecarlo integration ##
##
Yazeed Al-Hiyari
##
##-------------------------------------------------------------------------------##
install.packages("scatterplot3d", dependencies = TRUE, repos =
"http://cran.cnr.berkeley.edu/") require(scatterplot3d)
funct <- function(x , y){
f <- 4-x^2-y^2
##function to be evalutated
}
n=10
## number of Intervals
a=0
## range for first integral
b=5/4
c=0
##range of second integral
d=5/4
uni_rand_x <- runif(n, min=a, max=b) ## generate random numbers for x
uni_rand_y <- runif(n, min=c, max=d) ## generate random numbers for y
data <- funct(uni_rand_x, uni_rand_y);
average <- mean(data)
## average the function
est_funct <- (b-a)*(d-c)*average
## get function estimate value
for(gg in 1:5){
crgb <- rgb(data, uni_rand_y, uni_rand_x, maxColorValue = 4)
tmp <- paste(c(gg, ".jpg"), collapse = "")
png(tmp)
scatterplot3d(uni_rand_x, uni_rand_y, data, pch=20, crgb , angle=gg)
dev.off()
}
write(est_funct, file = "data111.txt", append = FALSE)## output function evaluation to file
est_funct
## output function evaluation to screen
http://www.hpcc.ttu.edu
HPCC
4
b. R2.bat
unzip -qqo R.zip
R\R-2.5.0\bin\Rcmd BATCH di2.txt
c. R.zip
d. unzip.exe
4. Logging in
a. Go to the “start button”
b. Go to “run” button
http://www.hpcc.ttu.edu
HPCC
5
c. Type “cmd” and press Enter key on keyboard.
d. At DOS prompt, type: C:\> condor_store_cred add
*Use your eRaider password when it asks for your password*
5. Preparing a grid job with R
a.
b.
c.
d.
e.
f.
Copy all input files in the same work directory
Ex: di2.txt, R2.bat, R.zip, unzip.exe
Copy all executables in the same work directory
Ex: R2.bat
Create a submission script so that Condor knows where to find the files for the grid job.
Submission script called “di-run2.txt” for a single run job
universe = vanilla
http://www.hpcc.ttu.edu
HPCC
6
environment = path=c:\winnt\system32
executable = R2.bat
transfer_input_files = di2.txt, R2.bat, R.zip, unzip.exe
getenv = True
arguments = --vanilla --slave
should_transfer_files = YES
When_to_transfer_output = ON_EXIT
output = 1.jpg
log = r.$(Cluster).$(Process).log
error = r.$(Cluster).$(Process).err
queue
6. Running a single run grid job with R
At the DOS prompt type: C:\> di-run>Condor_submit di-run2.txt
Then Condor will proceed with the job execution. Check your work directory for output files.
7. Check your Work
At the DOS prompt type: C:\> Condor_q
Then Condor will proceed with monitoring the progress of your grid job. Check your work directories
for output files.
http://www.hpcc.ttu.edu
HPCC
7
8. Output
From output file data111.txt
4.295725
From di2.txt.Rout output file:
user system elapsed
4.67 0.76 8.57
http://www.hpcc.ttu.edu
HPCC
8
Last updated: 02/18/2010
For Additional Assistance Contact: hpccsupport@ttu.edu
For Comments/Suggestions on user guide hpcc@ttu.edu
http://www.hpcc.ttu.edu
Download