Skip to main content

Pandas sacct

Provides an Sacct class interface to the Slurm.

In general options to sacct (see man sacct) can passed by keyword to Sacct.

Usage

  • Sacct(flag=True) corresponds to sacct --flag.
  • Sacct(key=value) corresponds to sacct --key=value.
  • starttime and endtime options support both string and types that support .isoformat() such as pd.Timestamp().

examples

import sacct
s = sacct.Sacct(starttime="2020-08-30T00:00:00", endtime="2020-08-31T00:00:00", allocations=True)
df = s.execute()
print(s)
print(df.head())
sacct --format=jobidraw,start,end,nodelist --noheader --parsable2 --truncate --allocations --starttime=2020-08-30T00:00:00 --endtime=2020-08-31T00:00:00
   jobidraw               start                 end    nodelist
0  33891896 2020-08-30 03:01:58 2020-08-30 03:15:14  [nid01454]
1  33891898 2020-08-30 03:01:58 2020-08-30 03:04:59  [nid01565]
2  33891899 2020-08-30 03:07:13 2020-08-30 03:10:10  [nid01163]
3  33891900 2020-08-30 03:01:58 2020-08-30 03:15:56  [nid01998]
4  33891902 2020-08-30 03:01:58 2020-08-30 03:04:54  [nid01716]
import sacct
import pandas as pd
t0 = pd.Timestamp("2020-08-30T00:00:00")
t1 = t0 + pd.Timedelta(days=1)
s = sacct.Sacct(starttime=t0, endtime=t1, allocations=True, format=['jobidraw', 'jobname'], allusers=True)
df = s.execute()
print(s)
print(df.head())
sacct --format=jobidraw,jobname --noheader --parsable2 --truncate --allocations --starttime=2020-08-30T00:00:00 --endtime=2020-08-31T00:00:00 --allusers
   jobidraw   jobname
0  27731125  JT_D1_16
1  27731129  JT_D1_16
2  27731131  JT_D1_16
3  27731136  JT_D1_16
4  27731165  JT_D2_16
import sacct
import pandas as pd
t0 = pd.Timestamp("2020-08-30T00:00:00")
t1 = t0 + pd.Timedelta(days=1)
s = sacct.Sacct(starttime=t0, endtime=t1, format=['jobidraw', 'jobname'], allusers=True)
df = s.execute()
print(s)
print(df.head())
sacct --format=jobidraw,jobname --noheader --parsable2 --truncate --starttime=2020-08-30T00:00:00 --endtime=2020-08-31T00:00:00 --allusers
   jobidraw    step   jobname
0  29056157   batch     batch
1  29056157  extern    extern
2  29056157       0  lmp_cori
3  29056168   batch     batch
4  29056168  extern    extern

Specific sacct command (optional):

s = sacct.Sacct(sacct_cmd="/usr/bin/sacct", starttime="2020-08-30T00:00:00", endtime="2020-08-31T00:00:00", allocations=True)

Copywrite Notice

Pandas-sacct Copyright (c) 2020, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Intellectual Property Office at IPO@lbl.gov.

NOTICE. This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit others to do so.

Release files for pandas-sacct 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pandas-sacct 1.2.0
File Size Uploaded
pandas-sacct-1.2.0.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pandas-sacct 1.2.0
File Interpreter ABI Platform
pandas_sacct-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / pandas-sacct-1.2.0.tar.gz

Download URL pandas-sacct-1.2.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
24034ab1682f64e9955773d044635c7741449d128b9e04519cb3d1acfdf10c2b
BLAKE2b-256 checksum
How to use checksums
5e0e888a695f56fee68f3dfe0f9382e67428abbdfb49b2676130fa294753d00a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

Release files / pandas_sacct-1.2.0-py3-none-any.whl

Download URL pandas_sacct-1.2.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
313451d8b54f48515a563b82688e73ce5c1ec34ecc7e0f5099f8bec93b0b2a96
BLAKE2b-256 checksum
How to use checksums
927062e0e08b6bb08438c71c04f5081f1d9925df9e4c2c232e81508a358560c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page