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
a73721b2
Commit
a73721b2
authored
18 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Multi-core bug fix, mask re-use with multiple job steps,
patch.1.2.0-pre10.061214.affinity_stepid from Dan Palermo (HP).
parent
004fa614
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NEWS
+2
-0
2 additions, 0 deletions
NEWS
src/plugins/task/affinity/dist_tasks.c
+44
-34
44 additions, 34 deletions
src/plugins/task/affinity/dist_tasks.c
with
46 additions
and
34 deletions
NEWS
+
2
−
0
View file @
a73721b2
...
@@ -9,6 +9,8 @@ documents those changes that are of interest to users and admins.
...
@@ -9,6 +9,8 @@ documents those changes that are of interest to users and admins.
list of processes running on the node. Cutting down a lot of unnecessary
list of processes running on the node. Cutting down a lot of unnecessary
file opens in linux and cutting down the time to query the procs by
file opens in linux and cutting down the time to query the procs by
more than half.
more than half.
-- Multi-core bug fix, mask re-use with multiple job steps,
patch.1.2.0-pre10.061214.affinity_stepid from Dan Palermo (HP).
* Changes in SLURM 1.2.0-pre10
* Changes in SLURM 1.2.0-pre10
==============================
==============================
...
...
This diff is collapsed.
Click to expand it.
src/plugins/task/affinity/dist_tasks.c
+
44
−
34
View file @
a73721b2
...
@@ -1085,23 +1085,25 @@ static int _task_layout_lllp_plane(launch_tasks_request_msg_t *req,
...
@@ -1085,23 +1085,25 @@ static int _task_layout_lllp_plane(launch_tasks_request_msg_t *req,
*
*
*/
*/
typedef
struct
{
typedef
struct
{
uint32_t
jobid
;
uint32_t
jobid
;
uint32_t
jobstepid
;
uint32_t
numtasks
;
uint32_t
numtasks
;
cpu_bind_type_t
cpu_bind_type
;
cpu_bind_type_t
cpu_bind_type
;
char
*
cpu_bind
;
char
*
cpu_bind
;
}
lllp_job_state_t
;
}
lllp_job_state_t
;
static
lllp_job_state_t
*
static
lllp_job_state_t
*
_lllp_job_state_create
(
uint32_t
job_id
,
_lllp_job_state_create
(
uint32_t
job_id
,
uint32_t
job_step_id
,
cpu_bind_type_t
cpu_bind_type
,
char
*
cpu_bind
,
cpu_bind_type_t
cpu_bind_type
,
char
*
cpu_bind
,
uint32_t
numtasks
)
uint32_t
numtasks
)
{
{
lllp_job_state_t
*
j
;
lllp_job_state_t
*
j
;
debug3
(
"creating job
%d
lllp state"
,
job_id
);
debug3
(
"creating job
[%u.%u]
lllp state"
,
job_id
,
job_step_id
);
j
=
xmalloc
(
sizeof
(
lllp_job_state_t
));
j
=
xmalloc
(
sizeof
(
lllp_job_state_t
));
j
->
jobid
=
job_id
;
j
->
jobid
=
job_id
;
j
->
jobstepid
=
job_step_id
;
j
->
numtasks
=
numtasks
;
j
->
numtasks
=
numtasks
;
j
->
cpu_bind_type
=
cpu_bind_type
;
j
->
cpu_bind_type
=
cpu_bind_type
;
j
->
cpu_bind
=
NULL
;
j
->
cpu_bind
=
NULL
;
...
@@ -1115,13 +1117,16 @@ _lllp_job_state_create(uint32_t job_id,
...
@@ -1115,13 +1117,16 @@ _lllp_job_state_create(uint32_t job_id,
static
void
static
void
_lllp_job_state_destroy
(
lllp_job_state_t
*
j
)
_lllp_job_state_destroy
(
lllp_job_state_t
*
j
)
{
{
debug3
(
"destroying job
%d
lllp state"
,
j
->
jobid
);
debug3
(
"destroying job
[%u.%u]
lllp state"
,
j
->
jobid
,
j
->
jobstepid
);
if
(
j
)
{
if
(
j
)
{
if
(
j
->
cpu_bind
)
if
(
j
->
cpu_bind
)
xfree
(
j
->
cpu_bind
);
xfree
(
j
->
cpu_bind
);
xfree
(
j
);
xfree
(
j
);
}
}
}
}
#if 0
/* Note: now inline in cr_release_lllp to support multiple job steps */
static lllp_job_state_t *
static lllp_job_state_t *
_find_lllp_job_state(uint32_t jobid)
_find_lllp_job_state(uint32_t jobid)
{
{
...
@@ -1147,9 +1152,10 @@ _remove_lllp_job_state(uint32_t jobid)
...
@@ -1147,9 +1152,10 @@ _remove_lllp_job_state(uint32_t jobid)
}
}
list_iterator_destroy(i);
list_iterator_destroy(i);
}
}
#endif
void
void
_
insert
_lllp_job_state
(
lllp_job_state_t
*
j
)
_
append
_lllp_job_state
(
lllp_job_state_t
*
j
)
{
{
list_append
(
lllp_ctx
->
job_list
,
j
);
list_append
(
lllp_ctx
->
job_list
,
j
);
}
}
...
@@ -1548,7 +1554,7 @@ static void _cr_update_reservation(int reserve, uint32_t *reserved,
...
@@ -1548,7 +1554,7 @@ static void _cr_update_reservation(int reserve, uint32_t *reserved,
}
}
}
}
static
void
_cr_update_lllp
(
int
reserve
,
static
void
_cr_update_lllp
(
int
reserve
,
uint32_t
job_id
,
uint32_t
job_step_id
,
cpu_bind_type_t
cpu_bind_type
,
char
*
cpu_bind
,
cpu_bind_type_t
cpu_bind_type
,
char
*
cpu_bind
,
uint32_t
numtasks
)
uint32_t
numtasks
)
{
{
...
@@ -1596,7 +1602,8 @@ static void _cr_update_lllp(int reserve,
...
@@ -1596,7 +1602,8 @@ static void _cr_update_lllp(int reserve,
}
else
{
}
else
{
strcpy
(
buf_action
,
"release"
);
strcpy
(
buf_action
,
"release"
);
}
}
info
(
"LLLP update %s: %s (Proc ID %d...0)"
,
buf_action
,
buffer
,
num_bits
-
1
);
info
(
"LLLP update %s [%u.%u]: %s (CPU IDs: %d...0)"
,
buf_action
,
job_id
,
job_step_id
,
buffer
,
num_bits
-
1
);
}
}
}
}
...
@@ -1610,15 +1617,15 @@ void cr_reserve_lllp(uint32_t job_id,
...
@@ -1610,15 +1617,15 @@ void cr_reserve_lllp(uint32_t job_id,
uint32_t
numtasks
=
0
;
uint32_t
numtasks
=
0
;
char
buf_type
[
100
];
char
buf_type
[
100
];
debug3
(
"reserve LLLP job
%d
\n
"
,
job_id
);
debug3
(
"reserve LLLP job
[%u.%u]
\n
"
,
job_id
,
req
->
job_step_id
);
if
(
req
->
tasks_to_launch
)
{
if
(
req
->
tasks_to_launch
)
{
numtasks
=
req
->
tasks_to_launch
[
node_id
];
numtasks
=
req
->
tasks_to_launch
[
node_id
];
}
}
slurm_sprint_cpu_bind_type
(
buf_type
,
cpu_bind_type
);
slurm_sprint_cpu_bind_type
(
buf_type
,
cpu_bind_type
);
debug3
(
"reserve lllp job
%d
: %d tasks; %s[%d], %s"
,
debug3
(
"reserve lllp job
[%u.%u]
: %d tasks; %s[%d], %s"
,
job_id
,
numtasks
,
job_id
,
req
->
job_step_id
,
numtasks
,
buf_type
,
cpu_bind_type
,
cpu_bind
);
buf_type
,
cpu_bind_type
,
cpu_bind
);
if
(
cpu_bind_type
==
0
)
if
(
cpu_bind_type
==
0
)
return
;
return
;
...
@@ -1627,46 +1634,49 @@ void cr_reserve_lllp(uint32_t job_id,
...
@@ -1627,46 +1634,49 @@ void cr_reserve_lllp(uint32_t job_id,
/* store job_id, cpu_bind_type, cpu_bind */
/* store job_id, cpu_bind_type, cpu_bind */
slurm_mutex_lock
(
&
lllp_ctx
->
mutex
);
slurm_mutex_lock
(
&
lllp_ctx
->
mutex
);
if
((
j
=
_find_lllp_job_state
(
job_id
)))
{
j
=
_lllp_job_state_create
(
job_id
,
req
->
job_step_id
,
_remove_lllp_job_state
(
job_id
);
/* clear any stale state */
cpu_bind_type
,
cpu_bind
,
numtasks
);
}
j
=
_lllp_job_state_create
(
job_id
,
cpu_bind_type
,
cpu_bind
,
numtasks
);
if
(
j
)
{
if
(
j
)
{
_insert_lllp_job_state
(
j
);
_append_lllp_job_state
(
j
);
_cr_update_lllp
(
1
,
cpu_bind_type
,
cpu_bind
,
numtasks
);
_cr_update_lllp
(
1
,
job_id
,
req
->
job_step_id
,
cpu_bind_type
,
cpu_bind
,
numtasks
);
}
}
slurm_mutex_unlock
(
&
lllp_ctx
->
mutex
);
slurm_mutex_unlock
(
&
lllp_ctx
->
mutex
);
}
}
void
cr_release_lllp
(
uint32_t
job_id
)
void
cr_release_lllp
(
uint32_t
job_id
)
{
{
ListIterator
i
=
NULL
;
lllp_job_state_t
*
j
;
lllp_job_state_t
*
j
;
cpu_bind_type_t
cpu_bind_type
=
0
;
cpu_bind_type_t
cpu_bind_type
=
0
;
char
*
cpu_bind
=
NULL
;
char
*
cpu_bind
=
NULL
;
uint32_t
numtasks
=
0
;
uint32_t
numtasks
=
0
;
char
buf_type
[
100
];
char
buf_type
[
100
];
debug3
(
"release LLLP job
%d
"
,
job_id
);
debug3
(
"release LLLP job
[%u.*]
"
,
job_id
);
/* retrieve cpu_bind_type, cpu_bind from job_id */
/* retrieve cpu_bind_type, cpu_bind from job_id */
slurm_mutex_lock
(
&
lllp_ctx
->
mutex
);
slurm_mutex_lock
(
&
lllp_ctx
->
mutex
);
j
=
_find_lllp_job_state
(
job_id
);
i
=
list_iterator_create
(
lllp_ctx
->
job_list
);
if
(
j
)
{
while
((
j
=
list_next
(
i
)))
{
cpu_bind_type
=
j
->
cpu_bind_type
;
if
(
j
->
jobid
==
job_id
)
{
cpu_bind
=
j
->
cpu_bind
;
cpu_bind_type
=
j
->
cpu_bind_type
;
numtasks
=
j
->
numtasks
;
cpu_bind
=
j
->
cpu_bind
;
slurm_sprint_cpu_bind_type
(
buf_type
,
cpu_bind_type
);
numtasks
=
j
->
numtasks
;
debug3
(
"release search lllp job %d: %d tasks; %s[%d], %s"
,
slurm_sprint_cpu_bind_type
(
buf_type
,
cpu_bind_type
);
j
->
jobid
,
numtasks
,
debug3
(
"release search lllp job %u: %d tasks; %s[%d], %s"
,
buf_type
,
cpu_bind_type
,
cpu_bind
);
j
->
jobid
,
numtasks
,
buf_type
,
cpu_bind_type
,
cpu_bind
);
_cr_update_lllp
(
0
,
cpu_bind_type
,
cpu_bind
,
numtasks
);
_cr_update_lllp
(
0
,
job_id
,
j
->
jobstepid
,
/* done with saved state, remove entry */
cpu_bind_type
,
cpu_bind
,
numtasks
);
_remove_lllp_job_state
(
job_id
);
/* done with saved state, remove entry */
list_delete
(
i
);
}
}
}
list_iterator_destroy
(
i
);
slurm_mutex_unlock
(
&
lllp_ctx
->
mutex
);
slurm_mutex_unlock
(
&
lllp_ctx
->
mutex
);
}
}
...
...
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