Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
f7d2b014
Commit
f7d2b014
authored
11 years ago
by
Alejandro Lucero
Committed by
Danny Auble
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Adding a new field to job_queue_rec_t for improving sort_job_queue2
parent
8f75f133
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/slurmctld/job_scheduler.c
+11
-28
11 additions, 28 deletions
src/slurmctld/job_scheduler.c
src/slurmctld/job_scheduler.h
+1
-0
1 addition, 0 deletions
src/slurmctld/job_scheduler.h
with
12 additions
and
28 deletions
src/slurmctld/job_scheduler.c
+
11
−
28
View file @
f7d2b014
...
@@ -87,7 +87,7 @@ static char ** _build_env(struct job_record *job_ptr);
...
@@ -87,7 +87,7 @@ static char ** _build_env(struct job_record *job_ptr);
static
void
_depend_list_del
(
void
*
dep_ptr
);
static
void
_depend_list_del
(
void
*
dep_ptr
);
static
void
_feature_list_delete
(
void
*
x
);
static
void
_feature_list_delete
(
void
*
x
);
static
void
_job_queue_append
(
List
job_queue
,
struct
job_record
*
job_ptr
,
static
void
_job_queue_append
(
List
job_queue
,
struct
job_record
*
job_ptr
,
struct
part_record
*
part_ptr
);
struct
part_record
*
part_ptr
,
uint32_t
priority
);
static
void
_job_queue_rec_del
(
void
*
x
);
static
void
_job_queue_rec_del
(
void
*
x
);
static
bool
_job_runnable_test1
(
struct
job_record
*
job_ptr
,
static
bool
_job_runnable_test1
(
struct
job_record
*
job_ptr
,
bool
clear_start
);
bool
clear_start
);
...
@@ -134,13 +134,14 @@ static List _build_user_job_list(uint32_t user_id, char* job_name)
...
@@ -134,13 +134,14 @@ static List _build_user_job_list(uint32_t user_id, char* job_name)
}
}
static
void
_job_queue_append
(
List
job_queue
,
struct
job_record
*
job_ptr
,
static
void
_job_queue_append
(
List
job_queue
,
struct
job_record
*
job_ptr
,
struct
part_record
*
part_ptr
)
struct
part_record
*
part_ptr
,
uint32_t
prio
)
{
{
job_queue_rec_t
*
job_queue_rec
;
job_queue_rec_t
*
job_queue_rec
;
job_queue_rec
=
xmalloc
(
sizeof
(
job_queue_rec_t
));
job_queue_rec
=
xmalloc
(
sizeof
(
job_queue_rec_t
));
job_queue_rec
->
job_ptr
=
job_ptr
;
job_queue_rec
->
job_ptr
=
job_ptr
;
job_queue_rec
->
part_ptr
=
part_ptr
;
job_queue_rec
->
part_ptr
=
part_ptr
;
job_queue_rec
->
priority
=
prio
;
list_append
(
job_queue
,
job_queue_rec
);
list_append
(
job_queue
,
job_queue_rec
);
}
}
...
@@ -229,6 +230,7 @@ extern List build_job_queue(bool clear_start, bool backfill)
...
@@ -229,6 +230,7 @@ extern List build_job_queue(bool clear_start, bool backfill)
struct
job_record
*
job_ptr
=
NULL
;
struct
job_record
*
job_ptr
=
NULL
;
struct
part_record
*
part_ptr
;
struct
part_record
*
part_ptr
;
int
reason
;
int
reason
;
int
inx
;
job_queue
=
list_create
(
_job_queue_rec_del
);
job_queue
=
list_create
(
_job_queue_rec_del
);
job_iterator
=
list_iterator_create
(
job_list
);
job_iterator
=
list_iterator_create
(
job_list
);
...
@@ -239,6 +241,7 @@ extern List build_job_queue(bool clear_start, bool backfill)
...
@@ -239,6 +241,7 @@ extern List build_job_queue(bool clear_start, bool backfill)
if
(
job_ptr
->
part_ptr_list
)
{
if
(
job_ptr
->
part_ptr_list
)
{
part_iterator
=
list_iterator_create
(
job_ptr
->
part_iterator
=
list_iterator_create
(
job_ptr
->
part_ptr_list
);
part_ptr_list
);
inx
=
0
;
while
((
part_ptr
=
(
struct
part_record
*
)
while
((
part_ptr
=
(
struct
part_record
*
)
list_next
(
part_iterator
)))
{
list_next
(
part_iterator
)))
{
job_ptr
->
part_ptr
=
part_ptr
;
job_ptr
->
part_ptr
=
part_ptr
;
...
@@ -250,7 +253,9 @@ extern List build_job_queue(bool clear_start, bool backfill)
...
@@ -250,7 +253,9 @@ extern List build_job_queue(bool clear_start, bool backfill)
}
}
if
(
reason
!=
WAIT_NO_REASON
)
if
(
reason
!=
WAIT_NO_REASON
)
continue
;
continue
;
_job_queue_append
(
job_queue
,
job_ptr
,
part_ptr
);
_job_queue_append
(
job_queue
,
job_ptr
,
part_ptr
,
job_ptr
->
priority_array
[
inx
]);
inx
++
;
}
}
list_iterator_destroy
(
part_iterator
);
list_iterator_destroy
(
part_iterator
);
}
else
{
}
else
{
...
@@ -270,7 +275,7 @@ extern List build_job_queue(bool clear_start, bool backfill)
...
@@ -270,7 +275,7 @@ extern List build_job_queue(bool clear_start, bool backfill)
if
(
!
_job_runnable_test2
(
job_ptr
,
backfill
))
if
(
!
_job_runnable_test2
(
job_ptr
,
backfill
))
continue
;
continue
;
_job_queue_append
(
job_queue
,
job_ptr
,
_job_queue_append
(
job_queue
,
job_ptr
,
job_ptr
->
part_ptr
);
job_ptr
->
part_ptr
,
job_ptr
->
priority
);
}
}
}
}
list_iterator_destroy
(
job_iterator
);
list_iterator_destroy
(
job_iterator
);
...
@@ -1113,35 +1118,13 @@ extern int sort_job_queue2(void *x, void *y)
...
@@ -1113,35 +1118,13 @@ extern int sort_job_queue2(void *x, void *y)
p1
=
job_rec1
->
job_ptr
->
priority
;
p1
=
job_rec1
->
job_ptr
->
priority
;
if
(
job_rec1
->
job_ptr
->
part_ptr_list
&&
if
(
job_rec1
->
job_ptr
->
part_ptr_list
&&
job_rec1
->
job_ptr
->
priority_array
)
{
job_rec1
->
job_ptr
->
priority_array
)
{
int
i
=
0
;
p1
=
job_rec1
->
priority
;
part_iterator
=
list_iterator_create
(
job_rec1
->
job_ptr
->
part_ptr_list
);
while
((
part_ptr
=
(
struct
part_record
*
)
list_next
(
part_iterator
)))
{
if
(
job_rec1
->
part_ptr
==
part_ptr
)
{
p1
=
job_rec1
->
job_ptr
->
priority_array
[
i
];
break
;
}
i
++
;
}
list_iterator_destroy
(
part_iterator
);
}
}
p2
=
job_rec2
->
job_ptr
->
priority
;
p2
=
job_rec2
->
job_ptr
->
priority
;
if
(
job_rec2
->
job_ptr
->
part_ptr_list
&&
if
(
job_rec2
->
job_ptr
->
part_ptr_list
&&
job_rec2
->
job_ptr
->
priority_array
)
{
job_rec2
->
job_ptr
->
priority_array
)
{
int
i
=
0
;
p2
=
job_rec2
->
priority
;
part_iterator
=
list_iterator_create
(
job_rec2
->
job_ptr
->
part_ptr_list
);
while
((
part_ptr
=
(
struct
part_record
*
)
list_next
(
part_iterator
)))
{
if
(
job_rec2
->
part_ptr
==
part_ptr
)
{
p2
=
job_rec2
->
job_ptr
->
priority_array
[
i
];
break
;
}
i
++
;
}
list_iterator_destroy
(
part_iterator
);
}
}
if
(
p1
<
p2
)
if
(
p1
<
p2
)
...
...
This diff is collapsed.
Click to expand it.
src/slurmctld/job_scheduler.h
+
1
−
0
View file @
f7d2b014
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
typedef
struct
job_queue_rec
{
typedef
struct
job_queue_rec
{
struct
job_record
*
job_ptr
;
struct
job_record
*
job_ptr
;
struct
part_record
*
part_ptr
;
struct
part_record
*
part_ptr
;
uint32_t
priority
;
}
job_queue_rec_t
;
}
job_queue_rec_t
;
/*
/*
...
...
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