forked from cjmcmahon1/tW_scattering
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_cluster.py
47 lines (35 loc) · 1.29 KB
/
start_cluster.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
45
46
47
import os
from dask.distributed import Client
import distributed
from Tools.condor_utils import make_htcondor_cluster
from dask.distributed import Client, progress
def getWorkers( client ):
logs = client.get_worker_logs()
return list(logs.keys())
def getAllWarnings( client ):
logs = client.get_worker_logs()
workers = getWorkers( client )
for worker in workers:
for log in logs[worker]:
if log[0] == 'WARNING' or log[0] == 'ERROR':
print ()
print (" ### Found warning for worker:", worker)
print (log[1])
def getFilesNotFound( client ):
allFiles = []
logs = client.get_worker_logs()
workers = getWorkers( client )
for worker in workers:
for log in logs[worker]:
if log[0] == 'WARNING':
print (worker)
files = [ x for x in log[1].split() if x.count('xrootd') ]
print ( files )
allFiles += files
return allFiles
cluster = make_htcondor_cluster(local=False, dashboard_address=13349, disk = "10GB", memory = "5GB",)
print ("Scaling cluster at address %s now."%cluster.scheduler_address)
cluster.scale(25)
with open('scheduler_address.txt', 'w') as f:
f.write(str(cluster.scheduler_address))
c = Client(cluster)