Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Demand Response User
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sepia-pub
Open Science
Demand Response User
Commits
ec1bf89c
Commit
ec1bf89c
authored
3 years ago
by
Maël Madon
Browse files
Options
Downloads
Patches
Plain Diff
made changes for absolute path in python
parent
8888f80b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
1_full_expe.py
+1
-1
1 addition, 1 deletion
1_full_expe.py
1_one_instance.py
+18
-17
18 additions, 17 deletions
1_one_instance.py
scripts/util.py
+3
-0
3 additions, 0 deletions
scripts/util.py
with
22 additions
and
18 deletions
1_full_expe.py
+
1
−
1
View file @
ec1bf89c
...
...
@@ -8,6 +8,6 @@ jun1_unix_time, nov30_unix_time = mktime(strptime('Sun Jun 1 00:00:00 2014')),
jun1
,
nov30
=
(
int
)
(
jun1_unix_time
-
begin_trace
),
(
int
)
(
nov30_unix_time
-
begin_trace
)
start_date
=
randint
(
jun1
,
nov30
-
72
*
3600
)
print
(
jun1
)
# For every start date
# Call the one_instance file with this date
\ No newline at end of file
This diff is collapsed.
Click to expand it.
1_one_instance.py
+
18
−
17
View file @
ec1bf89c
#!/usr/bin/env python3
import
time
import
sys
#
import sys
import
os
import
subprocess
import
argparse
sys
.
path
.
insert
(
0
,
'
/scripts
'
)
#
sys.path.insert(0, '/scripts')
import
scripts.swf_to_batsim_split_by_user
as
split_user
from
scripts.
run_batsim_exp
import
*
from
scripts.
util
import
*
#import swf_moulinette
...
...
@@ -17,11 +17,11 @@ def prepare_input_data(expe_num, start_date):
end_date
=
start_date
+
72
*
3600
to_keep
=
f
"
submit_time >=
{
start_date
}
and submit_time <=
{
end_date
}
"
if
not
os
.
path
.
exists
(
f
'
workload
/expe
{
expe_num
}
'
):
os
.
makedirs
(
f
'
workload
/expe
{
expe_num
}
'
)
if
not
os
.
path
.
exists
(
f
'
{
WL_DIR
}
/expe
{
expe_num
}
'
):
os
.
makedirs
(
f
'
{
WL_DIR
}
/expe
{
expe_num
}
'
)
split_user
.
generate_workload
(
input_swf
=
'
workload
/MC_selection_article.swf
'
,
output_folder
=
f
'
workload
/expe
{
expe_num
}
'
,
input_swf
=
f
'
{
WL_DIR
}
/MC_selection_article.swf
'
,
output_folder
=
f
'
{
WL_DIR
}
/expe
{
expe_num
}
'
,
keep_only
=
to_keep
,
job_grain
=
10
,
job_walltime_factor
=
8
)
...
...
@@ -34,11 +34,12 @@ def run_expe(expe_num, user_category, window_size):
w_size
=
'
05
'
else
:
w_size
=
f
"
{
window_size
}
"
EXPE_FILE
=
f
"
out/expe
{
expe_num
}
/
{
user_category
}
_window
{
w_size
}
"
wl_folder
=
f
'
workload/expe
{
expe_num
}
'
pf
=
"
platform/average_metacentrum.xml
"
wl
=
"
workload/empty_workload.json
"
uf
=
"
sched_input/user_description_file.json
"
EXPE_DIR
=
f
"
{
ROOT_DIR
}
/out/expe
{
expe_num
}
/
{
user_category
}
_window
{
w_size
}
"
EXPE_FILE
=
f
"
{
EXPE_DIR
}
.yaml
"
wl_folder
=
f
'
{
WL_DIR
}
/expe
{
expe_num
}
'
pf
=
f
"
{
ROOT_DIR
}
/platform/average_metacentrum.xml
"
wl
=
f
"
{
WL_DIR
}
/empty_workload.json
"
uf
=
f
"
{
ROOT_DIR
}
/sched_input/user_description_file.json
"
# Demand response window, from 12 to (12 + window_size) on day2
dm_window
=
[(
24
+
12
)
*
3600
,
(
24
+
12
+
window_size
)
*
3600
]
...
...
@@ -54,23 +55,23 @@ def run_expe(expe_num, user_category, window_size):
data
=
{}
data
[
"
dm_window
"
]
=
dm_window
data
[
"
log_user_stats
"
]
=
True
data
[
"
log_folder
"
]
=
EXPE_
FILE
data
[
"
log_folder
"
]
=
EXPE_
DIR
data
[
"
users
"
]
=
[
user_description
(
user
)
for
user
in
user_names
]
with
open
(
uf
,
'
w
'
)
as
user_description_file
:
json
.
dump
(
data
,
user_description_file
)
# Generate and run robin instance
batcmd
=
gen_batsim_cmd
(
pf
,
wl
,
EXPE_
FILE
,
"
--energy --enable-compute-sharing --enable-dynamic-jobs --acknowledge-dynamic-jobs --enable-profile-reuse
"
)
pf
,
wl
,
EXPE_
DIR
,
"
--energy --enable-compute-sharing --enable-dynamic-jobs --acknowledge-dynamic-jobs --enable-profile-reuse
"
)
schedcmd
=
f
"
batsched -v bin_packing_energy --queue_order=desc_size --variant_options_filepath=
{
uf
}
"
instance
=
RobinInstance
(
output_dir
=
EXPE_
FILE
,
instance
=
RobinInstance
(
output_dir
=
EXPE_
DIR
,
batcmd
=
batcmd
,
schedcmd
=
schedcmd
,
simulation_timeout
=
30
,
ready_timeout
=
5
,
success_timeout
=
10
,
failure_timeout
=
0
)
instance
.
to_file
(
robin_filename
)
ret
=
run_robin
(
robin_filename
)
instance
.
to_file
(
EXPE_FILE
)
ret
=
run_robin
(
EXPE_FILE
)
...
...
This diff is collapsed.
Click to expand it.
scripts/
run_batsim_exp
.py
→
scripts/
util
.py
+
3
−
0
View file @
ec1bf89c
...
...
@@ -5,6 +5,9 @@ import subprocess
import
filecmp
from
collections
import
namedtuple
ROOT_DIR
=
os
.
path
.
realpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
..
'
))
WL_DIR
=
f
'
{
ROOT_DIR
}
/workload
'
class
RobinInstance
(
object
):
def
__init__
(
self
,
output_dir
,
batcmd
,
schedcmd
,
simulation_timeout
,
ready_timeout
,
success_timeout
,
failure_timeout
):
self
.
output_dir
=
output_dir
...
...
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