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
83e291a8
Commit
83e291a8
authored
18 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
svn merge -r11177:11200
https://eris.llnl.gov/svn/slurm/branches/slurm-1.1
parent
843bfccc
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
NEWS
+1
-0
1 addition, 0 deletions
NEWS
src/plugins/sched/wiki2/job_modify.c
+37
-12
37 additions, 12 deletions
src/plugins/sched/wiki2/job_modify.c
testsuite/expect/test7.7.prog.c
+5
-3
5 additions, 3 deletions
testsuite/expect/test7.7.prog.c
with
43 additions
and
15 deletions
NEWS
+
1
−
0
View file @
83e291a8
...
...
@@ -256,6 +256,7 @@ documents those changes that are of interest to users and admins.
Gilles Civario (Bull).
- sched/wiki2 - Report job's node sharing options.
- sched/wiki2 - If SchedulerPort is in use, retry opening it indefinitely.
- sched/wiki2 - Add support for changing the size of a pending job.
* Changes in SLURM 1.1.32
=========================
...
...
This diff is collapsed.
Click to expand it.
src/plugins/sched/wiki2/job_modify.c
+
37
−
12
View file @
83e291a8
/*****************************************************************************\
* job_modify.c - Process Wiki job modify request
*****************************************************************************
* Copyright (C) 2006 The Regents of the University of California.
* Copyright (C) 2006
-2007
The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Morris Jette <jette1@llnl.gov>
* UCRL-CODE-226842.
...
...
@@ -53,7 +53,8 @@ static void _null_term(char *str)
}
}
static
int
_job_modify
(
uint32_t
jobid
,
char
*
bank_ptr
,
char
*
part_name_ptr
,
static
int
_job_modify
(
uint32_t
jobid
,
char
*
bank_ptr
,
uint32_t
new_node_cnt
,
char
*
part_name_ptr
,
uint32_t
new_time_limit
)
{
struct
job_record
*
job_ptr
;
...
...
@@ -71,18 +72,20 @@ static int _job_modify(uint32_t jobid, char *bank_ptr, char *part_name_ptr,
if
(
new_time_limit
)
{
time_t
old_time
=
job_ptr
->
time_limit
;
job_ptr
->
time_limit
=
new_time_limit
;
info
(
"wiki: change job %
d
time_limit to %u"
,
info
(
"wiki: change job %
u
time_limit to %u"
,
jobid
,
new_time_limit
);
/* Update end_time based upon change
* to preserve suspend time info */
job_ptr
->
end_time
=
job_ptr
->
end_time
+
((
job_ptr
->
time_limit
-
old_time
)
*
60
);
last_job_update
=
time
(
NULL
);
}
if
(
bank_ptr
)
{
info
(
"wiki: change job %
d
bank %s"
,
jobid
,
bank_ptr
);
info
(
"wiki: change job %
u
bank %s"
,
jobid
,
bank_ptr
);
xfree
(
job_ptr
->
account
);
job_ptr
->
account
=
xstrdup
(
bank_ptr
);
last_job_update
=
time
(
NULL
);
}
if
(
part_name_ptr
)
{
...
...
@@ -93,22 +96,38 @@ static int _job_modify(uint32_t jobid, char *bank_ptr, char *part_name_ptr,
part_name_ptr
);
return
ESLURM_INVALID_PARTITION_NAME
;
}
info
(
"wiki: change job %
d
partition %s"
,
info
(
"wiki: change job %
u
partition %s"
,
jobid
,
part_name_ptr
);
strncpy
(
job_ptr
->
partition
,
part_name_ptr
,
MAX_SLURM_NAME
);
job_ptr
->
part_ptr
=
part_ptr
;
last_job_update
=
time
(
NULL
);
}
if
(
new_node_cnt
)
{
if
(
IS_JOB_PENDING
(
job_ptr
)
&&
job_ptr
->
details
)
{
job_ptr
->
details
->
min_nodes
=
new_node_cnt
;
if
(
job_ptr
->
details
->
max_nodes
&&
(
job_ptr
->
details
->
max_nodes
<
new_node_cnt
))
job_ptr
->
details
->
max_nodes
=
new_node_cnt
;
info
(
"wiki: change job %u min_nodes to %u"
,
jobid
,
new_node_cnt
);
last_job_update
=
time
(
NULL
);
}
else
{
error
(
"wiki: MODIFYJOB node count of non-pending "
"job %u"
,
jobid
);
return
ESLURM_DISABLED
;
}
}
last_job_update
=
time
(
NULL
);
return
SLURM_SUCCESS
;
}
/* RET 0 on success, -1 on failure */
extern
int
job_modify_wiki
(
char
*
cmd_ptr
,
int
*
err_code
,
char
**
err_msg
)
{
char
*
arg_ptr
,
*
bank_ptr
,
*
part_ptr
,
*
time_ptr
,
*
tmp_char
;
char
*
arg_ptr
,
*
bank_ptr
,
*
nodes_ptr
,
*
part_ptr
,
*
time_ptr
,
*
tmp_char
;
int
slurm_rc
;
uint32_t
jobid
,
new_time_limit
=
0
;
uint32_t
jobid
,
new_node_cnt
=
0
,
new_time_limit
=
0
;
static
char
reply_msg
[
128
];
/* Locks: write job, read node and partition info */
slurmctld_lock_t
job_write_lock
=
{
...
...
@@ -128,13 +147,18 @@ extern int job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
error
(
"wiki: MODIFYJOB has invalid jobid"
);
return
-
1
;
}
bank_ptr
=
strstr
(
cmd_ptr
,
"BANK="
);
part_ptr
=
strstr
(
cmd_ptr
,
"PARTITION="
);
time_ptr
=
strstr
(
cmd_ptr
,
"TIMELIMIT="
);
bank_ptr
=
strstr
(
cmd_ptr
,
"BANK="
);
nodes_ptr
=
strstr
(
cmd_ptr
,
"NODES="
);
part_ptr
=
strstr
(
cmd_ptr
,
"PARTITION="
);
time_ptr
=
strstr
(
cmd_ptr
,
"TIMELIMIT="
);
if
(
bank_ptr
)
{
bank_ptr
+=
5
;
_null_term
(
bank_ptr
);
}
if
(
nodes_ptr
)
{
nodes_ptr
+=
6
;
new_node_cnt
=
strtoul
(
nodes_ptr
,
NULL
,
10
);
}
if
(
part_ptr
)
{
part_ptr
+=
10
;
_null_term
(
part_ptr
);
...
...
@@ -145,7 +169,8 @@ extern int job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
}
lock_slurmctld
(
job_write_lock
);
slurm_rc
=
_job_modify
(
jobid
,
bank_ptr
,
part_ptr
,
new_time_limit
);
slurm_rc
=
_job_modify
(
jobid
,
bank_ptr
,
new_node_cnt
,
part_ptr
,
new_time_limit
);
unlock_slurmctld
(
job_write_lock
);
if
(
slurm_rc
!=
SLURM_SUCCESS
)
{
*
err_code
=
-
700
;
...
...
This diff is collapsed.
Click to expand it.
testsuite/expect/test7.7.prog.c
+
5
−
3
View file @
83e291a8
/*****************************************************************************\
* test7.7.prog.c - Test of sched/wiki2 plugin
*****************************************************************************
* Copyright (C) 2006 The Regents of the University of California.
* Copyright (C) 2006
-2007
The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Morris Jette <jette1@llnl.gov>
* UCRL-CODE-226842.
...
...
@@ -328,7 +328,8 @@ static void _modify_job(long my_job_id)
snprintf
(
out_msg
,
sizeof
(
out_msg
),
"TS=%u AUTH=root DT=CMD=MODIFYJOB ARG=%ld "
/* PARTITION=pdebug" */
/* "PARTITION=pdebug " */
/* "NODES=2 " */
"TIMELIMIT=10 BANK=test_bank"
,
(
uint32_t
)
now
,
my_job_id
);
_xmit
(
out_msg
);
...
...
@@ -398,11 +399,12 @@ int main(int argc, char * argv[])
_get_jobs
();
_get_nodes
();
_job_will_run
(
job_id
);
_modify_job
(
job_id
);
_get_jobs
();
_start_job
(
job_id
);
_get_jobs
();
_suspend_job
(
job_id
);
_resume_job
(
job_id
);
_modify_job
(
job_id
);
_signal_job
(
job_id
);
if
(
e_port
)
_event_mgr
();
...
...
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