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
78c6ddae
Commit
78c6ddae
authored
2 years ago
by
jgatt
Browse files
Options
Downloads
Patches
Plain Diff
factorize code with rigid_job function + small enum change
parent
c13d20f1
No related branches found
No related tags found
1 merge request
!16
Merge request multibehavior
Pipeline
#5524
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
+15
-19
15 additions, 19 deletions
src/users/user_windows.cpp
src/users/user_windows.hpp
+3
-2
3 additions, 2 deletions
src/users/user_windows.hpp
with
18 additions
and
21 deletions
src/users/user_windows.cpp
+
15
−
19
View file @
78c6ddae
...
...
@@ -132,6 +132,18 @@ bool DMUserMultiBehavior::C_you_later_job(double date, double next_time,shared_p
return
false
;
}
bool
DMUserMultiBehavior
::
rigid_job
(
shared_ptr
<
Job
>
job
,
Profile
*
profile
)
{
log_behavior
(
job
,
"rigid"
,
0
);
Parser
::
profile_from_duration
(
profile
,
job
->
profile
,
user_name
,
platform_computing_speed
);
dm_stat
[
2
*
RIGID
]
++
;
dm_stat
[
2
*
RIGID
+
1
]
+=
job
->
nb_requested_resources
*
std
::
stol
(
job
->
profile
);
return
true
;
}
bool
DMUserMultiBehavior
::
red_window_behavior
(
double
date
,
shared_ptr
<
Job
>
job
,
Profile
*
profile
)
{
/*
...
...
@@ -181,13 +193,7 @@ bool DMUserMultiBehavior::red_window_behavior(double date,shared_ptr<Job> job,Pr
}
/* if none of the above we launch the job without changing anything
Rigid strategy*/
log_behavior
(
job
,
"rigid"
,
0
);
Parser
::
profile_from_duration
(
profile
,
job
->
profile
,
user_name
,
platform_computing_speed
);
dm_stat
[
2
*
RIGID
]
++
;
dm_stat
[
2
*
RIGID
+
1
]
+=
job
->
nb_requested_resources
*
std
::
stol
(
job
->
profile
);
return
true
;
return
rigid_job
(
job
,
profile
);
}
bool
DMUserMultiBehavior
::
yellow_window_behavior
(
shared_ptr
<
Job
>
job
,
Profile
*
profile
){
...
...
@@ -220,11 +226,7 @@ bool DMUserMultiBehavior::yellow_window_behavior(shared_ptr<Job> job,Profile *pr
return
degrad_job
(
job
,
profile
);
}
// if none of the above we launch the job without i.e. rigid strategy
log_behavior
(
job
,
"rigid"
,
0
);
Parser
::
profile_from_duration
(
profile
,
job
->
profile
,
user_name
,
platform_computing_speed
);
dm_stat
[
2
*
RIGID
]
++
;
dm_stat
[
2
*
RIGID
+
1
]
+=
job
->
nb_requested_resources
*
std
::
stol
(
job
->
profile
);
return
true
;
return
rigid_job
(
job
,
profile
);
}
...
...
@@ -283,12 +285,6 @@ bool DMUserMultiBehavior::handle_job(double date, shared_ptr<Job> job, Profile *
}
else
{
log_behavior
(
job
,
"rigid"
,
0
);
Parser
::
profile_from_duration
(
profile
,
job
->
profile
,
user_name
,
platform_computing_speed
);
dm_stat
[
2
*
RIGID
]
++
;
dm_stat
[
2
*
RIGID
+
1
]
+=
job
->
nb_requested_resources
*
std
::
stol
(
job
->
profile
);
return
true
;
return
rigid_job
(
job
,
profile
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/users/user_windows.hpp
+
3
−
2
View file @
78c6ddae
...
...
@@ -47,8 +47,8 @@ public:
protected:
enum
red_behavior
{
R_DEGRAD
=
0
,
R_RECONFIG
=
1
,
R_RENONCE
=
2
,
R_RIGID
=
3
,
R_C_YOU_LATER
=
4
,
R_TOTAL
=
5
};
enum
yellow_behavior
{
Y_DEGRAD
=
0
,
Y_RECONFIG
=
1
,
Y_RIGID
=
2
,
Y_TOTAL
=
3
};
enum
red_behavior
{
R_DEGRAD
,
R_RECONFIG
,
R_RENONCE
,
R_RIGID
,
R_C_YOU_LATER
,
R_TOTAL
};
enum
yellow_behavior
{
Y_DEGRAD
,
Y_RECONFIG
,
Y_RIGID
,
Y_TOTAL
};
DMWindow_list
*
yellow_windows
;
DMWindow_list
*
red_windows
;
DMWindow
*
red_window_buffer
;
...
...
@@ -62,6 +62,7 @@ protected:
bool
is_in_yellow_window
(
double
date
);
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
C_you_later_job
(
double
date
,
double
next_time
,
shared_ptr
<
Job
>
job
);
/**
...
...
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