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
8bf13c9e
Commit
8bf13c9e
authored
20 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Require admin to specify a reason when draining a node.
parent
1c52ef27
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
NEWS
+3
-0
3 additions, 0 deletions
NEWS
src/scontrol/scontrol.c
+22
-4
22 additions, 4 deletions
src/scontrol/scontrol.c
with
25 additions
and
4 deletions
NEWS
+
3
−
0
View file @
8bf13c9e
...
...
@@ -11,6 +11,9 @@ documents those changes that are of interest to users and admins.
request occurs prior to initial node registration.
-- Fix bug in purging of batch jobs (active batch jobs were being
improperly purged starting in version 0.3.0).
-- When updating a node state to DRAINING/DRAINED a Reason must be
provided and a timestamp will automatically be appended to that
Reason
* Changes in SLURM 0.3.4
========================
...
...
This diff is collapsed.
Click to expand it.
src/scontrol/scontrol.c
+
22
−
4
View file @
8bf13c9e
...
...
@@ -1511,10 +1511,13 @@ _update_job (int argc, char *argv[])
static
int
_update_node
(
int
argc
,
char
*
argv
[])
{
int
i
,
j
,
k
,
rc
;
int
i
,
j
,
k
,
rc
=
0
;
uint16_t
state_val
;
update_node_msg_t
node_msg
;
char
*
reason_str
=
NULL
;
char
time_buf
[
64
];
struct
tm
*
time_ptr
;
time_t
now
;
node_msg
.
node_names
=
NULL
;
node_msg
.
reason
=
NULL
;
...
...
@@ -1533,6 +1536,13 @@ _update_node (int argc, char *argv[])
len
=
strlen
(
reason_str
)
-
1
;
if
((
len
>=
0
)
&&
(
reason_str
[
len
]
==
'"'
))
reason_str
[
len
]
=
'\0'
;
/* Append date and time */
now
=
time
(
NULL
);
time_ptr
=
localtime
(
&
now
);
strftime
(
time_buf
,
sizeof
(
time_buf
),
" %b %d %H:%M"
,
time_ptr
);
xstrcat
(
reason_str
,
time_buf
);
node_msg
.
reason
=
reason_str
;
}
...
...
@@ -1563,7 +1573,7 @@ _update_node (int argc, char *argv[])
node_state_string
(
k
));
}
fprintf
(
stderr
,
"
\n
"
);
return
0
;
goto
done
;
}
}
node_msg
.
node_state
=
state_val
;
...
...
@@ -1572,13 +1582,21 @@ _update_node (int argc, char *argv[])
exit_code
=
1
;
fprintf
(
stderr
,
"Invalid input: %s
\n
"
,
argv
[
i
]);
fprintf
(
stderr
,
"Request aborted
\n
"
);
return
0
;
goto
done
;
}
}
if
(((
node_msg
.
node_state
==
NODE_STATE_DRAINING
)
||
(
node_msg
.
node_state
==
NODE_STATE_DRAINING
))
&&
(
node_msg
.
reason
==
NULL
))
{
fprintf
(
stderr
,
"You must specify a reason when DRAINING a node
\n
"
);
fprintf
(
stderr
,
"Request aborted
\n
"
);
goto
done
;
}
rc
=
slurm_update_node
(
&
node_msg
);
xfree
(
reason_str
);
done:
xfree
(
reason_str
);
if
(
rc
)
{
exit_code
=
1
;
return
slurm_get_errno
();
...
...
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