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
a26115c9
Commit
a26115c9
authored
1 year ago
by
Maël Madon
Browse files
Options
Downloads
Patches
Plain Diff
update batmen call to lastest CLI and add verbosity quiet
parent
f54f51aa
No related branches found
No related tags found
1 merge request
!1
Extension europar2022
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
instance.py
+19
-10
19 additions, 10 deletions
instance.py
with
19 additions
and
10 deletions
instance.py
+
19
−
10
View file @
a26115c9
...
...
@@ -25,7 +25,7 @@ def prepare_input_data(expe_num, start_date):
job_walltime_factor
=
8
)
def
run_expe
(
expe_num
,
user_category
,
window_size
,
clean_log
):
def
run_expe
(
expe_num
,
user_category
,
window_size
,
clean_log
,
nb_cores
=
16
):
"""
Run batmen with given behavior and demand response window.
Expe_num should be a small integer (eg < 100)
"""
# Useful vars and output folder
...
...
@@ -60,9 +60,14 @@ def run_expe(expe_num, user_category, window_size, clean_log):
# Generate and run robin instance
socket_batsim
=
f
"
tcp://localhost:280
{
expe_num
:
02
d
}
"
socket_batsched
=
f
"
tcp://*:280
{
expe_num
:
02
d
}
"
quiet_batsim
,
quiet_batmen
=
""
,
""
if
clean_log
:
quiet_batsim
=
"
-q
"
quiet_batmen
=
"
--verbosity=silent
"
batcmd
=
gen_batsim_cmd
(
pf
,
wl
,
EXPE_DIR
,
f
"
--socket-endpoint=
{
socket_batsim
}
--energy --enable-compute-sharing --enable-dynamic-jobs --acknowledge-dynamic-jobs --enable-profile-reuse
"
)
schedcmd
=
f
"
batsched --socket-endpoint=
{
socket_batsched
}
-v bin_packing_energy --queue_order=desc_size --variant_options_filepath=
{
uf
}
"
pf
,
wl
,
EXPE_DIR
,
f
"
--socket-endpoint=
{
socket_batsim
}
{
quiet_batsim
}
--energy --enable-compute-sharing --enable-dynamic-jobs --acknowledge-dynamic-jobs --enable-profile-reuse
"
)
schedcmd
=
f
"
batmen
{
quiet_batmen
}
--socket-endpoint=
{
socket_batsched
}
--nb_cores=
{
nb_cores
}
-v bin_packing_energy --variant_options_filepath=
{
uf
}
"
instance
=
RobinInstance
(
output_dir
=
EXPE_DIR
,
batcmd
=
batcmd
,
schedcmd
=
schedcmd
,
...
...
@@ -75,14 +80,14 @@ def run_expe(expe_num, user_category, window_size, clean_log):
print
(
f
"
Robin
{
EXPE_FILE
}
finished
"
)
# Remove the log files that can quickly become heavy...
if
clean_log
:
os
.
remove
(
f
"
{
EXPE_DIR
}
/log/batsim.log
"
)
os
.
remove
(
f
"
{
EXPE_DIR
}
/log/sched.err.log
"
)
os
.
remove
(
f
"
{
EXPE_DIR
}
/log/sched.out.log
"
)
#
if clean_log:
#
os.remove(f"{EXPE_DIR}/log/batsim.log")
#
os.remove(f"{EXPE_DIR}/log/sched.err.log")
#
os.remove(f"{EXPE_DIR}/log/sched.out.log")
def
start_instance
(
expe_num
,
start_date
,
prepare_workload
=
True
,
clean_log
=
False
):
def
start_instance
(
expe_num
,
start_date
,
prepare_workload
=
True
,
clean_log
=
False
,
only_degrad_temp
=
False
):
# Prepare workload
if
prepare_workload
:
prepare_input_data
(
expe_num
,
start_date
)
...
...
@@ -96,8 +101,12 @@ def start_instance(expe_num, start_date, prepare_workload=True, clean_log=False)
window_size
=
1
,
clean_log
=
clean_log
)
# 4*2 = 8 expe
for
behavior
in
[
"
dm_user_reconfig
"
,
"
dm_user_degrad_space
"
,
"
dm_user_renounce
"
,
"
dm_user_delay
"
]:
if
only_degrad_temp
:
bhvs
=
[
"
dm_user_degrad_temp
"
]
else
:
bhvs
=
[
"
dm_user_reconfig
"
,
"
dm_user_degrad_space
"
,
"
dm_user_degrad_temp
"
,
"
dm_user_renounce
"
,
"
dm_user_delay
"
]
for
behavior
in
bhvs
:
for
window_size
in
[
1
,
4
]:
run_expe
(
expe_num
,
behavior
,
window_size
,
clean_log
=
clean_log
)
...
...
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