-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcondor_submit.py
executable file
·46 lines (34 loc) · 1.06 KB
/
condor_submit.py
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
43
44
#!/usr/bin/python
from sys import argv,exit
import string
from os import system
from os.path import basename,dirname,abspath,exists
def Help():
print
print argv[0]+' <cluster> <submit file>'
print 'You may want to run rsync_to_cluster.py before this.'
print
exit()
if len(argv)<3:
Help()
cluster = argv[1]
submitfile = argv[2]
clusterlist = [ 'fin','syd','niau','seth','bes','hapy','apep','gebb','ptah','yah','isis','yah','maat','nut' ];
if cluster not in clusterlist:
print 'Hey, '+cluster+' is not a known cluster.'
Help()
# log condor submission event (so I don't forget which cluster this went on.)
fid = open('condor_submit.log','a')
fid.write('%s %s \n' % (cluster,submitfile));
fid.close()
dir = '.'
clusterdir = abspath(dir).replace('/Users/rhiju/','')
clusterdir = clusterdir.replace('/work/rhiju/','')
#if cluster[:3]=='syd':
# n = cluster[3]
# cluster = 'syd'
# clusterdir = 'work'+n+'/'+clusterdir
command = 'ssh %s "cd %s; condor_submit %s" ' % \
(cluster,clusterdir,submitfile)
print(command)
system(command)