Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
batmen
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
mael
batmen
Commits
a37bfb3d
Commit
a37bfb3d
authored
2 years ago
by
jgatt
Browse files
Options
Downloads
Patches
Plain Diff
added degrad_space_job and degrad_time_job function + yellow behavior split monocore + multicore
parent
5c4aab16
No related branches found
No related tags found
1 merge request
!20
merge requested multibehavor_mono_multi_core
Pipeline
#5892
passed
2 years ago
Stage: build-and-test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/users/user_windows.cpp
+57
-20
57 additions, 20 deletions
src/users/user_windows.cpp
src/users/user_windows.hpp
+6
-2
6 additions, 2 deletions
src/users/user_windows.hpp
with
63 additions
and
22 deletions
src/users/user_windows.cpp
+
57
−
20
View file @
a37bfb3d
...
...
@@ -138,7 +138,26 @@ bool DMUserMultiBehavior::rigid_job(shared_ptr<Job> job, Profile *profile)
+=
job
->
nb_requested_resources
*
std
::
stol
(
job
->
profile
);
return
true
;
}
bool
DMUserMultiBehavior
::
degrad_space_job
(
shared_ptr
<
Job
>
&
job
,
Profile
*
profile
)
{
return
degrad_job
(
job
,
profile
);
}
bool
DMUserMultiBehavior
::
degrad_time_job
(
shared_ptr
<
Job
>
&
job
,
Profile
*
profile
)
{
/* Log... */
dm_stat
[
2
*
DEGRADED
]
++
;
dm_stat
[
2
*
DEGRADED
+
1
]
+=
(
job
->
nb_requested_resources
)
*
std
::
stol
(
job
->
profile
);
/* time degrad: divide by two the execution time */
long
original_time
=
std
::
stol
(
job
->
profile
);
long
new_time
=
original_time
/
2
;
Parser
::
profile_from_duration
(
profile
,
std
::
to_string
(
new_time
),
user_name
,
platform_computing_speed
);
job
->
profile
=
profile
->
name
=
'd'
+
std
::
to_string
(
original_time
);
return
true
;
}
bool
DMUserMultiBehavior
::
red_window_behavior_mono_core
(
double
date
,
shared_ptr
<
Job
>
job
,
Profile
*
profile
)
{
double
behavior
=
distribution
(
random_gen
)
*
red_prob_total
;
...
...
@@ -161,7 +180,7 @@ bool DMUserMultiBehavior::red_window_behavior_mono_core(double date, shared_ptr<
if
(
behavior
<
total_probability
){
log_behavior
(
job
,
"consider_degrad"
,
0
);
log_behavior
(
job
,
"rigid"
,
0
);
return
degrad_job
(
job
,
profile
);
return
degrad_
space_
job
(
job
,
profile
);
}
/* Reconfig */
total_probability
+=
red_prob
[
R_RECONFIG
];
...
...
@@ -196,7 +215,7 @@ bool DMUserMultiBehavior::red_window_behavior_multi_core(double date, shared_ptr
if
(
behavior
<
total_probability
){
log_behavior
(
job
,
"consider_degrad"
,
0
);
log_behavior
(
job
,
"degrad"
,
0
);
return
degrad_job
(
job
,
profile
);
return
degrad_
space_
job
(
job
,
profile
);
}
/* Reconfig */
total_probability
+=
red_prob
[
R_RECONFIG
];
...
...
@@ -210,7 +229,7 @@ bool DMUserMultiBehavior::red_window_behavior_multi_core(double date, shared_ptr
return
rigid_job
(
job
,
profile
);
}
bool
DMUserMultiBehavior
::
red_window_behavior
(
double
date
,
shared_ptr
<
Job
>
job
,
Profile
*
profile
)
bool
DMUserMultiBehavior
::
red_window_behavior
(
double
date
,
shared_ptr
<
Job
>
&
job
,
Profile
*
profile
)
{
/*
* We decide at random the behavior
...
...
@@ -226,37 +245,55 @@ bool DMUserMultiBehavior::red_window_behavior(double date,shared_ptr<Job> job,Pr
}
}
bool
DMUserMultiBehavior
::
yellow_window_behavior
(
shared_ptr
<
Job
>
job
,
Profile
*
profile
){
/*
* We decide at random the behavior (rigid, degrad, reconfig)
* that will be done on this job
*/
bool
DMUserMultiBehavior
::
yellow_window_behavior_mono_core
(
shared_ptr
<
Job
>
job
,
Profile
*
profile
)
{
double
behavior
=
distribution
(
random_gen
)
*
yellow_prob_total
;
double
total_probability
=
0.0
;
total_probability
+=
yellow_prob
[
Y_RECONFIG
];
if
(
behavior
<
total_probability
){
log_behavior
(
job
,
"consider_reconfig"
,
0
);
if
(
job
->
nb_requested_resources
==
1
){
log_behavior
(
job
,
"rigid"
,
0
);
}
else
{
log_behavior
(
job
,
"reconfig"
,
0
);
}
log_behavior
(
job
,
"rigid"
,
0
);
return
reconfig_job
(
job
,
profile
);
}
total_probability
+=
yellow_prob
[
Y_DEGRAD
];
if
(
behavior
<
total_probability
){
log_behavior
(
job
,
"consider_degrad"
,
0
);
if
(
job
->
nb_requested_resources
==
1
){
log_behavior
(
job
,
"rigid"
,
0
);
}
else
{
log_behavior
(
job
,
"degrad"
,
0
);
}
log_behavior
(
job
,
"rigid"
,
0
);
return
degrad_job
(
job
,
profile
);
}
// if none of the above we launch the job without i.e. rigid strategy
return
rigid_job
(
job
,
profile
);
}
bool
DMUserMultiBehavior
::
yellow_window_behavior_multi_core
(
shared_ptr
<
Job
>
job
,
Profile
*
profile
)
{
double
behavior
=
distribution
(
random_gen
)
*
yellow_prob_total
;
double
total_probability
=
0.0
;
total_probability
+=
yellow_prob
[
Y_RECONFIG
];
if
(
behavior
<
total_probability
){
log_behavior
(
job
,
"consider_reconfig"
,
0
);
log_behavior
(
job
,
"reconfig"
,
0
);
return
reconfig_job
(
job
,
profile
);
}
total_probability
+=
yellow_prob
[
Y_DEGRAD
];
if
(
behavior
<
total_probability
){
log_behavior
(
job
,
"consider_degrad"
,
0
);
log_behavior
(
job
,
"degrad"
,
0
);
return
degrad_job
(
job
,
profile
);
}
// if none of the above we launch the job without i.e. rigid strategy
return
rigid_job
(
job
,
profile
);
}
bool
DMUserMultiBehavior
::
yellow_window_behavior
(
shared_ptr
<
Job
>
&
job
,
Profile
*
profile
){
/*
* We decide at random the behavior (rigid, degrad, reconfig)
* that will be done on this job
*/
if
(
job
->
nb_requested_resources
==
1
){
return
yellow_window_behavior_mono_core
(
job
,
profile
);
}
else
{
return
yellow_window_behavior_multi_core
(
job
,
profile
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/users/user_windows.hpp
+
6
−
2
View file @
a37bfb3d
...
...
@@ -64,6 +64,8 @@ protected:
bool
is_in_red_window
(
double
date
);
void
log_behavior
(
shared_ptr
<
Job
>
&
job
,
std
::
string
behavior_name
,
long
delay_time
);
bool
rigid_job
(
shared_ptr
<
Job
>
job
,
Profile
*
profile
);
bool
degrad_space_job
(
shared_ptr
<
Job
>
&
job
,
Profile
*
profile
);
bool
degrad_time_job
(
shared_ptr
<
Job
>
&
job
,
Profile
*
profile
);
bool
C_you_later_job
(
double
date
,
double
next_time
,
shared_ptr
<
Job
>
job
);
/**
...
...
@@ -83,7 +85,7 @@ protected:
* (degrad,reconfig,renonce,rigid,see_you_later)
* following the provided probabilities given at the creation of the class
*/
bool
red_window_behavior
(
double
date
,
shared_ptr
<
Job
>
job
,
Profile
*
profile
);
bool
red_window_behavior
(
double
date
,
shared_ptr
<
Job
>
&
job
,
Profile
*
profile
);
bool
red_window_behavior_mono_core
(
double
date
,
shared_ptr
<
Job
>
job
,
Profile
*
profile
);
bool
red_window_behavior_multi_core
(
double
date
,
shared_ptr
<
Job
>
job
,
Profile
*
profile
);
/**
...
...
@@ -91,7 +93,9 @@ protected:
* @details This function do the 3 behaviors for yellow windows (degrad,reconfig, rigid)
* following the provided probabilities given at the creation of the class
*/
bool
yellow_window_behavior
(
shared_ptr
<
Job
>
job
,
Profile
*
profile
);
bool
yellow_window_behavior
(
shared_ptr
<
Job
>
&
job
,
Profile
*
profile
);
bool
yellow_window_behavior_mono_core
(
shared_ptr
<
Job
>
job
,
Profile
*
profile
);
bool
yellow_window_behavior_multi_core
(
shared_ptr
<
Job
>
job
,
Profile
*
profile
);
std
::
vector
<
double
>
red_prob
;
double
red_prob_total
;
std
::
vector
<
double
>
yellow_prob
;
...
...
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