Revision 848e34fd
Added by Adam Wilson about 11 years ago
climate/procedures/Pleiades_MOD35.R | ||
---|---|---|
27 | 27 |
## subset to MODLAND tiles |
28 | 28 |
alltiles=system("ls -r MODTILES/ | grep tif$ | cut -c1-6 | sort | uniq - ",intern=T) |
29 | 29 |
|
30 |
## or run all tiles |
|
31 |
#tiles=alltiles |
|
32 |
|
|
30 | 33 |
## subset to tiles in global region (not outside global boundary in sinusoidal projection) |
31 | 34 |
tiles=tiles[tiles%in%alltiles] |
32 | 35 |
|
... | ... | |
38 | 41 |
|
39 | 42 |
outdir="daily/" #paste("daily/",tile,sep="") |
40 | 43 |
|
41 |
##find swaths in region from sqlite database for the specified date/tile
|
|
44 |
##find swaths in region from sqlite database for the specified tile |
|
42 | 45 |
## this takes a while, about 30 minutes, so only rebuild if you need to update what's available... |
43 | 46 |
rebuildswathtable=F |
44 | 47 |
if(rebuildswathtable){ |
... | ... | |
69 | 72 |
save(fs,swaths,file="swathtile.Rdata") |
70 | 73 |
} |
71 | 74 |
|
72 |
load("swathtile.Rdata") |
|
75 |
if(!exists("fs")) load("swathtile.Rdata")
|
|
73 | 76 |
|
74 | 77 |
if(verbose) print(paste("###############",nrow(fs)," swath IDs recieved from database")) |
75 | 78 |
|
... | ... | |
118 | 121 |
table(Available=proclist$avail,Completed=proclist$done) |
119 | 122 |
table(tp) |
120 | 123 |
|
121 |
write.table(paste("--verbose ",script," --date ",proclist$date[tp]," --verbose T --tile ",proclist$tile[tp],sep=""), |
|
124 |
write.table(paste("--verbose ",script," --date ",proclist$date[tp]," --verbose T --profile F --tile ",proclist$tile[tp],sep=""),
|
|
122 | 125 |
file=paste("notdone.txt",sep=""),row.names=F,col.names=F,quote=F) |
123 | 126 |
|
124 | 127 |
## try running it once for a single tile-date to get estimate of time/tile-day |
125 | 128 |
test=F |
126 | 129 |
if(test){ |
127 | 130 |
i=2 |
128 |
time1=system.time(system(paste("Rscript --verbose ",script," --date ",proclist$date[i]," --verbose T --tile ",proclist$tile[i],sep=""))) |
|
129 |
hours=round(length(proclist$date[tp])*142/60/60) |
|
131 |
time1=system.time(system(paste("Rscript --verbose ",script," --date ",proclist$date[i]," --profile T --verbose T --tile ",proclist$tile[i],sep="")))
|
|
132 |
hours=round(length(proclist$date[tp])*142/60/60); hours
|
|
130 | 133 |
hours=round(length(proclist$date[tp])*time1[3]/60/60,1); hours |
131 |
hours/400 |
|
132 |
print(paste("Based on runtime of previous command, it will take",hours," hours to process the full set")) |
|
134 |
nodes=100 |
|
135 |
threads=nodes*8 |
|
136 |
writeLines(paste(" ################### \n Hours per date-tile:",round(time1[3]/60/60,2),"\n Date-tiles to process:",sum(tp)," \n Estimated CPU time: ",hours,"hours \n With ",threads,"threads:",round(hours/threads,2),"hours \n ###################")) |
|
133 | 137 |
} |
134 | 138 |
|
139 |
### Set up submission script |
|
140 |
queue="devel" |
|
141 |
queue="normal" #"devel" |
|
142 |
nodes=50 |
|
143 |
walltime=2 |
|
135 | 144 |
|
136 |
### qsub script
|
|
145 |
### write qsub script to disk
|
|
137 | 146 |
cat(paste(" |
138 | 147 |
#PBS -S /bin/bash |
139 |
#PBS -l select=50:ncpus=8:mpiprocs=8 |
|
140 |
##PBS -l select=100:ncpus=8:mpiprocs=8 |
|
141 |
##PBS -l walltime=8:00:00 |
|
142 |
#PBS -l walltime=2:00:00 |
|
148 |
#PBS -l select=",nodes,":ncpus=8:mpiprocs=8 |
|
149 |
#PBS -l walltime=",walltime,":00:00 |
|
143 | 150 |
#PBS -j n |
144 | 151 |
#PBS -m be |
145 | 152 |
#PBS -N mod35 |
146 |
##PBS -q normal |
|
147 |
#PBS -q devel |
|
153 |
#PBS -q ",queue," |
|
148 | 154 |
#PBS -V |
149 | 155 |
|
150 |
#CORES=800 |
|
151 |
CORES=400 |
|
152 |
|
|
156 |
CORES=",nodes*8," |
|
153 | 157 |
HDIR=/u/armichae/pr/ |
154 | 158 |
source $HDIR/etc/environ.sh |
155 | 159 |
source /u/awilso10/environ.sh |
156 | 160 |
source /u/awilso10/.bashrc |
157 | 161 |
IDIR=/nobackupp1/awilso10/mod35/ |
158 |
##WORKLIST=$HDIR/var/run/pxrRgrs/work.txt |
|
159 | 162 |
WORKLIST=$IDIR/notdone.txt |
160 | 163 |
EXE=Rscript |
161 | 164 |
LOGSTDOUT=$IDIR/log/mod35_stdout |
... | ... | |
166 | 169 |
|
167 | 170 |
### Check the files |
168 | 171 |
system(paste("cat mod35_qsub",sep="")) |
169 |
system(paste("cat notdone.txt | head",sep="")) |
|
172 |
system(paste("cat notdone.txt | head -n 4",sep=""))
|
|
170 | 173 |
system(paste("cat notdone.txt | wc -l ",sep="")) |
171 | 174 |
|
175 |
## start interactive job on compute node for debugging |
|
176 |
# system("qsub -I -l walltime=2:00:00 -lselect=2:ncpus=16:model=san -q devel") |
|
177 |
|
|
172 | 178 |
|
173 | 179 |
## Submit it |
174 | 180 |
system(paste("qsub mod35_qsub",sep="")) |
... | ... | |
204 | 210 |
file=paste("notdone_climate.txt",sep=""),row.names=F,col.names=F,quote=F) |
205 | 211 |
|
206 | 212 |
## delay start until previous jobs have finished? |
207 |
delay=T
|
|
213 |
delay=F
|
|
208 | 214 |
## check running jobs to get JobID of job you want to wait for |
209 | 215 |
system("qstat -u awilso10",intern=T) |
210 | 216 |
## enter JobID here: |
... | ... | |
250 | 256 |
## check progress |
251 | 257 |
system("qstat -u awilso10") |
252 | 258 |
|
253 |
## start interactive job on compute node for debugging |
|
254 |
# system("qsub -I -l walltime=2:00:00 -lselect=2:ncpus=16:model=san -q devel") |
|
255 | 259 |
|
256 | 260 |
|
257 | 261 |
################################################################# |
258 | 262 |
### copy the files back to Yale |
259 | 263 |
|
260 | 264 |
|
261 |
system("ssh lou") |
|
265 |
#system("ssh lou")
|
|
262 | 266 |
#scp `find MOD35/summary -name "MOD35_h[0-9][0-9]v[0-9][0-9].nc"` adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/mod35/summary/ |
263 | 267 |
system("rsync -cavv `find summary -name \"MOD35_h[0-9][0-9]v[0-9][0-9]_mean.nc\"` adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/mod35/summary/") |
264 | 268 |
system("rsync -cavv `find summary -name \"MOD35_h[0-9][0-9]v[0-9][0-9].nc\"` adamw@acrobates.eeb.yale.edu:/data/personal/adamw/projects/interp/data/modis/mod35/summary/") |
Also available in: Unified diff
Submitted global run for 2009