-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultibatch.cm.R
More file actions
28 lines (26 loc) · 894 Bytes
/
multibatch.cm.R
File metadata and controls
28 lines (26 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Run the ICOADS3+ monthly merge on SPICE
peak.no.jobs<-500
for (year in seq(1662,1925)) {
in.system<-system('squeue --user hadpb',intern=TRUE)
n.new.jobs<-peak.no.jobs-length(in.system)
while(n.new.jobs<12) {
Sys.sleep(10)
in.system<-system('squeue --user hadpb',intern=TRUE)
n.new.jobs<-peak.no.jobs-length(in.system)
}
for (month in seq(1,12)) {
sink('ICOADS3+.merge.slm')
cat('#!/bin/ksh -l\n')
cat('#SBATCH --output=/scratch/hadpb/slurm_output/ICOADS3+.merge-%j.out\n')
cat('#SBATCH --qos=normal\n')
cat('#SBATCH --mem=5000\n')
cat('#SBATCH --ntasks=1\n')
cat('#SBATCH --ntasks-per-core=2\n')
cat('#SBATCH --time=10\n')
cat(sprintf("./copy_and_merge_month.R --year=%d --month=%d \n",
year,month))
sink()
system('sbatch ICOADS3+.merge.slm')
unlink('ICOADS3+.merge.slm')
}
}