Commit 3794c8f8 authored by Prasanna's avatar Prasanna
Browse files

minor edits to the benchmarks

parent 13a6150d
......@@ -25,12 +25,12 @@ def readResults(fname, evalnum):
with open(fname, 'rt') as in_file:
for linenum, line in enumerate(in_file):
if pattern1.search(line) is not None:
print(line)
#print(line)
str1 = line.rstrip('\n')
res = re.findall('START TIME:(.*)', str1)
resDict['startTime'] = int(res[0])
elif pattern2.search(line) is not None:
print(line)
#print(line)
str1 = line.rstrip('\n')
res = re.findall('OUTPUT:(.*)', str1)
rv = float(res[0])
......@@ -38,12 +38,12 @@ def readResults(fname, evalnum):
rv = sys.float_info.max
resDict['cost'] = rv
elif pattern3.search(line) is not None:
print(line)
#print(line)
str1 = line.rstrip('\n')
res = re.findall('END TIME:(.*)', str1)
resDict['endTime'] = int(res[0])
elif pattern4.search(line) is not None:
print(line)
#print(line)
str1 = line.rstrip('\n')
res = re.findall('INPUT:(.*)', str1)
resDict['x'] = eval(res[0])
......@@ -56,7 +56,7 @@ def readResults(fname, evalnum):
time.sleep(5)
except Exception:
print('Unexpected error:', sys.exc_info()[0])
print(resDict)
#print(resDict)
return(resDict)
def commandLine(x, params):
......@@ -64,7 +64,7 @@ def commandLine(x, params):
hlist = []
for p, v in zip(params, x):
cmd = cmd + ('--%s %s ') % (p, str(v))
print(cmd)
#print(cmd)
return(cmd)
def evaluate(x, evalCounter, params, prob_dir, job_dir, result_dir):
......@@ -81,7 +81,7 @@ def evaluate(x, evalCounter, params, prob_dir, job_dir, result_dir):
status = subprocess.check_output('chmod +x %s' % jobfile, shell=True)
status = subprocess.call(' sh %s ' % jobfile, shell=True)
resDict = readResults(outputfile, evalCounter)
print(resDict)
#print(resDict)
return(resDict)
......@@ -9,7 +9,7 @@ class Problem():
space['p4'] = ['a', 'b', 'c']
self.space = space
self.params = self.space.keys()
self.starting_point = [2, 8, 2, 'c']
self.starting_point = [10, 1000, 64, 'c']
if __name__ == '__main__':
instance = Problem()
......
Markdown is supported
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