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
9d9893a9
Commit
9d9893a9
authored
12 years ago
by
Morris Jette
Browse files
Options
Downloads
Patches
Plain Diff
Eliminate memory leak on error condition in select/cons_res
parent
08b56783
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/select/cons_res/dist_tasks.c
+10
-7
10 additions, 7 deletions
src/plugins/select/cons_res/dist_tasks.c
with
10 additions
and
7 deletions
src/plugins/select/cons_res/dist_tasks.c
+
10
−
7
View file @
9d9893a9
...
@@ -402,7 +402,7 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
...
@@ -402,7 +402,7 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
* The CPU array contains the distribution of CPUs, which can include
* The CPU array contains the distribution of CPUs, which can include
* virtual CPUs (hyperthreads)
* virtual CPUs (hyperthreads)
*/
*/
static
void
_cyclic_sync_core_bitmap
(
struct
job_record
*
job_ptr
,
static
int
_cyclic_sync_core_bitmap
(
struct
job_record
*
job_ptr
,
const
uint16_t
cr_type
)
const
uint16_t
cr_type
)
{
{
uint32_t
c
,
i
,
j
,
s
,
n
,
*
sock_start
,
*
sock_end
,
size
,
csize
,
core_cnt
;
uint32_t
c
,
i
,
j
,
s
,
n
,
*
sock_start
,
*
sock_end
,
size
,
csize
,
core_cnt
;
...
@@ -411,9 +411,10 @@ static void _cyclic_sync_core_bitmap(struct job_record *job_ptr,
...
@@ -411,9 +411,10 @@ static void _cyclic_sync_core_bitmap(struct job_record *job_ptr,
bitstr_t
*
core_map
;
bitstr_t
*
core_map
;
bool
*
sock_used
,
alloc_cores
=
false
,
alloc_sockets
=
false
;
bool
*
sock_used
,
alloc_cores
=
false
,
alloc_sockets
=
false
;
uint16_t
ntasks_per_core
=
0xffff
;
uint16_t
ntasks_per_core
=
0xffff
;
int
error_code
=
SLURM_SUCCESS
;
if
((
job_res
==
NULL
)
||
(
job_res
->
core_bitmap
==
NULL
))
if
((
job_res
==
NULL
)
||
(
job_res
->
core_bitmap
==
NULL
))
return
;
return
error_code
;
if
(
cr_type
&
CR_CORE
)
if
(
cr_type
&
CR_CORE
)
alloc_cores
=
true
;
alloc_cores
=
true
;
...
@@ -502,8 +503,9 @@ static void _cyclic_sync_core_bitmap(struct job_record *job_ptr,
...
@@ -502,8 +503,9 @@ static void _cyclic_sync_core_bitmap(struct job_record *job_ptr,
job_ptr
->
priority
=
0
;
job_ptr
->
priority
=
0
;
job_ptr
->
state_reason
=
WAIT_HELD
;
job_ptr
->
state_reason
=
WAIT_HELD
;
error
(
"cons_res: sync loop not progressing, "
error
(
"cons_res: sync loop not progressing, "
"job %u"
,
job_ptr
->
job_id
);
"holding job %u"
,
job_ptr
->
job_id
);
return
-
1
;
error_code
=
SLURM_ERROR
;
goto
fini
;
}
}
}
}
/* clear the rest of the cores in each socket
/* clear the rest of the cores in each socket
...
@@ -532,9 +534,10 @@ static void _cyclic_sync_core_bitmap(struct job_record *job_ptr,
...
@@ -532,9 +534,10 @@ static void _cyclic_sync_core_bitmap(struct job_record *job_ptr,
/* advance 'c' to the beginning of the next node */
/* advance 'c' to the beginning of the next node */
c
+=
sockets
*
cps
;
c
+=
sockets
*
cps
;
}
}
xfree
(
sock_start
);
fini:
xfree
(
sock_start
);
xfree
(
sock_end
);
xfree
(
sock_end
);
xfree
(
sock_used
);
xfree
(
sock_used
);
return
error_code
;
}
}
...
@@ -640,11 +643,11 @@ extern int cr_dist(struct job_record *job_ptr, const uint16_t cr_type)
...
@@ -640,11 +643,11 @@ extern int cr_dist(struct job_record *job_ptr, const uint16_t cr_type)
case
SLURM_DIST_BLOCK_CYCLIC
:
case
SLURM_DIST_BLOCK_CYCLIC
:
case
SLURM_DIST_CYCLIC_CYCLIC
:
case
SLURM_DIST_CYCLIC_CYCLIC
:
case
SLURM_DIST_UNKNOWN
:
case
SLURM_DIST_UNKNOWN
:
_cyclic_sync_core_bitmap
(
job_ptr
,
cr_type
);
error_code
=
_cyclic_sync_core_bitmap
(
job_ptr
,
cr_type
);
break
;
break
;
default:
default:
error
(
"select/cons_res: invalid task_dist entry"
);
error
(
"select/cons_res: invalid task_dist entry"
);
return
SLURM_ERROR
;
return
SLURM_ERROR
;
}
}
return
SLURM_SUCCESS
;
return
error_code
;
}
}
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