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
e1ccf7d9
Commit
e1ccf7d9
authored
18 years ago
by
Danny Auble
Browse files
Options
Downloads
Patches
Plain Diff
alter to make submitted times work
parent
8a7fc1db
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
NEWS
+1
-0
1 addition, 0 deletions
NEWS
src/plugins/jobacct/common/common_slurmctld.c
+5
-2
5 additions, 2 deletions
src/plugins/jobacct/common/common_slurmctld.c
src/sacct/options.c
+5
-0
5 additions, 0 deletions
src/sacct/options.c
src/sacct/process.c
+45
-14
45 additions, 14 deletions
src/sacct/process.c
with
56 additions
and
16 deletions
NEWS
+
1
−
0
View file @
e1ccf7d9
...
...
@@ -12,6 +12,7 @@ documents those changes that are of interest to users and admins.
-- Fix for srun -n and -O options when paired with -b.
-- Added logic for fanout to failover to forward list if main node is
unreachable
-- sacct also now keeps track of submitted, started and ending times of jobs
* Changes in SLURM 1.1.0-pre8
=============================
...
...
This diff is collapsed.
Click to expand it.
src/plugins/jobacct/common/common_slurmctld.c
+
5
−
2
View file @
e1ccf7d9
...
...
@@ -87,7 +87,10 @@ static int _print_record(struct job_record *job_ptr,
{
static
int
rc
=
SLURM_SUCCESS
;
char
*
block_id
=
NULL
;
if
(
!
job_ptr
->
details
)
{
error
(
"job_acct: job=%u doesn't exist"
,
job_ptr
->
job_id
);
return
SLURM_ERROR
;
}
debug2
(
"_print_record, job=%u,
\"
%s
\"
"
,
job_ptr
->
job_id
,
data
);
#ifdef HAVE_BG
...
...
@@ -104,7 +107,7 @@ static int _print_record(struct job_record *job_ptr,
if
(
fprintf
(
LOGFILE
,
"%u %s %u %u %d %d %s - %s
\n
"
,
job_ptr
->
job_id
,
job_ptr
->
partition
,
(
int
)
job_ptr
->
star
t_time
,
(
int
)
time
,
(
int
)
job_ptr
->
details
->
submi
t_time
,
(
int
)
time
,
job_ptr
->
user_id
,
job_ptr
->
group_id
,
block_id
,
data
)
<
0
)
rc
=
SLURM_ERROR
;
...
...
This diff is collapsed.
Click to expand it.
src/sacct/options.c
+
5
−
0
View file @
e1ccf7d9
...
...
@@ -1100,6 +1100,9 @@ void do_dump(void)
step
->
exitcode
=
1
;
}
_dump_header
(
step
->
header
);
if
(
step
->
end
==
0
)
step
->
end
=
job
->
end
;
gmtime_r
(
&
step
->
end
,
&
ts
);
printf
(
"JOB_STEP 1 50 %u %04d%02d%02d%02d%02d%02d "
,
step
->
stepnum
,
...
...
@@ -1746,6 +1749,8 @@ void do_list(void)
if
(
!
selected_status
[
step
->
status
])
continue
;
}
if
(
step
->
end
==
0
)
step
->
end
=
job
->
end
;
print_fields
(
JOBSTEP
,
step
);
}
list_iterator_destroy
(
itr_step
);
...
...
This diff is collapsed.
Click to expand it.
src/sacct/process.c
+
45
−
14
View file @
e1ccf7d9
...
...
@@ -28,19 +28,27 @@
#include
"sacct.h"
job_rec_t
*
_find_job_record
(
acct_header_t
header
);
job_rec_t
*
_find_job_record
(
acct_header_t
header
,
int
type
);
int
_remove_job_record
(
uint32_t
jobnum
);
step_rec_t
*
_find_step_record
(
job_rec_t
*
job
,
long
jobstep
);
job_rec_t
*
_init_job_rec
(
acct_header_t
header
);
step_rec_t
*
_init_step_rec
(
acct_header_t
header
);
int
_parse_line
(
char
*
f
[],
void
**
data
);
job_rec_t
*
_find_job_record
(
acct_header_t
header
)
job_rec_t
*
_find_job_record
(
acct_header_t
header
,
int
type
)
{
job_rec_t
*
job
=
NULL
;
ListIterator
itr
=
list_iterator_create
(
jobs
);
while
((
job
=
(
job_rec_t
*
)
list_next
(
itr
))
!=
NULL
)
{
if
(
job
->
header
.
jobnum
==
header
.
jobnum
)
{
if
(
job
->
header
.
job_submit
==
0
&&
type
==
JOB_START
)
{
list_remove
(
itr
);
destroy_job
(
job
);
job
=
NULL
;
break
;
}
if
(
job
->
header
.
job_submit
==
BATCH_JOB_TIMESTAMP
)
{
job
->
header
.
job_submit
=
header
.
job_submit
;
break
;
...
...
@@ -64,6 +72,23 @@ job_rec_t *_find_job_record(acct_header_t header)
return
job
;
}
int
_remove_job_record
(
uint32_t
jobnum
)
{
job_rec_t
*
job
=
NULL
;
int
rc
=
SLURM_ERROR
;
ListIterator
itr
=
list_iterator_create
(
jobs
);
while
((
job
=
(
job_rec_t
*
)
list_next
(
itr
))
!=
NULL
)
{
if
(
job
->
header
.
jobnum
==
jobnum
)
{
list_remove
(
itr
);
destroy_job
(
job
);
rc
=
SLURM_SUCCESS
;
}
}
list_iterator_destroy
(
itr
);
return
rc
;
}
step_rec_t
*
_find_step_record
(
job_rec_t
*
job
,
long
stepnum
)
{
step_rec_t
*
step
=
NULL
;
...
...
@@ -229,15 +254,20 @@ void process_start(char *f[], int lc, int show_full)
job_rec_t
*
temp
=
NULL
;
_parse_line
(
f
,
(
void
**
)
&
temp
);
job
=
_find_job_record
(
temp
->
header
);
job
=
_find_job_record
(
temp
->
header
,
JOB_START
);
if
(
job
)
{
/* Hmmm... that's odd */
fprintf
(
stderr
,
"Conflicting JOB_START for job %u at"
" line %d -- ignoring it
\n
"
,
job
->
header
.
jobnum
,
lc
);
input_error
++
;
destroy_job
(
temp
);
return
;
printf
(
"job->header.job_submit = %d"
,
(
int
)
job
->
header
.
job_submit
);
if
(
job
->
header
.
job_submit
==
0
)
_remove_job_record
(
job
->
header
.
jobnum
);
else
{
fprintf
(
stderr
,
"Conflicting JOB_START for job %u at"
" line %d -- ignoring it
\n
"
,
job
->
header
.
jobnum
,
lc
);
input_error
++
;
destroy_job
(
temp
);
return
;
}
}
job
=
temp
;
...
...
@@ -256,7 +286,7 @@ void process_step(char *f[], int lc, int show_full)
_parse_line
(
f
,
(
void
**
)
&
temp
);
job
=
_find_job_record
(
temp
->
header
);
job
=
_find_job_record
(
temp
->
header
,
JOB_STEP
);
if
(
temp
->
stepnum
==
-
2
)
{
destroy_step
(
temp
);
...
...
@@ -308,7 +338,8 @@ void process_step(char *f[], int lc, int show_full)
step
=
temp
;
temp
=
NULL
;
list_append
(
job
->
steps
,
step
);
if
(
job
->
header
.
timestamp
==
0
)
job
->
header
.
timestamp
=
step
->
header
.
timestamp
;
job
->
job_step_seen
=
1
;
job
->
ntasks
+=
step
->
ntasks
;
if
(
!
job
->
nodes
||
!
strcmp
(
job
->
nodes
,
"(unknown)"
))
{
...
...
@@ -371,7 +402,7 @@ void process_suspend(char *f[], int lc, int show_full)
job_rec_t
*
temp
=
NULL
;
_parse_line
(
f
,
(
void
**
)
&
temp
);
job
=
_find_job_record
(
temp
->
header
);
job
=
_find_job_record
(
temp
->
header
,
JOB_SUSPEND
);
if
(
!
job
)
job
=
_init_job_rec
(
temp
->
header
);
...
...
@@ -390,7 +421,7 @@ void process_terminated(char *f[], int lc, int show_full)
job_rec_t
*
temp
=
NULL
;
_parse_line
(
f
,
(
void
**
)
&
temp
);
job
=
_find_job_record
(
temp
->
header
);
job
=
_find_job_record
(
temp
->
header
,
JOB_TERMINATED
);
if
(
!
job
)
{
/* fake it for now */
job
=
_init_job_rec
(
temp
->
header
);
if
(
params
.
opt_verbose
>
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