From e4c7d71976be006f1edfaa5ee3ad7619c9a77bba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 11 Aug 2015 19:19:30 +0200 Subject: [PATCH] Add parse_script Parsing maximal value from first thread as result. --- conf.py | 2 +- parse_script | 3 +++ scripts/boot.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 parse_script diff --git a/conf.py b/conf.py index 2e50189..5702027 100644 --- a/conf.py +++ b/conf.py @@ -29,7 +29,7 @@ boot_command = ['./boot_script'] # parse_command # Command to parse double value from boot output -parse_command = ['echo', '0'] +parse_command = ['./parse_script'] # picosat_args # Additional arguments passed to PicoSAT. diff --git a/parse_script b/parse_script new file mode 100755 index 0000000..868212c --- /dev/null +++ b/parse_script @@ -0,0 +1,3 @@ +#!/bin/bash + +cat $1 | grep -e "^! .* ok" | sed -n '2p' | awk '{print $17}' diff --git a/scripts/boot.py b/scripts/boot.py index 7ae30a9..2d1461a 100644 --- a/scripts/boot.py +++ b/scripts/boot.py @@ -29,7 +29,8 @@ def boot(config, to_database = True): value = None try: - out = utils.callsubprocess('parse_command', conf.parse_command, + out = utils.callsubprocess('parse_command', conf.parse_command + + [os.path.join(conf.output_folder, config.cfile)], conf.parse_output, True) value = float(out[0]) except Exception as e: -- 2.39.2