Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gpusched_parser
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GPUSched
gpusched_parser
Commits
5596bdbb
Commit
5596bdbb
authored
1 year ago
by
Nordine Feddal
Browse files
Options
Downloads
Patches
Plain Diff
added the minimal time at which a step can start its execution
parent
4a4eb2e7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gpusched_result/gpusched_result.py
+33
-12
33 additions, 12 deletions
src/gpusched_result/gpusched_result.py
with
33 additions
and
12 deletions
src/gpusched_result/gpusched_result.py
+
33
−
12
View file @
5596bdbb
class
GPUSchedStepParams
:
# Global Struct params
ARRAY
=
"
\t
const int * jobs_array;
\n
"
STEP_NO
=
"
\t
int step_no;
\n
"
TIME
=
"
\t
int time;
\n
"
NUMBER_KERNELS
=
"
\t
int number_kernel;
\n
"
MINIMAL_START_TIME
=
"
\t
int minimal_start;
\n
"
# Impl struct params
ARRAY_IMPL
=
"
\t
.jobs_array = ((const int[{SIZE}]){{{list_jobs}}}),
\n
"
STEP_NO_IMPL
=
"
\t
.step_no = {step_no},
\n
"
TIME_IMPL
=
"
\t
.time = 0,
\n
"
NUMBER_KERNELS_IMPL
=
"
\t
.number_kernel = {number_kernel}
\n
"
MINIMAL_START_TIME_IMPL
=
"
\t
.minimal_time_start = {minimal_start}
\n
"
# Struct name
STRUCT_NAME
=
"
gpusched_step_t
"
LIST_JOBS_OBJECT
=
[]
def
dump_struct
():
dump
=
"
struct gpusched_step_t {
\n
"
...
...
@@ -22,6 +25,7 @@ class GPUSchedStepParams:
dump
+=
GPUSchedStepParams
.
STEP_NO
dump
+=
GPUSchedStepParams
.
TIME
dump
+=
GPUSchedStepParams
.
NUMBER_KERNELS
dump
+=
GPUSchedStepParams
.
MINIMAL_START_TIME
dump
+=
"
};
\n\n
"
return
dump
...
...
@@ -56,7 +60,7 @@ class GPUSchedResultStep:
if
number_kernels
!=
1
:
self
.
str_list_jobs
=
'
,
'
.
join
(
self
.
list_jobs
)
else
:
self
.
str_list_jobs
=
list_jobs
self
.
str_list_jobs
=
str
(
list_jobs
)
self
.
dump_str
()
def
dump_str
(
self
):
...
...
@@ -66,6 +70,23 @@ class GPUSchedResultStep:
dump
+=
GPUSchedStepParams
.
STEP_NO_IMPL
.
format
(
step_no
=
self
.
step_no
)
dump
+=
GPUSchedStepParams
.
TIME_IMPL
dump
+=
GPUSchedStepParams
.
NUMBER_KERNELS_IMPL
.
format
(
number_kernel
=
self
.
number_kernels
)
dump
+=
GPUSchedStepParams
.
MINIMAL_START_TIME_IMPL
.
format
(
minimal_start
=
get_max_job_arrival_time
(
self
.
list_jobs
))
dump
+=
"
};
\n\n
"
;
return
dump
;
"""
Retrieve the job within a list of jobs with the maximal arrival time
@param:
jobs list of jobs
"""
def
get_max_job_arrival_time
(
jobs
):
max_time
=
-
1
if
type
(
jobs
)
==
str
:
max_time
=
int
(
GPUSchedStepParams
.
LIST_JOBS_OBJECT
[
int
(
jobs
,
10
)].
arrival_time
,
10
)
else
:
for
job_id
in
jobs
:
curr_arrival_time
=
int
(
GPUSchedStepParams
.
LIST_JOBS_OBJECT
[
int
(
job_id
,
10
)].
arrival_time
,
10
)
if
max_time
<
curr_arrival_time
:
max_time
=
curr_arrival_time
return
max_time
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