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
ffd6a4a8
Commit
ffd6a4a8
authored
13 years ago
by
Danny Auble
Browse files
Options
Downloads
Patches
Plain Diff
BGQ - fixed issue where asking for less tasks than cpus requested will
work.
parent
a85b2225
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/srun/opt.c
+23
-5
23 additions, 5 deletions
src/srun/opt.c
with
23 additions
and
5 deletions
src/srun/opt.c
+
23
−
5
View file @
ffd6a4a8
...
...
@@ -1549,6 +1549,12 @@ static void _load_multi(int *argc, char **argv)
*
argc
=
2
;
}
#if defined HAVE_BG && !defined HAVE_BG_L_P
static
bool
_check_is_pow_of_2
(
int32_t
n
)
{
return
((
n
!=
0
)
&&
(
n
&
(
n
-
1
))
==
0
);
}
#endif
/*
* _opt_args() : set options via commandline args and popt
*/
...
...
@@ -1636,6 +1642,9 @@ static void _opt_args(int argc, char **argv)
opt
.
ntasks
=
node_cnt
;
opt
.
ntasks_set
=
true
;
}
else
{
int32_t
ntpn
;
bool
figured
=
false
;
if
(
opt
.
nodes_set
)
{
if
(
node_cnt
>
opt
.
ntasks
)
{
info
(
"You asked for %d nodes, but only "
...
...
@@ -1647,12 +1656,21 @@ static void _opt_args(int argc, char **argv)
}
else
if
(
node_cnt
>
opt
.
ntasks
)
opt
.
max_nodes
=
opt
.
min_nodes
=
node_cnt
=
opt
.
ntasks
;
if
(
!
opt
.
ntasks_per_node
||
(
opt
.
ntasks_per_node
==
NO_VAL
))
if
(
!
opt
.
ntasks_per_node
||
(
opt
.
ntasks_per_node
==
NO_VAL
))
{
opt
.
ntasks_per_node
=
opt
.
ntasks
/
node_cnt
;
else
if
((
opt
.
ntasks
/
opt
.
ntasks_per_node
)
!=
node_cnt
)
fatal
(
"You are requesting for %d tasks, but are "
"also asking for %d tasks per node and %d nodes."
,
opt
.
ntasks
,
opt
.
ntasks_per_node
,
node_cnt
);
figured
=
true
;
}
/* On a Q we need ntasks_per_node to be a multiple of 2 */
ntpn
=
opt
.
ntasks_per_node
;
while
(
!
_check_is_pow_of_2
(
ntpn
))
ntpn
++
;
if
(
!
figured
&&
(
ntpn
!=
opt
.
ntasks_per_node
))
{
info
(
"You requested --ntasks-per-node=%d, which is not "
"a power of 2. Setting --ntasks-per-node=%d "
"for you."
,
opt
.
ntasks_per_node
,
ntpn
);
}
opt
.
ntasks_per_node
=
ntpn
;
}
#if defined HAVE_BG_FILES
...
...
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