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
eb9650bc
Commit
eb9650bc
authored
2 years ago
by
jgatt
Browse files
Options
Downloads
Patches
Plain Diff
move comment + small code change
parent
3d42df63
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!12
Merge Request multibehavior
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/users/user_windows.cpp
+7
-10
7 additions, 10 deletions
src/users/user_windows.cpp
src/users/user_windows.hpp
+10
-1
10 additions, 1 deletion
src/users/user_windows.hpp
with
17 additions
and
11 deletions
src/users/user_windows.cpp
+
7
−
10
View file @
eb9650bc
...
...
@@ -91,14 +91,14 @@ DMUserMultiBehavior::~DMUserMultiBehavior()
if
(
original_trace
)
{
delete
original_trace
;
original_trace
=
NULL
;
original_trace
=
nullptr
;
}
}
void
DMUserMultiBehavior
::
jobs_to_submit
(
double
date
,
std
::
list
<
shared_ptr
<
Job
>>
&
jobs
,
std
::
list
<
const
Profile
*>
&
profiles
)
{
DMUserRenonce
::
jobs_to_submit
(
date
,
jobs
,
profiles
);
ReplayUser
::
jobs_to_submit
(
date
,
jobs
,
profiles
);
}
bool
DMUserMultiBehavior
::
C_you_later_job
(
double
date
,
double
next_time
,
shared_ptr
<
Job
>
job
)
...
...
@@ -140,6 +140,7 @@ bool DMUserMultiBehavior::red_window_behavior(double date,shared_ptr<Job> job,Pr
}
else
if
(
behavior
<
red_prob_degrad
+
red_prob_Cyoulater
+
red_prob_renonce
){
log_behavior
(
job
,
"consider_degrad"
,
0
);
if
(
job
->
nb_requested_resources
==
1
){
log_behavior
(
job
,
"rigid"
,
0
);
}
...
...
@@ -151,6 +152,7 @@ bool DMUserMultiBehavior::red_window_behavior(double date,shared_ptr<Job> job,Pr
else
if
(
behavior
<
red_prob_degrad
+
red_prob_Cyoulater
+
red_prob_renonce
+
red_prob_reconfig
){
log_behavior
(
job
,
"consider_reconfig"
,
0
);
if
(
job
->
nb_requested_resources
==
1
){
log_behavior
(
job
,
"rigid"
,
0
);
}
...
...
@@ -178,6 +180,7 @@ bool DMUserMultiBehavior::yellow_window_behavior(shared_ptr<Job> job,Profile *pr
*/
double
behavior
=
distribution
(
random_gen
)
*
yellow_prob_total
;
if
(
behavior
<
yellow_prob_reconfig
){
log_behavior
(
job
,
"consider_reconfig"
,
0
);
if
(
job
->
nb_requested_resources
==
1
){
log_behavior
(
job
,
"rigid"
,
0
);
}
...
...
@@ -187,6 +190,7 @@ bool DMUserMultiBehavior::yellow_window_behavior(shared_ptr<Job> job,Profile *pr
return
reconfig_job
(
job
,
profile
);
}
else
if
(
behavior
<
yellow_prob_reconfig
+
yellow_prob_degrad
){
log_behavior
(
job
,
"consider_degrad"
,
0
);
if
(
job
->
nb_requested_resources
==
1
){
log_behavior
(
job
,
"rigid"
,
0
);
}
...
...
@@ -247,14 +251,7 @@ bool DMUserMultiBehavior::is_in_yellow_window(double date){
}
bool
DMUserMultiBehavior
::
handle_job
(
double
date
,
shared_ptr
<
Job
>
job
,
Profile
*
profile
)
{
/*
* function called each time the user want to submit a job it does the following :
* - if the user is in a red window
* the user adopt the behavior define in red_window_behavior
* - if the user is in a yellow window AND not in a red one
* the user adopt the behavior define in yellow_windows_behavior
* - else the user submit it job without any change
*/
//red_windows and dm_windows check
if
(
is_in_red_window
(
date
))
{
return
red_window_behavior
(
date
,
job
,
profile
);
}
...
...
This diff is collapsed.
Click to expand it.
src/users/user_windows.hpp
+
10
−
1
View file @
eb9650bc
...
...
@@ -58,7 +58,16 @@ protected:
=
std
::
uniform_real_distribution
<
double
>
(
0.0
,
1.0
);
LoggerUserStat
*
logger
=
nullptr
;
bool
C_you_later_job
(
double
date
,
double
next_time
,
shared_ptr
<
Job
>
job
);
bool
handle_job
(
double
date
,
shared_ptr
<
Job
>
job
,
Profile
*
profile
);
/**
* function called each time the user want to submit a job it does the following :
* - if the user is in a red window
* the user adopt the behavior define in red_window_behavior
* - if the user is in a yellow window AND not in a red one
* the user adopt the behavior define in yellow_windows_behavior
* - else the user submit it job without any change
*/
bool
handle_job
(
double
date
,
shared_ptr
<
Job
>
job
,
Profile
*
profile
){};
bool
red_window_behavior
(
double
date
,
shared_ptr
<
Job
>
job
,
Profile
*
profile
);
bool
yellow_window_behavior
(
shared_ptr
<
Job
>
job
,
Profile
*
profile
);
double
red_prob_Cyoulater
,
red_prob_renonce
,
red_prob_reconfig
,
red_prob_degrad
;
...
...
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