Job Budgeting CLI Client Tools
This section covers the command-line utilities get_energy and get_energy_admin
used to query job energy consumption and (for admins) monitoring data for partitions or nodes.
These tools are typically installed as binaries available in your $PATH (e.g., on cluster login nodes).
You do not need access to this repository to use them.
Important behavior
-c/--cluster-nameis required in both tools and must match a valid cluster name for your deployment.- You must provide at least one filter, otherwise the tool prints help and exits.
Ctrl+Ccancels an in-flight request on the server.
Standard User Guide: get_energy
Use this tool to query energy consumption for your finished jobs, or for finished jobs in projects where you share membership with another user. Running jobs are not supported.
Basic usage
get_energy -c <cluster_name> --allFilters and access rules
--allreturns all your jobs in the specified time window.-j/--job-idfilters by a specific SLURM job ID.-u/--usernameis allowed only if you and the requested user share at least one account.-a/--accountis allowed only if you are a member of that account.-s1/--submit-time-start,-s2/--submit-time-end,-s3/--submit-time-exactfilter by submit time.- Times are UNIX timestamps.
- If you do not pass
-s1, the tool sets a default start time to “now minus ~182 days”.
If you do not pass -a/--account, the tool automatically queries all accounts returned by sacctmgr
for your user and submits them as the project filter to the API.
Output options
-f/--formatselectssum(default) orlist.sumaggregates totals across all matching jobs.listreturns per-job rows and includes job-level errors.
-o/--outputselectstable(default),json, orcsv.csvwrites a file. Use--output-pathto control the path or directory.
-x/--calculate-if-missingretries missing energy calculations (may take longer).
Examples
# All your jobs on a cluster in the last ~182 days (default window)
get_energy -c <cluster_name> --all
# Single job, sum output in JSON
get_energy -c <cluster_name> -j 123456 -o json
# Jobs in a specific account (must be your account)
get_energy -c <cluster_name> -a my_project --all
# Jobs submitted in a specific range (timestamps)
get_energy -c <cluster_name> --all -s1 1735689600 -s2 1738291200
# CSV export to a specific file
get_energy -c <cluster_name> --all -o csv --output-path energy_cluster.csvAdmin Guide: get_energy_admin
This tool supports two modes:
jobs(default): query job energy consumption for any account or user.monitoring: query energy consumption for partitions or specific nodes.
At IT4I, get_energy_admin is typically installed only on dedicated management nodes (e.g., sca-ha) and is not available on standard login nodes.
Basic usage
get_energy_admin -c <cluster_name> -m jobs -j 123456Jobs mode
Filters are similar to get_energy but without user/account restrictions.
-j/--job-id,-u/--username,-a/--account-s1/--submit-time-start,-s2/--submit-time-end,-s3/--submit-time-exact-f/--format(sumorlist)-o/--output(jsondefault, ortable)-x/--calculate-if-missing
Example:
get_energy_admin -c <cluster_name> -m jobs -u alice -s1 1735689600 -s2 1738291200 -f list -o tableMonitoring mode
This feature is supported on the server side only for Deucalion. For IT4I it is work in progress or feature work.
Monitoring queries require either a partition name or a node list.
-p/--partition_namesupportsx86_cnx,x86_gnx,arm_cna.-n/--node_listis a comma-separated list, e.g.cnx481,cnx482,cnx483.-s/--start_timeand-e/--end_timedefine the time window and must be provided together if used.
Examples:
# Partition-wide monitoring (latest available window on server)
get_energy_admin -c <cluster_name> -m monitoring -p x86_cnx
# Specific nodes for a time window
get_energy_admin -c <cluster_name> -m monitoring -n cnx481,cnx482 -s 1735689600 -e 1738291200
