Commit 1323b827 authored by Konstantinos Chatzilygeroudis's avatar Konstantinos Chatzilygeroudis
Browse files

Fix wscripts for simplejson

parent 2b30f64f
import os, glob
import simplejson
import stat
import subprocess
import time
import threading
from waflib import Logs
json_ok = True
try:
import simplejson
except:
json_ok = False
Logs.pprint('YELLOW', 'WARNING: simplejson not found some function may not work')
def run_bo_benchmarks(ctx):
HEADER='\033[95m'
NC='\033[0m'
......@@ -37,6 +43,9 @@ def run_bo_benchmarks(ctx):
def compile_regression_benchmarks(bld, json_file):
if not json_ok:
Logs.pprint('RED', 'ERROR: simplejson is not installed and as such you cannot read the json configuration file for compiling the benchmarks.')
return
import types
def convert(name):
......@@ -251,6 +260,10 @@ def run_regression_benchmarks(ctx):
HEADER='\033[95m'
NC='\033[0m'
if not json_ok:
Logs.pprint('RED', 'ERROR: simplejson is not installed and as such you cannot read the json configuration file for running the benchmarks.')
return
if not ctx.options.regression_benchmarks:
Logs.pprint('RED', 'ERROR: No json file with configurations is provided. Nothing will run!')
return
......
......@@ -279,6 +279,9 @@ def run_local_one(directory, s):
retcode = subprocess.call(s, shell=True, env=None, stdout=std_out, stderr=std_err)
def run_local(conf_file, serial = True):
if not json_ok:
Logs.pprint('RED', 'ERROR: simplejson is not installed and as such you cannot read the json configuration file for running your experiments.')
return
fnames,arguments = _sub_script_local(conf_file)
threads = []
for (fname, directory) in fnames:
......@@ -313,6 +316,9 @@ def qsub(conf_file):
export LD_LIBRARY_PATH=@ld_lib_path
exec @exec
"""
if not json_ok:
Logs.pprint('RED', 'ERROR: simplejson is not installed and as such you cannot read the json configuration file for running your experiments.')
return
fnames = _sub_script(tpl, conf_file)
for (fname, directory) in fnames:
s = "qsub -d " + directory + " " + fname
......@@ -330,6 +336,9 @@ def oar(conf_file):
export LD_LIBRARY_PATH=@ld_lib_path
exec @exec
"""
if not json_ok:
Logs.pprint('RED', 'ERROR: simplejson is not installed and as such you cannot read the json configuration file for running your experiments.')
return
Logs.pprint('YELLOW', 'WARNING [oar]: MPI not supported yet')
fnames = _sub_script(tpl, conf_file)
for (fname, directory) in fnames:
......
......@@ -165,7 +165,7 @@ def build(bld):
bld.recurse('exp/' + i)
limbo.output_params('exp/'+i)
if bld.options.regression_benchmarks:
limbo.compile_regression_benchmarks(bld, bld.options.regression_benchmarks)
benchmarks.compile_regression_benchmarks(bld, bld.options.regression_benchmarks)
bld.add_post_fun(limbo.summary)
def build_extensive_tests(ctx):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment