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
e22ad4f9
Commit
e22ad4f9
authored
15 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
change the error message to be more clear when someone attempts to change
a parameter that can't be modified
parent
40d62934
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/scontrol/update_job.c
+17
-11
17 additions, 11 deletions
src/scontrol/update_job.c
src/scontrol/update_node.c
+3
-2
3 additions, 2 deletions
src/scontrol/update_node.c
src/scontrol/update_part.c
+19
-12
19 additions, 12 deletions
src/scontrol/update_part.c
with
39 additions
and
25 deletions
src/scontrol/update_job.c
+
17
−
11
View file @
e22ad4f9
...
@@ -69,7 +69,8 @@ scontrol_checkpoint(char *op, char *job_step_id_str, int argc, char *argv[])
...
@@ -69,7 +69,8 @@ scontrol_checkpoint(char *op, char *job_step_id_str, int argc, char *argv[])
if
(
job_step_id_str
)
{
if
(
job_step_id_str
)
{
job_id
=
(
uint32_t
)
strtol
(
job_step_id_str
,
&
next_str
,
10
);
job_id
=
(
uint32_t
)
strtol
(
job_step_id_str
,
&
next_str
,
10
);
if
(
next_str
[
0
]
==
'.'
)
{
if
(
next_str
[
0
]
==
'.'
)
{
step_id
=
(
uint32_t
)
strtol
(
&
next_str
[
1
],
&
next_str
,
10
);
step_id
=
(
uint32_t
)
strtol
(
&
next_str
[
1
],
&
next_str
,
10
);
step_id_set
=
1
;
step_id_set
=
1
;
}
else
}
else
step_id
=
NO_VAL
;
step_id
=
NO_VAL
;
...
@@ -111,22 +112,25 @@ scontrol_checkpoint(char *op, char *job_step_id_str, int argc, char *argv[])
...
@@ -111,22 +112,25 @@ scontrol_checkpoint(char *op, char *job_step_id_str, int argc, char *argv[])
else
if
(
strncasecmp
(
op
,
"enable"
,
MAX
(
oplen
,
2
))
==
0
)
else
if
(
strncasecmp
(
op
,
"enable"
,
MAX
(
oplen
,
2
))
==
0
)
rc
=
slurm_checkpoint_enable
(
job_id
,
step_id
);
rc
=
slurm_checkpoint_enable
(
job_id
,
step_id
);
else
if
(
strncasecmp
(
op
,
"create"
,
MAX
(
oplen
,
2
))
==
0
)
{
else
if
(
strncasecmp
(
op
,
"create"
,
MAX
(
oplen
,
2
))
==
0
)
{
if
(
_parse_checkpoint_args
(
argc
,
argv
,
&
max_wait
,
&
image_dir
))
{
if
(
_parse_checkpoint_args
(
argc
,
argv
,
&
max_wait
,
&
image_dir
)){
return
0
;
return
0
;
}
}
rc
=
slurm_checkpoint_create
(
job_id
,
step_id
,
max_wait
,
image_dir
);
rc
=
slurm_checkpoint_create
(
job_id
,
step_id
,
max_wait
,
image_dir
);
}
else
if
(
strncasecmp
(
op
,
"vacate"
,
MAX
(
oplen
,
2
))
==
0
)
{
}
else
if
(
strncasecmp
(
op
,
"vacate"
,
MAX
(
oplen
,
2
))
==
0
)
{
if
(
_parse_checkpoint_args
(
argc
,
argv
,
&
max_wait
,
&
image_dir
))
{
if
(
_parse_checkpoint_args
(
argc
,
argv
,
&
max_wait
,
&
image_dir
)){
return
0
;
return
0
;
}
}
rc
=
slurm_checkpoint_vacate
(
job_id
,
step_id
,
max_wait
,
image_dir
);
rc
=
slurm_checkpoint_vacate
(
job_id
,
step_id
,
max_wait
,
image_dir
);
}
else
if
(
strncasecmp
(
op
,
"restart"
,
MAX
(
oplen
,
2
))
==
0
)
{
}
else
if
(
strncasecmp
(
op
,
"restart"
,
MAX
(
oplen
,
2
))
==
0
)
{
if
(
_parse_restart_args
(
argc
,
argv
,
&
stick
,
&
image_dir
))
{
if
(
_parse_restart_args
(
argc
,
argv
,
&
stick
,
&
image_dir
))
{
return
0
;
return
0
;
}
}
rc
=
slurm_checkpoint_restart
(
job_id
,
step_id
,
stick
,
image_dir
);
rc
=
slurm_checkpoint_restart
(
job_id
,
step_id
,
stick
,
image_dir
);
}
else
if
(
strncasecmp
(
op
,
"error"
,
MAX
(
oplen
,
2
))
==
0
)
{
}
else
if
(
strncasecmp
(
op
,
"error"
,
MAX
(
oplen
,
2
))
==
0
)
{
rc
=
slurm_checkpoint_error
(
job_id
,
step_id
,
rc
=
slurm_checkpoint_error
(
job_id
,
step_id
,
...
@@ -276,7 +280,7 @@ scontrol_update_job (int argc, char *argv[])
...
@@ -276,7 +280,7 @@ scontrol_update_job (int argc, char *argv[])
taglen
=
val
-
argv
[
i
];
taglen
=
val
-
argv
[
i
];
val
++
;
val
++
;
vallen
=
strlen
(
val
);
vallen
=
strlen
(
val
);
}
else
if
(
strncasecmp
(
tag
,
"Nice"
,
MAX
(
strlen
(
tag
),
2
))
==
0
)
{
}
else
if
(
strncasecmp
(
tag
,
"Nice"
,
MAX
(
strlen
(
tag
),
2
))
==
0
){
/* "Nice" is the only tag that might not have an
/* "Nice" is the only tag that might not have an
equal sign, so it is handled specially. */
equal sign, so it is handled specially. */
job_msg
.
nice
=
NICE_OFFSET
+
100
;
job_msg
.
nice
=
NICE_OFFSET
+
100
;
...
@@ -317,7 +321,8 @@ scontrol_update_job (int argc, char *argv[])
...
@@ -317,7 +321,8 @@ scontrol_update_job (int argc, char *argv[])
nice
=
strtoll
(
val
,
(
char
**
)
NULL
,
10
);
nice
=
strtoll
(
val
,
(
char
**
)
NULL
,
10
);
if
(
abs
(
nice
)
>
NICE_OFFSET
)
{
if
(
abs
(
nice
)
>
NICE_OFFSET
)
{
error
(
"Invalid nice value, must be between "
error
(
"Invalid nice value, must be between "
"-%d and %d"
,
NICE_OFFSET
,
NICE_OFFSET
);
"-%d and %d"
,
NICE_OFFSET
,
NICE_OFFSET
);
exit_code
=
1
;
exit_code
=
1
;
return
0
;
return
0
;
}
}
...
@@ -451,11 +456,11 @@ scontrol_update_job (int argc, char *argv[])
...
@@ -451,11 +456,11 @@ scontrol_update_job (int argc, char *argv[])
(
char
**
)
NULL
,
10
);
(
char
**
)
NULL
,
10
);
update_cnt
++
;
update_cnt
++
;
}
}
else
if
(
strncasecmp
(
tag
,
"ExcNodeList"
,
MAX
(
taglen
,
1
))
==
0
)
{
else
if
(
strncasecmp
(
tag
,
"ExcNodeList"
,
MAX
(
taglen
,
1
))
==
0
){
job_msg
.
exc_nodes
=
val
;
job_msg
.
exc_nodes
=
val
;
update_cnt
++
;
update_cnt
++
;
}
}
else
if
(
strncasecmp
(
tag
,
"ReqNodeList"
,
MAX
(
taglen
,
8
))
==
0
)
{
else
if
(
strncasecmp
(
tag
,
"ReqNodeList"
,
MAX
(
taglen
,
8
))
==
0
){
job_msg
.
req_nodes
=
val
;
job_msg
.
req_nodes
=
val
;
update_cnt
++
;
update_cnt
++
;
}
}
...
@@ -536,7 +541,8 @@ scontrol_update_job (int argc, char *argv[])
...
@@ -536,7 +541,8 @@ scontrol_update_job (int argc, char *argv[])
}
}
else
{
else
{
exit_code
=
1
;
exit_code
=
1
;
fprintf
(
stderr
,
"Invalid input: %s
\n
"
,
argv
[
i
]);
fprintf
(
stderr
,
"Update of this parameter is not "
"supported: %s
\n
"
,
argv
[
i
]);
fprintf
(
stderr
,
"Request aborted
\n
"
);
fprintf
(
stderr
,
"Request aborted
\n
"
);
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/scontrol/update_node.c
+
3
−
2
View file @
e22ad4f9
...
@@ -172,7 +172,7 @@ scontrol_update_node (int argc, char *argv[])
...
@@ -172,7 +172,7 @@ scontrol_update_node (int argc, char *argv[])
for
(
j
=
0
;
j
<
NODE_STATE_END
;
j
++
)
{
for
(
j
=
0
;
j
<
NODE_STATE_END
;
j
++
)
{
if
(
strncasecmp
(
node_state_string
(
j
),
if
(
strncasecmp
(
node_state_string
(
j
),
val
,
val
,
MAX
(
vallen
,
3
))
==
0
)
{
MAX
(
vallen
,
3
))
==
0
){
state_val
=
(
uint16_t
)
j
;
state_val
=
(
uint16_t
)
j
;
break
;
break
;
}
}
...
@@ -202,7 +202,8 @@ scontrol_update_node (int argc, char *argv[])
...
@@ -202,7 +202,8 @@ scontrol_update_node (int argc, char *argv[])
}
}
}
else
{
}
else
{
exit_code
=
1
;
exit_code
=
1
;
fprintf
(
stderr
,
"Invalid input: %s
\n
"
,
argv
[
i
]);
fprintf
(
stderr
,
"Update of this parameter is not "
"supported: %s
\n
"
,
argv
[
i
]);
fprintf
(
stderr
,
"Request aborted
\n
"
);
fprintf
(
stderr
,
"Request aborted
\n
"
);
goto
done
;
goto
done
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/scontrol/update_part.c
+
19
−
12
View file @
e22ad4f9
...
@@ -86,7 +86,7 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
...
@@ -86,7 +86,7 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
part_msg_ptr
->
max_time
=
max_time
;
part_msg_ptr
->
max_time
=
max_time
;
(
*
update_cnt_ptr
)
++
;
(
*
update_cnt_ptr
)
++
;
}
}
else
if
(
strncasecmp
(
tag
,
"DefaultTime"
,
MAX
(
taglen
,
8
))
==
0
)
{
else
if
(
strncasecmp
(
tag
,
"DefaultTime"
,
MAX
(
taglen
,
8
))
==
0
){
int
default_time
=
time_str2mins
(
val
);
int
default_time
=
time_str2mins
(
val
);
if
((
default_time
<
0
)
&&
(
default_time
!=
INFINITE
))
{
if
((
default_time
<
0
)
&&
(
default_time
!=
INFINITE
))
{
exit_code
=
1
;
exit_code
=
1
;
...
@@ -166,23 +166,29 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
...
@@ -166,23 +166,29 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
if
(
strncasecmp
(
val
,
"NO"
,
MAX
(
vallen
,
1
))
==
0
)
{
if
(
strncasecmp
(
val
,
"NO"
,
MAX
(
vallen
,
1
))
==
0
)
{
part_msg_ptr
->
max_share
=
1
;
part_msg_ptr
->
max_share
=
1
;
}
else
if
(
strncasecmp
(
val
,
"EXCLUSIVE"
,
MAX
(
vallen
,
1
))
==
0
)
{
}
else
if
(
strncasecmp
(
val
,
"EXCLUSIVE"
,
MAX
(
vallen
,
1
))
==
0
)
{
part_msg_ptr
->
max_share
=
0
;
part_msg_ptr
->
max_share
=
0
;
}
else
if
(
strncasecmp
(
val
,
"YES"
,
MAX
(
vallen
,
1
))
==
0
)
{
}
else
if
(
strncasecmp
(
val
,
"YES"
,
MAX
(
vallen
,
1
))
==
0
)
{
if
(
colon_pos
)
{
if
(
colon_pos
)
{
part_msg_ptr
->
max_share
=
(
uint16_t
)
strtol
(
colon_pos
+
1
,
part_msg_ptr
->
max_share
=
(
char
**
)
NULL
,
10
);
(
uint16_t
)
strtol
(
colon_pos
+
1
,
(
char
**
)
NULL
,
10
);
}
else
{
}
else
{
part_msg_ptr
->
max_share
=
(
uint16_t
)
4
;
part_msg_ptr
->
max_share
=
(
uint16_t
)
4
;
}
}
}
else
if
(
strncasecmp
(
val
,
"FORCE"
,
MAX
(
vallen
,
1
))
==
0
)
{
}
else
if
(
strncasecmp
(
val
,
"FORCE"
,
MAX
(
vallen
,
1
))
==
0
)
{
if
(
colon_pos
)
{
if
(
colon_pos
)
{
part_msg_ptr
->
max_share
=
(
uint16_t
)
strtol
(
colon_pos
+
1
,
part_msg_ptr
->
max_share
=
(
char
**
)
NULL
,
10
)
|
SHARED_FORCE
;
(
uint16_t
)
strtol
(
colon_pos
+
1
,
(
char
**
)
NULL
,
10
)
|
SHARED_FORCE
;
}
else
{
}
else
{
part_msg_ptr
->
max_share
=
(
uint16_t
)
4
|
part_msg_ptr
->
max_share
=
SHARED_FORCE
;
(
uint16_t
)
4
|
SHARED_FORCE
;
}
}
}
else
{
}
else
{
exit_code
=
1
;
exit_code
=
1
;
...
@@ -216,7 +222,7 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
...
@@ -216,7 +222,7 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
part_msg_ptr
->
nodes
=
val
;
part_msg_ptr
->
nodes
=
val
;
(
*
update_cnt_ptr
)
++
;
(
*
update_cnt_ptr
)
++
;
}
}
else
if
(
strncasecmp
(
tag
,
"AllowGroups"
,
MAX
(
taglen
,
1
))
==
0
)
{
else
if
(
strncasecmp
(
tag
,
"AllowGroups"
,
MAX
(
taglen
,
1
))
==
0
){
part_msg_ptr
->
allow_groups
=
val
;
part_msg_ptr
->
allow_groups
=
val
;
(
*
update_cnt_ptr
)
++
;
(
*
update_cnt_ptr
)
++
;
}
}
...
@@ -226,7 +232,8 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
...
@@ -226,7 +232,8 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
}
}
else
{
else
{
exit_code
=
1
;
exit_code
=
1
;
error
(
"Invalid input: %s"
,
argv
[
i
]);
error
(
"Update of this parameter is not "
"supported: %s
\n
"
,
argv
[
i
]);
error
(
"Request aborted"
);
error
(
"Request aborted"
);
return
-
1
;
return
-
1
;
}
}
...
...
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