From 65d6e263f2a82e5fa85606288dbcf7568f4bc928 Mon Sep 17 00:00:00 2001 From: Kento HASEGAWA Date: Mon, 27 Aug 2018 21:44:51 +0900 Subject: [PATCH] Make it possible to receive a problem from a solver --- comm/resolver/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/comm/resolver/main.py b/comm/resolver/main.py index 4fcb894..cfcc244 100644 --- a/comm/resolver/main.py +++ b/comm/resolver/main.py @@ -46,14 +46,17 @@ def resolve(): print(data) outpath = "./works/resolved.txt" - probpath = "./problems/{}".format(data['qname']) + probpath = "./works/problem.txt" tmppath = "./works/answer.txt" + with open(probpath, "w") as fp: + fp.write(data['problem']) + with open(tmppath, "w") as fp: fp.write(data['answer']) # Resolver - cmd = "/home/pi/adc2017/pynq-router/resolver/solver --reroute --output {} {} {}".format(outpath, probpath, tmppath) + cmd = "/home/xilinx/adc2017/pynq-router/resolver/solver --reroute --output {} {} {}".format(outpath, probpath, tmppath) subprocess.call(cmd.strip().split(" ")) resolved = "" @@ -93,6 +96,7 @@ def start(): data = { 'client': request.form['client'], 'qname': request.form['qname'], + 'problem': request.form['problem'], 'answer': request.form['solution'], 'cputime': request.form['cputime'], 'req_id': request.form['req_id'] -- 2.22.0