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
d5a6e943
Commit
d5a6e943
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug introduced in -Z option when adding support for allocate option.
parent
b99b3eb4
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
src/srun/job.c
+7
-4
7 additions, 4 deletions
src/srun/job.c
src/srun/srun.c
+8
-8
8 additions, 8 deletions
src/srun/srun.c
with
15 additions
and
12 deletions
src/srun/job.c
+
7
−
4
View file @
d5a6e943
...
...
@@ -114,7 +114,7 @@ job_create(resource_allocation_response_msg_t *resp)
pthread_mutex_init
(
&
job
->
task_mutex
,
NULL
);
ntask
=
opt
.
nprocs
;
tph
=
ntask
/
job
->
nhosts
;
/*
expect trucation of result here
*/
tph
=
(
ntask
+
job
->
nhosts
-
1
)
/
job
->
nhosts
;
/*
tasks per host, round up
*/
for
(
i
=
0
;
i
<
job
->
nhosts
;
i
++
)
{
struct
hostent
*
he
;
...
...
@@ -130,9 +130,12 @@ job_create(resource_allocation_response_msg_t *resp)
/* actual task counts and layouts performed in launch() */
/* job->ntask[i] = 0; */
job
->
cpus
[
i
]
=
resp
->
cpus_per_node
[
cpu_inx
];
if
((
++
cpu_cnt
)
>=
resp
->
cpu_count_reps
[
cpu_inx
])
cpu_inx
++
;
if
(
resp
)
{
job
->
cpus
[
i
]
=
resp
->
cpus_per_node
[
cpu_inx
];
if
((
++
cpu_cnt
)
>=
resp
->
cpu_count_reps
[
cpu_inx
])
cpu_inx
++
;
}
else
job
->
cpus
[
i
]
=
tph
;
}
return
job
;
...
...
This diff is collapsed.
Click to expand it.
src/srun/srun.c
+
8
−
8
View file @
d5a6e943
...
...
@@ -138,10 +138,8 @@ main(int ac, char **av)
create_job_step
(
job
);
slurm_free_resource_allocation_response_msg
(
resp
);
}
else
if
(
opt
.
allocate
)
{
if
(
!
(
resp
=
allocate_nodes
())
||
(
resp
->
node_list
==
NULL
))
{
info
(
"No nodes allocated. exiting"
);
if
(
!
(
resp
=
allocate_nodes
())
)
exit
(
1
);
}
if
(
_verbose
||
_debug
)
print_job_information
(
resp
);
else
...
...
@@ -152,10 +150,8 @@ main(int ac, char **av)
info
(
"Spawned srun shell terminated"
);
exit
(
0
);
}
else
{
if
(
!
(
resp
=
allocate_nodes
())
||
(
resp
->
node_list
==
NULL
))
{
info
(
"No nodes allocated. exiting"
);
if
(
!
(
resp
=
allocate_nodes
())
)
exit
(
1
);
}
if
(
_verbose
||
_debug
)
print_job_information
(
resp
);
else
...
...
@@ -324,12 +320,16 @@ allocate_nodes(void)
sleep
(
++
retries
);
}
else
{
error
(
"Unable to allocate resources: %s"
,
slurm_strerror
(
errno
));
error
(
"Unable to allocate resources: %s"
,
slurm_strerror
(
errno
));
return
NULL
;
}
}
if
(
resp
->
node_list
==
NULL
)
{
info
(
"No nodes allocated. exiting"
);
return
NULL
;
}
return
resp
;
}
...
...
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