-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_oversample.py
More file actions
43 lines (33 loc) · 1.1 KB
/
start_oversample.py
File metadata and controls
43 lines (33 loc) · 1.1 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
import sys
print "*** Simple Planets - UBERSAMPLE! ***"
name = str(raw_input('Enter run name to oversample: '))
science = str(raw_input('Type "True" if KNOWN: '))
start = int(raw_input('Enter number step to sample from: '))
min_part = int(raw_input('Enter original number of particles :'))
jobs = int(raw_input('Enter number of pbs jobs: '))
job_particles = int(raw_input('Enter number of particles per job: '))
print "Oversampling {}".format(name)
for j in xrange(jobs):
pbs_head = '''
#!/bin/bash
#
#PBS -N {0:}_osamp_{2:}
#PBS -M abc-sim@psu.edu
#PBS -m abe
#PBS -A ebf11_collab
#PBS -l pmem={1:}gb
#PBS -l nodes=1:ppn={1:}
#PBS -l walltime=048:00:00
#PBS -o runs/
#PBS -e runs/
#PBS -j oe
#
cd $PBS_O_WORKDIR'''.format(name, 1, j)
pbs_name = 'pbs_scripts/{:}oversample_{:}.pbs'.format(name,j)
pbs_file = file(pbs_name, 'w')
print >> pbs_file, pbs_head
print >> pbs_file, """python simpleplanets_oversample.py {:} {:} {:} {:} {:} {:} {:} {:}
""".format(name, 1, start-1, min_part, 1, science, j, job_particles)
pbs_file.close()
os.system("qsub {:}".format(pbs_name))