我正在使用SLURM调度系统的大学集群(常规用户,无管理员权限)上运行作业,并且我有兴趣绘制随时间推移(即作业运行时)的CPU和内存使用情况。我知道sacct和 sstat我的想法,包括在我的提交脚本这些命令,如东西线
#!/bin/bash
#SBATCH <options>
# Running the actual job in background
srun my_program input.in output.out &
# While loop that records resources
JobStatus="$(sacct -j $SLURM_JOB_ID | awk 'FNR == 3 {print $6}')"
FIRST=0
#sleep time in seconds
STIME=15
while [ "$JobStatus" != "COMPLETED" ]; do
#update job status
JobStatus="$(sacct -j $SLURM_JOB_ID | awk 'FNR == 3 {print $6}')"
if [ "$JobStatus" == "RUNNING" ]; then
if [ $FIRST -eq 0 ]; then
sstat --format=AveCPU,AveRSS,MaxRSS -P -j …Run Code Online (Sandbox Code Playgroud)