-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsymbolic_master.py
80 lines (57 loc) · 1.65 KB
/
symbolic_master.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from datetime import datetime
import queue
import re
import os
import subprocess
import time
import sys
sys.path.append('./python3.8/site-packages')
from multiprocessing.managers import BaseManager
import compiler
import os.path
from os import path
from anytree import Node, RenderTree
index = 0
root="./Bins/"
bin_path = "./Bins/"
def scanned(file):
if not path.os.path.exists(os.path.join(root, "overallres.res")):
return False
f = open(os.path.join(root, "overallres.res"), "r")
for line in f:
if file in line:
return True
return False
if __name__ == '__main__':
task_queue = queue.Queue()
result_queue = queue.Queue()
class QueueManager(BaseManager):
pass
QueueManager.register('get_task_queue', callable=lambda: task_queue)
QueueManager.register('get_result_queue', callable=lambda: result_queue)
manager = QueueManager(address=('', 5000), authkey=b'abc')
manager.start()
task = manager.get_task_queue()
result = manager.get_result_queue()
filelist=[]
print("Symbolic Tester Master")
for f in os.listdir(root):
if scanned(f):
print("finished:"+f)
continue
else:
if not f.endswith("res"):
filelist.append(root+""+f)
total = len(filelist)
count = 0
print(total)
for cfile in filelist:
task.put(cfile)
while (count < total):
data = result.get(timeout=200000)
count += 1;
print("{}/{}: {}".format(count, total, data))
f = open(os.path.join(root, "overallres.res"), "a")
f.write(data + "\n")
f.close()
manager.shutdown()