Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Tobias Langer
/
experiment
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
45b8c468
authored
Nov 14, 2016
by
Tobias Langer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better rewritten in python.
parent
9cdff37a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
7 deletions
+55
-7
run.py
+55
-0
run.sh
+0
-7
No files found.
run.py
0 → 100755
View file @
45b8c468
#!/usr/bin/env python3
import
sys
import
os
import
argparse
import
shutil
import
subprocess
def
get_exp_cnt
(
path
):
try
:
return
len
([
name
for
name
in
os
.
listdir
(
path
)
if
os
.
path
.
isfile
(
path
+
'/'
+
name
)])
except
Exception
:
return
0
def
main
():
parser
=
argparse
.
ArgumentParser
(
'Run all the scripts so everything works fine.'
)
parser
.
add_argument
(
'experiments'
,
type
=
int
,
nargs
=
'?'
,
default
=
1
,
help
=
'The number of experiments to be run.'
)
args
=
parser
.
parse_args
()
cwd
=
os
.
getcwd
()
try
:
shutil
.
rmtree
(
'./experiment_data'
)
except
FileNotFoundError
:
pass
os
.
makedirs
(
'./experiment_data'
)
cnt
=
0
remain
=
args
.
experiments
while
remain
>
0
:
subprocess
.
call
([
'./tasksetgen.py'
,
'--microseconds'
,
'--uniform'
,
'5'
,
str
(
remain
),
'experiments/ese2016_{}'
.
format
(
cnt
),
'experiment_data'
])
for
experiment
in
os
.
listdir
(
'experiments/ese2016_{}'
.
format
(
cnt
)):
subprocess
.
call
([
'./generate.py'
,
'experiments/ese2016_{}'
.
format
(
cnt
)
+
'/'
+
experiment
])
shutil
.
copyfile
(
'Makefile'
,
'./experiment_data/Makefile'
)
subprocess
.
call
([
'./runner.py'
,
'./experiment_data'
])
os
.
makedirs
(
'./experiment_data/{}'
.
format
(
cnt
))
for
experiment
in
os
.
listdir
(
'./experiment_data'
):
if
experiment
.
isdigit
()
or
experiment
==
'results'
or
experiment
==
'Makefile'
:
continue
try
:
shutil
.
move
(
'./experiment_data/'
+
experiment
,
'./experiment_data/'
+
str
(
cnt
))
except
Exception
:
pass
cnt
+=
1
remain
=
args
.
experiments
-
get_exp_cnt
(
'./experiment_data/results'
)
print
(
'remain:'
,
remain
,
'experiments: '
,
args
.
experiments
,
get_exp_cnt
(
'./experiment_data/results'
))
if
__name__
==
'__main__'
:
main
()
run.sh
deleted
100755 → 0
View file @
9cdff37a
#/bin/bash
rm
-fr
experiment_data
&&
mkdir experiment_data
./tasksetgen.py
--microseconds
--uniform
5 333 experiments/ese2016 experiment_data
./generate.py experiments/ese2016/
*
cp Makefile experiment_data
./runner.py experiment_data
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment