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
169d62c8
Commit
169d62c8
authored
18 years ago
by
Danny Auble
Browse files
Options
Downloads
Patches
Plain Diff
fix to allow hostlists when they are requested instead of implying them
parent
c42fe448
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/srun/srun.c
+0
-9
0 additions, 9 deletions
src/srun/srun.c
src/srun/srun_job.c
+10
-5
10 additions, 5 deletions
src/srun/srun_job.c
with
10 additions
and
14 deletions
src/srun/srun.c
+
0
−
9
View file @
169d62c8
...
@@ -238,15 +238,6 @@ int srun(int ac, char **av)
...
@@ -238,15 +238,6 @@ int srun(int ac, char **av)
}
else
if
((
resp
=
existing_allocation
()))
{
}
else
if
((
resp
=
existing_allocation
()))
{
job_id
=
resp
->
job_id
;
job_id
=
resp
->
job_id
;
/* If opt.nodelist isn't set we initialize it from the
* allocation info, but only if the env variable SLURM_HOSTFILE
* ISN'T set, because SLURM_HOSTFILE isn't parsed until
* job_step_create_allocation is called (bad design, all env
* variable parsing should happen up front in opt.c with the
* rest of the option parsing).
*/
if
(
opt
.
nodelist
==
NULL
&&
getenv
(
"SLURM_HOSTFILE"
)
==
NULL
)
opt
.
nodelist
=
xstrdup
(
resp
->
node_list
);
slurm_free_resource_allocation_response_msg
(
resp
);
slurm_free_resource_allocation_response_msg
(
resp
);
if
(
opt
.
allocate
)
{
if
(
opt
.
allocate
)
{
error
(
"job %u already has an allocation"
,
error
(
"job %u already has an allocation"
,
...
...
This diff is collapsed.
Click to expand it.
src/srun/srun_job.c
+
10
−
5
View file @
169d62c8
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
* any later version.
* any later version.
*
*
* In addition, as a special exception, the copyright holders give permission
* In addition, as a special exception, the copyright holders give permission
* to link the code of portions of this program with the OpenSSL library under
* to link the code of portions of this program with the OpenSSL library under
* certain conditions as described in each individual source file, and
* certain conditions as described in each individual source file, and
* distribute linked combinations including the two. You must obey the GNU
* distribute linked combinations including the two. You must obey the GNU
* General Public License in all respects for all of the code used other than
* General Public License in all respects for all of the code used other than
...
@@ -163,13 +163,18 @@ job_step_create_allocation(uint32_t job_id)
...
@@ -163,13 +163,18 @@ job_step_create_allocation(uint32_t job_id)
if
(
!
opt
.
max_nodes
)
if
(
!
opt
.
max_nodes
)
opt
.
max_nodes
=
opt
.
min_nodes
;
opt
.
max_nodes
=
opt
.
min_nodes
;
/* The reason we read in from the hostfile here is so if we don't
* need all the hostfile we only get what the user asked for
* (i.e. opt.max_nodes)
*/
if
(
opt
.
nodelist
==
NULL
)
{
if
(
opt
.
nodelist
==
NULL
)
{
char
*
nodelist
=
NULL
;
char
*
nodelist
=
NULL
;
char
*
hostfile
=
getenv
(
"SLURM_HOSTFILE"
);
char
*
hostfile
=
getenv
(
"SLURM_HOSTFILE"
);
if
(
hostfile
!=
NULL
)
{
if
(
hostfile
!=
NULL
)
{
nodelist
=
slurm_read_hostfile
(
hostfile
,
opt
.
nprocs
);
nodelist
=
slurm_read_hostfile
(
hostfile
,
opt
.
max_nodes
);
if
(
nodelist
==
NULL
)
{
if
(
nodelist
==
NULL
)
{
error
(
"Failure getting NodeNames from "
error
(
"Failure getting NodeNames from "
"hostfile"
);
"hostfile"
);
...
@@ -184,7 +189,7 @@ job_step_create_allocation(uint32_t job_id)
...
@@ -184,7 +189,7 @@ job_step_create_allocation(uint32_t job_id)
}
}
}
}
ai
->
nodelist
=
opt
.
alloc_nodelist
;
ai
->
nodelist
=
opt
.
alloc_nodelist
;
if
(
opt
.
exc_nodes
)
{
if
(
opt
.
exc_nodes
)
{
hostlist_t
exc_hl
=
hostlist_create
(
opt
.
exc_nodes
);
hostlist_t
exc_hl
=
hostlist_create
(
opt
.
exc_nodes
);
char
*
node_name
=
NULL
;
char
*
node_name
=
NULL
;
...
@@ -308,7 +313,7 @@ job_step_create_allocation(uint32_t job_id)
...
@@ -308,7 +313,7 @@ job_step_create_allocation(uint32_t job_id)
hostlist_uniq
(
hl
);
hostlist_uniq
(
hl
);
ai
->
nnodes
=
hostlist_count
(
hl
);
ai
->
nnodes
=
hostlist_count
(
hl
);
hostlist_destroy
(
hl
);
hostlist_destroy
(
hl
);
}
else
if
((
opt
.
max_nodes
>
0
)
&&
(
opt
.
max_nodes
<
ai
->
nnodes
))
}
else
if
((
opt
.
max_nodes
>
0
)
&&
(
opt
.
max_nodes
<
ai
->
nnodes
))
ai
->
nnodes
=
opt
.
max_nodes
;
ai
->
nnodes
=
opt
.
max_nodes
;
/*
/*
...
...
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