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
d7fdaa48
Commit
d7fdaa48
authored
12 years ago
by
Morris Jette
Browse files
Options
Downloads
Plain Diff
Merge branch 'slurm-2.5'
parents
71dc5455
c7994bfb
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
+1
-0
1 addition, 0 deletions
NEWS
src/plugins/task/affinity/affinity.c
+41
-2
41 additions, 2 deletions
src/plugins/task/affinity/affinity.c
with
42 additions
and
2 deletions
NEWS
+
1
−
0
View file @
d7fdaa48
...
@@ -54,6 +54,7 @@ documents those changes that are of interest to users and admins.
...
@@ -54,6 +54,7 @@ documents those changes that are of interest to users and admins.
-- Gres/gpu plugin - If no GPUs requested, set CUDA_VISIBLE_DEVICES=NoDevFiles.
-- Gres/gpu plugin - If no GPUs requested, set CUDA_VISIBLE_DEVICES=NoDevFiles.
This bug was introduced in 2.5.2 for the case where a GPU count was
This bug was introduced in 2.5.2 for the case where a GPU count was
configured, but without device files.
configured, but without device files.
-- task/affinity plugin - Fix bug in CPU masks for some processors.
* Changes in SLURM 2.5.2
* Changes in SLURM 2.5.2
...
...
This diff is collapsed.
Click to expand it.
src/plugins/task/affinity/affinity.c
+
41
−
2
View file @
d7fdaa48
...
@@ -36,6 +36,8 @@
...
@@ -36,6 +36,8 @@
#include
"affinity.h"
#include
"affinity.h"
static
int
is_power
=
-
1
;
void
slurm_chkaffinity
(
cpu_set_t
*
mask
,
slurmd_job_t
*
job
,
int
statval
)
void
slurm_chkaffinity
(
cpu_set_t
*
mask
,
slurmd_job_t
*
job
,
int
statval
)
{
{
char
*
bind_type
,
*
action
,
*
status
,
*
units
;
char
*
bind_type
,
*
action
,
*
status
,
*
units
;
...
@@ -271,6 +273,35 @@ int get_cpuset(cpu_set_t *mask, slurmd_job_t *job)
...
@@ -271,6 +273,35 @@ int get_cpuset(cpu_set_t *mask, slurmd_job_t *job)
return
false
;
return
false
;
}
}
/* Return true if Power7 processor */
static
bool
_is_power_cpu
(
void
)
{
if
(
is_power
==
-
1
)
{
FILE
*
cpu_info_file
;
char
buffer
[
128
];
char
*
_cpuinfo_path
=
"/proc/cpuinfo"
;
cpu_info_file
=
fopen
(
_cpuinfo_path
,
"r"
);
if
(
cpu_info_file
==
NULL
)
{
error
(
"_get_is_power: error %d opening %s"
,
errno
,
_cpuinfo_path
);
return
false
;
/* assume not power processor */
}
is_power
=
0
;
while
(
fgets
(
buffer
,
sizeof
(
buffer
),
cpu_info_file
)
!=
NULL
)
{
if
(
strstr
(
buffer
,
"POWER7"
))
{
is_power
=
1
;
break
;
}
}
fclose
(
cpu_info_file
);
}
if
(
is_power
==
1
)
return
true
;
return
false
;
}
/* Translate global CPU index to local CPU index. This is needed for
/* Translate global CPU index to local CPU index. This is needed for
* Power7 processors with multi-threading disabled. On those processors,
* Power7 processors with multi-threading disabled. On those processors,
* the CPU mask has gaps for the unused threads (different from Intel
* the CPU mask has gaps for the unused threads (different from Intel
...
@@ -278,12 +309,20 @@ int get_cpuset(cpu_set_t *mask, slurmd_job_t *job)
...
@@ -278,12 +309,20 @@ int get_cpuset(cpu_set_t *mask, slurmd_job_t *job)
* set system call. */
* set system call. */
void
reset_cpuset
(
cpu_set_t
*
new_mask
,
cpu_set_t
*
cur_mask
)
void
reset_cpuset
(
cpu_set_t
*
new_mask
,
cpu_set_t
*
cur_mask
)
{
{
cpu_set_t
newer_mask
;
cpu_set_t
full_mask
,
newer_mask
;
int
cur_offset
,
new_offset
=
0
,
last_set
=
-
1
;
int
cur_offset
,
new_offset
=
0
,
last_set
=
-
1
;
if
(
!
_is_power_cpu
())
return
;
if
(
slurm_getaffinity
(
1
,
sizeof
(
full_mask
),
&
full_mask
))
{
/* Try to get full CPU mask from process init */
CPU_ZERO
(
&
full_mask
);
CPU_OR
(
&
full_mask
,
&
full_mask
,
cur_mask
);
}
CPU_ZERO
(
&
newer_mask
);
CPU_ZERO
(
&
newer_mask
);
for
(
cur_offset
=
0
;
cur_offset
<
CPU_SETSIZE
;
cur_offset
++
)
{
for
(
cur_offset
=
0
;
cur_offset
<
CPU_SETSIZE
;
cur_offset
++
)
{
if
(
!
CPU_ISSET
(
cur_offset
,
cur
_mask
))
if
(
!
CPU_ISSET
(
cur_offset
,
&
full
_mask
))
continue
;
continue
;
if
(
CPU_ISSET
(
new_offset
,
new_mask
))
{
if
(
CPU_ISSET
(
new_offset
,
new_mask
))
{
CPU_SET
(
cur_offset
,
&
newer_mask
);
CPU_SET
(
cur_offset
,
&
newer_mask
);
...
...
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