Sacct is a command-line tool that is used to display various types of accounting data from the Slurm workload manager. Slurm is an open-source, highly scalable workload manager designed for high-performance computing (HPC) clusters and supercomputers. It is used to schedule, manage and monitor jobs running on a cluster.
The sacct command allows system administrators and users to view job accounting information such as the start and end times of jobs, resource usage statistics (CPU, memory, and I/O), job exit status, job priority, job dependencies, and more. It provides a flexible and customizable interface that allows users to display various types of job accounting data in different formats.
The sacct command can be used to display data in different ways, including summarizing data by job, user, or account. The output can be customized using various options to filter and format the data. For example, you can use the -j option to display data for a specific job, -u option to display data for a specific user, and -S and -E options to display data for jobs that started and ended within a specific time range.
sacct Command Examples
1. Display job id, job name, partition, account, number of allocated cpus, job state, and job exit codes for recent jobs:
2. Display job id, job state, job exit code for recent jobs:
# sacct --brief
3. Display the allocations of a job:
# sacct --jobs job_id --allocations
4. Display elapsed time, job name, number of requested CPUs, and memory requested of a job:
# sacct --jobs job_id --format=elapsed,jobname,reqcpus,reqmem
Overall, sacct is a powerful tool for managing and monitoring job accounting data in a Slurm cluster. It provides valuable insights into the performance of the cluster and helps system administrators optimize resource allocation to ensure maximum efficiency.