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
5e87d352
Commit
5e87d352
authored
14 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
add support for a GRES numeric suffix of "G" (in addition to "G" and "K"
previously supported).
parent
b9cc5969
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/man/man5/gres.conf.5
+3
-2
3 additions, 2 deletions
doc/man/man5/gres.conf.5
doc/man/man5/slurm.conf.5
+3
-1
3 additions, 1 deletion
doc/man/man5/slurm.conf.5
src/common/gres.c
+10
-0
10 additions, 0 deletions
src/common/gres.c
with
16 additions
and
3 deletions
doc/man/man5/gres.conf.5
+
3
−
2
View file @
5e87d352
.TH "gres.conf" "5" "
July
2010" "gres.conf 2.2" "Slurm configuration file"
.TH "gres.conf" "5" "
September
2010" "gres.conf 2.2" "Slurm configuration file"
.SH "NAME"
gres.conf \- Slurm configuration file for generic resource management.
...
...
@@ -24,7 +24,8 @@ The overall configuration parameters available include:
\fBCount\fR
Number of resources of this type available on this node.
The default value is set to the number of \fBFile\fR values specified (if any),
otherwise the default value is one.
otherwise the default value is one. A suffix of "K", "M" or "G" may be used
to mulitply the number by 1024, 1048576 or 1073741824 respectively.
.TP
\fBCPUs\fR
...
...
This diff is collapsed.
Click to expand it.
doc/man/man5/slurm.conf.5
+
3
−
1
View file @
5e87d352
...
...
@@ -2129,7 +2129,9 @@ Also see \fBGres\fR.
A comma delimited list of generic resources specifications for a node.
Each resource specification consists of a name followed by an optional
colon with a numeric value (default value is one)
(e.g. "Gres=bandwidth:10000,gpus").
(e.g. "Gres=bandwidth:10000,gpus:2").
A suffix of "K", "M" or "G" may be used to mulitply the number by 1024,
1048576 or 1073741824 respectively (e.g. "Gres=bandwidth:4G,gpus:4")..
By default a node has no generic resources.
Also see \fBFeature\fR.
...
...
This diff is collapsed.
Click to expand it.
src/common/gres.c
+
10
−
0
View file @
5e87d352
...
...
@@ -674,6 +674,8 @@ static int _parse_gres_config(void **dest, slurm_parser_enum_t type,
tmp_long
*=
1024
;
else
if
((
last
[
0
]
==
'm'
)
||
(
last
[
0
]
==
'M'
))
tmp_long
*=
(
1024
*
1024
);
else
if
((
last
[
0
]
==
'g'
)
||
(
last
[
0
]
==
'G'
))
tmp_long
*=
(
1024
*
1024
*
1024
);
else
if
(
last
[
0
]
!=
'\0'
)
{
fatal
(
"Invalid gres data for %s, Count=%s"
,
p
->
name
,
tmp_str
);
...
...
@@ -979,6 +981,8 @@ static uint32_t _get_gres_cnt(char *orig_config, char *gres_name,
gres_config_cnt
*=
1024
;
else
if
((
last_num
[
0
]
==
'm'
)
||
(
last_num
[
0
]
==
'M'
))
gres_config_cnt
*=
(
1024
*
1024
);
else
if
((
last_num
[
0
]
==
'g'
)
||
(
last_num
[
0
]
==
'G'
))
gres_config_cnt
*=
(
1024
*
1024
*
1024
);
break
;
}
tok
=
strtok_r
(
NULL
,
","
,
&
last_tok
);
...
...
@@ -1009,6 +1013,10 @@ static void _set_gres_cnt(char *orig_config, char **new_config,
if
(
strcmp
(
tok
,
gres_name
)
&&
strncmp
(
tok
,
gres_name_colon
,
gres_name_colon_len
))
{
xstrcat
(
new_configured_res
,
tok
);
}
else
if
((
new_cnt
%
(
1024
*
1024
*
1024
))
==
0
)
{
new_cnt
/=
(
1024
*
1024
*
1024
);
xstrfmtcat
(
new_configured_res
,
"%s:%uG"
,
gres_name
,
new_cnt
);
}
else
if
((
new_cnt
%
(
1024
*
1024
))
==
0
)
{
new_cnt
/=
(
1024
*
1024
);
xstrfmtcat
(
new_configured_res
,
"%s:%uM"
,
...
...
@@ -1902,6 +1910,8 @@ static int _job_config_validate(char *config, uint32_t *gres_cnt,
cnt
*=
1024
;
else
if
((
last_num
[
0
]
==
'm'
)
||
(
last_num
[
0
]
==
'M'
))
cnt
*=
(
1024
*
1024
);
else
if
((
last_num
[
0
]
==
'g'
)
||
(
last_num
[
0
]
==
'G'
))
cnt
*=
(
1024
*
1024
*
1024
);
else
return
SLURM_ERROR
;
if
(
cnt
<
0
)
...
...
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