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
081e608f
Commit
081e608f
authored
14 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
clear SLURM_JOB_CPUS_PER_NODE in job environment after resize.
We don't have the correct info available now
parent
9a63cda7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scontrol/update_job.c
+12
-1
12 additions, 1 deletion
src/scontrol/update_job.c
with
12 additions
and
1 deletion
src/scontrol/update_job.c
+
12
−
1
View file @
081e608f
...
@@ -626,7 +626,7 @@ scontrol_job_notify(int argc, char *argv[])
...
@@ -626,7 +626,7 @@ scontrol_job_notify(int argc, char *argv[])
static
void
_update_job_size
(
uint32_t
job_id
)
static
void
_update_job_size
(
uint32_t
job_id
)
{
{
resource_allocation_response_msg_t
*
alloc_info
;
resource_allocation_response_msg_t
*
alloc_info
;
char
*
fname_csh
=
NULL
,
*
fname_sh
=
NULL
,
*
tmp
;
char
*
fname_csh
=
NULL
,
*
fname_sh
=
NULL
;
FILE
*
resize_csh
=
NULL
,
*
resize_sh
=
NULL
;
FILE
*
resize_csh
=
NULL
,
*
resize_sh
=
NULL
;
if
(
slurm_allocation_lookup_lite
(
job_id
,
&
alloc_info
)
!=
if
(
slurm_allocation_lookup_lite
(
job_id
,
&
alloc_info
)
!=
...
@@ -673,6 +673,16 @@ static void _update_job_size(uint32_t job_id)
...
@@ -673,6 +673,16 @@ static void _update_job_size(uint32_t job_id)
alloc_info
->
node_cnt
);
alloc_info
->
node_cnt
);
}
}
if
(
getenv
(
"SLURM_JOB_CPUS_PER_NODE"
))
{
if
(
getenv
(
"SLURM_JOB_CPUS_PER_NODE"
))
{
#if 1
fprintf
(
resize_sh
,
"unset SLURM_JOB_CPUS_PER_NODE
\n
"
);
fprintf
(
resize_csh
,
"unsetenv SLURM_JOB_CPUS_PER_NODE
\n
"
);
#else
/* The job resource structure is currently based upon the
* original job allocation, so we don't have sufficient
* information to recreate this environment variable today.
* This is a possible future enhancement if/when job resource
* information is corrected after job resize */
char
*
tmp
;
tmp
=
uint32_compressed_to_str
(
alloc_info
->
num_cpu_groups
,
tmp
=
uint32_compressed_to_str
(
alloc_info
->
num_cpu_groups
,
alloc_info
->
cpus_per_node
,
alloc_info
->
cpus_per_node
,
alloc_info
->
cpu_count_reps
);
alloc_info
->
cpu_count_reps
);
...
@@ -681,6 +691,7 @@ static void _update_job_size(uint32_t job_id)
...
@@ -681,6 +691,7 @@ static void _update_job_size(uint32_t job_id)
fprintf
(
resize_csh
,
"setenv SLURM_JOB_CPUS_PER_NODE
\"
%s
\"\n
"
,
fprintf
(
resize_csh
,
"setenv SLURM_JOB_CPUS_PER_NODE
\"
%s
\"\n
"
,
tmp
);
tmp
);
xfree
(
tmp
);
xfree
(
tmp
);
#endif
}
}
if
(
getenv
(
"SLURM_TASKS_PER_NODE"
))
{
if
(
getenv
(
"SLURM_TASKS_PER_NODE"
))
{
/* We don't have sufficient information to recreate this */
/* We don't have sufficient information to recreate this */
...
...
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