-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch.py
More file actions
executable file
·34 lines (30 loc) · 1.08 KB
/
launch.py
File metadata and controls
executable file
·34 lines (30 loc) · 1.08 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
#!/usr/bin/env python
import sys
import os
from subprocess import Popen
import parallel_run
if __name__ == '__main__':
try:
iterations = int(sys.argv[1])
num_bp = int(sys.argv[2])
num_saved = int(sys.argv[3])
except:
print 'Usage: %s <Num iterations> <Num basepairs> <Num saved>'%sys.argv[0]
sys.exit(1)
clients = [#('diglett.cs.washington.edu', 8),
('charliebrown.cs.washington.edu', 8)]
#('hobbes.cs.washington.edu', 7),
#('bicycle.cs.washington.edu', 4),
#('tricycle.cs.washington.edu', 4),
#('recycle.cs.washington.edu', 4)]
procs = []
# Start the worker processes
for client,num_jobs in clients:
procs.append(Popen(['ssh', client, 'cd ~/Dropbox/cse527/project; nice -n 19 python parallel_run.py w %d %d'%(num_jobs, num_bp)]))
print 'here'
# Start the analyzing process
parallel_run.runServer(iterations, num_saved)
for proc in procs:
proc.wait()
if any(proc.returncode != 0 for proc in procs):
print 'Something failed'