Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
racr-mquat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
René Schöne
racr-mquat
Commits
c8585049
Commit
c8585049
authored
Dec 22, 2015
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
another quick-fix for measurement.
parent
e95cd262
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ilp-measurement.scm
+1
-1
1 addition, 1 deletion
ilp-measurement.scm
ilp_measurement.py
+10
-4
10 additions, 4 deletions
ilp_measurement.py
utils.py
+4
-0
4 additions, 0 deletions
utils.py
with
15 additions
and
5 deletions
ilp-measurement.scm
+
1
−
1
View file @
c8585049
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
ilp_measurement.py
+
10
−
4
View file @
c8585049
#!/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
:
...
...
This diff is collapsed.
Click to expand it.
utils.py
+
4
−
0
View file @
c8585049
...
...
@@ -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
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment