Skip to content

Commit

Permalink
Merge branch 'RESTAPI-929-elapsed-time' into 'master'
Browse files Browse the repository at this point in the history
Update acct result

See merge request firecrest/firecrest!254
  • Loading branch information
ekouts committed Nov 23, 2023
2 parents ccc572f + 1f4dda1 commit 6b23b99
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support listing directories without resolving UID/GID.
- Add description for each parameter in `GET /status/parameters` response.
- Add support for Object Storage Tenants in S3v4 object storage. The associated environment variable is `F7T_S3_TENANT` and it can be empty or be `null` or `none` when the tenant is not needed. Otherwise the tenant name has to be set.
- The task that is returned from a successful `GET /jobs/acct` would returns the attribute `time`, which is `cputime` from slurm. The attribute will remain and `cputime` and `elapsed` will be also returned. Similarly, `time_left` is actually the time of termination of the jobs. `time_left` will remain for compatibility reasons, but `elapsed` attribute will also be returned.

## Changed

Expand Down
6 changes: 6 additions & 0 deletions doc/openapi/firecrest-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,12 @@ components:
type: string
time:
type: string
cpu_time:
type: string
elapsed_time:
type: string
termination_time:
type: string
time_left:
type: string
nodes:
Expand Down
6 changes: 6 additions & 0 deletions doc/openapi/firecrest-developers-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2840,6 +2840,12 @@ components:
type: string
time:
type: string
cpu_time:
type: string
elapsed_time:
type: string
termination_time:
type: string
time_left:
type: string
nodes:
Expand Down
5 changes: 4 additions & 1 deletion src/common/schedulers/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def accounting(self, username=None, jobids=None, start_time=None, end_time=None)

# --parsable2 = limits with | character not ending with it
cmd += [
"--format='jobid,partition,jobname,user,state,start,cputime,end,NNodes,NodeList,ExitCode'",
"--format='jobid,partition,jobname,user,state,start,cputime,end,NNodes,NodeList,ExitCode,elapsed'",
"--noheader",
"--parsable2",
]
Expand All @@ -206,6 +206,9 @@ def parse_accounting_output(self, output):
"state": job_info[4],
"start_time": job_info[5],
"time": job_info[6],
"cpu_time": job_info[6],
"elapsed_time": job_info[11],
"termination_time": job_info[7],
"time_left": job_info[7],
"nodes": job_info[8],
"nodelist": job_info[9],
Expand Down

0 comments on commit 6b23b99

Please sign in to comment.