Skip to content
Snippets Groups Projects
Commit c8585049 authored by René Schöne's avatar René Schöne
Browse files

another quick-fix for measurement.

parent e95cd262
No related branches found
No related tags found
No related merge requests found
......@@ -309,7 +309,7 @@
(let* ([max-id (apply max (map (lambda (pe) (string->number (substring (->name pe) 2))) (=every-container ast)))]
[first-clauses (->* (->ProvClause* (car (=every-container ast))))]
[new-clauses (map (lambda (cl) (make-prov (->return-type cl) (->comparator cl) (rand 50 2 0))) first-clauses)] ;TODO
[new-res (:Resource mquat-spec (number->string (+ 1 max-id)) rt online (list) new-clauses)])
[new-res (:Resource mquat-spec (string-append "r-" (number->string (+ 1 max-id))) rt online (list) new-clauses)])
(rewrite-add (->SubResources (->HWRoot ast)) new-res)))
(define (update-change outer steps)
(for-each
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, re, os, csv, timeit, shutil, json
from datetime import datetime
......@@ -94,6 +95,7 @@ params = { 'glpsol' : ['glpsol --tmlim 40 --lp {lp} -w {sol}', 'INTEGER OPTIMAL
'gurobi' : ['gurobi_cl ResultFile={sol} {lp}', 'Optimal solution found', 'in (.*?) seconds', 'Optimize a model with (\d+) rows, (\d+) columns and (\d+) nonzeros']}
def do_sol(solver, number, pathname, skip_conflate):
assertTrue = utils.assertTrueContinue
old_cd = os.getcwd()
dirs = glob('profiling/{0}/'.format(pathname))
dirs.sort()
......@@ -101,17 +103,21 @@ def do_sol(solver, number, pathname, skip_conflate):
if not os.path.isdir(d):
print red("Not a valid directory: {0}".format(d))
continue
with timed():
total_start = timeit.default_timer()
sys.stdout.write(d)
os.chdir(d)
files = glob('*.lp')
if len(files) == 0:
print ': ø'
os.chdir(old_cd)
continue
files.sort()
with timed():
total_start = timeit.default_timer()
add_header = not os.path.exists(sol_results)
with open(sol_results, 'a') as fd:
writer = csv.writer(fd)
if add_header:
writer.writerow(sol_header)
files = os.listdir('.')
files.sort()
for _ in xrange(int(number)):
sys.stdout.write(':')
for ilp in files:
......
......@@ -14,6 +14,10 @@ def assertTrueExit(expr, msg):
print msg
sys.exit(0)
def assertTrueContinue(expr, msg):
if not expr:
print msg
assertTrue = assertTrueExit
change_kinds_fname = 'profiling/kinds.json'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment