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
d26d4b6c
Commit
d26d4b6c
authored
9 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
Added task to prepare dstat output for usage.
- added parameter timeout for sol
parent
161f5c2a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
fabfile.py
+2
-0
2 additions, 0 deletions
fabfile.py
ilp_measurement.py
+14
-5
14 additions, 5 deletions
ilp_measurement.py
with
16 additions
and
5 deletions
fabfile.py
+
2
−
0
View file @
d26d4b6c
...
...
@@ -35,6 +35,8 @@ def cloc(not_match, *args, **kwargs):
@task
@hosts
(
'
rschoene@141.76.65.177
'
)
def
dl
(
name
,
rdir
=
'
~/git/racr-mquat/
'
):
"""
Download a single file from the remote host.
Arguments: name, [absolute-remote-directory]
"""
#run('uname -a')
target
=
os
.
path
.
join
(
rdir
,
name
)
print
target
...
...
This diff is collapsed.
Click to expand it.
ilp_measurement.py
+
14
−
5
View file @
d26d4b6c
...
...
@@ -104,15 +104,24 @@ def dstat_log(directory): return 'profiling/{}/dstat.log'.format(directory)
def
dirname
(
d
):
return
os
.
path
.
split
(
os
.
path
.
dirname
(
d
))[
-
1
]
@task
def
prepare_dstat
(
f
):
newFile
=
f
.
replace
(
'
.log
'
,
'
.csv
'
)
schema
=
[
'
time
'
]
+
[
cpu
+
t
for
t
in
(
"
usr
"
,
"
sys
"
,
"
idl
"
,
"
wai
"
,
"
hiq
"
,
"
siq
"
)
for
cpu
in
(
"
total
"
,
"
cpu0
"
,
"
cpu1
"
,
"
cpu2
"
,
"
cpu3
"
)]
+
\
[
"
1m
"
,
"
5m
"
,
"
15m
"
,
"
used
"
,
"
buff
"
,
"
cach
"
,
"
free
"
,
"
read
"
,
"
writ
"
]
with
open
(
newFile
,
'
w
'
)
as
fd
:
fd
.
write
(
"
,
"
.
join
(
schema
))
local_quiet
(
'
grep -Ev ^
\\
"
{0} >> {1}
'
.
format
(
f
,
newFile
))
@task
(
name
=
'
sol
'
)
def
sol
(
number
=
1
,
solver
=
'
glpsol
'
,
pathname
=
'
*
'
,
skip_conflate
=
False
):
def
sol
(
number
=
1
,
solver
=
'
glpsol
'
,
pathname
=
'
*
'
,
skip_conflate
=
False
,
timeout
=
40
):
"""
Run solver n times (default: once)
"""
do_sol
(
solver
,
int
(
number
),
pathname
,
skip_conflate
)
do_sol
(
solver
,
int
(
number
),
pathname
,
skip_conflate
,
int
(
timeout
)
)
params
=
{
'
glpsol
'
:
[
'
glpsol --tmlim
40
--lp {lp} -w {sol}
'
,
'
INTEGER OPTIMAL SOLUTION FOUND
'
,
'
Time used:[\s]*(.*?) secs
'
,
'
(\d+) rows, (\d+) columns, (\d+) non-zeros
'
],
params
=
{
'
glpsol
'
:
[
'
glpsol --tmlim
{timeout}
--lp {lp} -w {sol}
'
,
'
INTEGER OPTIMAL SOLUTION FOUND
'
,
'
Time used:[\s]*(.*?) secs
'
,
'
(\d+) rows, (\d+) columns, (\d+) non-zeros
'
],
'
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
):
def
do_sol
(
solver
,
number
,
pathname
,
skip_conflate
,
timeout
):
assertTrue
=
utils
.
assertTrueContinue
old_cd
=
os
.
getcwd
()
dirs
=
glob
(
'
profiling/{0}/
'
.
format
(
pathname
))
...
...
@@ -142,7 +151,7 @@ def do_sol(solver, number, pathname, skip_conflate):
if
not
ilp
.
endswith
(
'
.lp
'
):
continue
start
=
timeit
.
default_timer
()
out
=
local_quiet
(
params
[
solver
][
0
].
format
(
lp
=
ilp
,
sol
=
ilp
.
replace
(
'
lp
'
,
'
sol
'
)))
out
=
local_quiet
(
params
[
solver
][
0
].
format
(
lp
=
ilp
,
sol
=
ilp
.
replace
(
'
lp
'
,
'
sol
'
)
,
timeout
=
timeout
))
stop
=
timeit
.
default_timer
()
today
=
datetime
.
today
()
if
re
.
search
(
params
[
solver
][
1
],
out
):
...
...
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