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
Merge requests
!10
Better memory management and float rounding issues
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Better memory management and float rounding issues
issue12
into
master
Overview
0
Commits
6
Pipelines
1
Changes
6
Merged
Ghost User
requested to merge
issue12
into
master
2 years ago
Overview
0
Commits
6
Pipelines
1
Changes
6
Expand
0
0
Merge request reports
Viewing commit
16368e56
Prev
Next
Show latest version
6 files
+
37
−
40
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
16368e56
refac: core_per_user checked by broker instead of dynsched
· 16368e56
Maël Madon
authored
2 years ago
src/users/broker.cpp
+
23
−
3
Options
@@ -15,6 +15,16 @@ Broker::Broker(rapidjson::Document *user_description_file)
/* Parse description file and call constructor for each user */
if
(
!
user_description_file
->
ObjectEmpty
())
{
if
(
user_description_file
->
HasMember
(
"core_limit_per_user"
))
{
PPK_ASSERT_ERROR
(
(
*
user_description_file
)[
"core_limit_per_user"
].
IsInt
(),
"Invalid user_description file: field "
"'core_limit_per_user' should be an int."
);
core_limit_per_user
=
(
*
user_description_file
)[
"core_limit_per_user"
].
GetInt
();
// otherwise, initialized at std::numeric_limits<int>::max()
}
if
(
user_description_file
->
HasMember
(
"dm_window"
))
{
const
Value
&
dm_param
=
(
*
user_description_file
)[
"dm_window"
];
@@ -171,15 +181,25 @@ void Broker::jobs_to_submit(
while
(
planned_date_submission
==
user
->
next_submission
())
{
user_queue
.
pop_front
();
unsigned
int
nb_core_requested
=
0
;
list
<
Job
*>
user_jobs
;
list
<
const
Profile
*>
user_profiles
;
user
->
jobs_to_submit
(
date
,
user_jobs
,
user_profiles
);
for
(
Job
*
job
:
user_jobs
)
{
jobs
.
push_back
(
job
);
dynamic_jobs
[
job
->
id
]
=
job
;
job
->
status
=
WAITING
;
nb_core_requested
=
nb_core_requested
+
job
->
nb_requested_resources
;
if
(
nb_core_requested
>
core_limit_per_user
)
{
job
->
status
=
KILLED
;
}
else
{
jobs
.
push_back
(
job
);
dynamic_jobs
[
job
->
id
]
=
job
;
job
->
status
=
WAITING
;
}
}
profiles
.
splice
(
profiles
.
end
(),
user_profiles
);
Loading