Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 86 lines (58 sloc) 3.57 KB
#!/bin/bash
# Cron script to generate periodic plot and push them to remote host
#-----------------------------------------------------------------------
# Configuration
#-----------------------------------------------------------------------
REMOTE_HOST=xdmod.hpc.uconn.edu
REMOTE_USER=hpcstats
REMOTE_DIR=plots
# Load needed modules
#module load gcc/5.4.0-alt tcl/8.6.6.8606 sqlite/3.18.0 python/3.6.3-gcc540a
# Directories
TOP_DIR=/var/db/hpc_stats
PLOTDIR=$TOP_DIR/plots
DATADIR=$TOP_DIR/data
# Location of programs and scripts
HPCSTATS=$TOP_DIR/hpc_stats.py
RSYNC=/usr/bin/rsync
# Location of temporary, overwritten data file
DATAFILE=$DATADIR/sacct.dat
#-----------------------------------------------------------------------
# Main
#-----------------------------------------------------------------------
# Make needed directories
mkdir -p $DATADIR
mkdir -p $PLOTDIR
# Read latest SACCT data and write to local text file
$HPCSTATS -S 14d -W $DATAFILE
# Basic plots: partition, qos, account, user
# Range Plot-type TopN Plot-destination Plot-title
$HPCSTATS -S 14d -a partition -n10 -g $PLOTDIR/partition.png -t "Top 10 Partitions" $DATAFILE
$HPCSTATS -S 14d -a qos -n10 -g $PLOTDIR/qos.png -t "Top 10 QoS" $DATAFILE
$HPCSTATS -S 14d -a account -n10 -g $PLOTDIR/account.png -t "Top 10 Accounts" $DATAFILE
$HPCSTATS -S 14d -a user -n10 -g $PLOTDIR/user.png -t "Top 10 Users" $DATAFILE
# Users in Partition General
$HPCSTATS -S 14d -a user -n10 -F partition:general -g $PLOTDIR/user.general.png -t "Top 10 Users in the General Partition" $DATAFILE
# Users in Partition Serial
$HPCSTATS -S 14d -a user -n10 -F partition:serial -g $PLOTDIR/user.serial.png -t "Top Users in Serial Partition" $DATAFILE
# Users in Partition HaswellPreempt
$HPCSTATS -S 14d -a user -n10 -F partition:haswellpreempt -g $PLOTDIR/haswellpreempt.png -t "Top Users in HaswellPreempt Partition" $DATAFILE
# Users in Partition HaswellPriority
$HPCSTATS -S 14d -a user -n10 -F partition:haswellpriority -g $PLOTDIR/haswellpriority.png -t "Top Users in HaswellPriority Partition" $DATAFILE
# QOS in Parition HaswellPriority
$HPCSTATS -S 14d -a qos -n10 -F partition:haswellpriority -g $PLOTDIR/qos_in_part_haswellpriority.png -t "Top 10 QOS in Haswell Partition" $DATAFILE
# Users in Partition SkylakePriority
$HPCSTATS -S 14d -a user -n10 -F partition:skylakepriority -g $PLOTDIR/skylakepriority.png -t "Top Users in SkylakePriority Partition" $DATAFILE
# QOS in Parition SkylakePriority
$HPCSTATS -S 14d -a qos -n10 -F partition:skylakepriority -g $PLOTDIR/qos_in_part_skylakepriority.png -t "Top 10 QOS in SkylakePriority Partition" $DATAFILE
# Users in Partition Gnupriority
$HPCSTATS -S 14d -a user -n10 -F partition:gnupriority -g $PLOTDIR/gnupriority.png -t "Top Users in gnupriority Partition" $DATAFILE
# Users in Partition gpu_v100
$HPCSTATS -S 14d -a user -n10 -F partition:gpu_v100 -g $PLOTDIR/gnu_v100.png -t "Top Users in GPU_V100 Partition" $DATAFILE
# Prof. Ying Li's students (temporary)
$HPCSTATS -S 14d -a user -F user:doz17005,hsh14001,jic17022,jof16106,lem12013,pes11006,sad16109 -S 21d -g $PLOTDIR/ying.li.png -t "Ying Li's Students" $DATAFILE
# Users in QOS ramphaswell (Prof Rampi's students)
$HPCSTATS -S 14d -a user -F qos:ramphaswell -g $PLOTDIR/user_in_qos_ramphaswell.png -t "Users in QOS ramphaswell" $DATAFILE
# Users in QOS Xinhuz (Prof Xin's students)
$HPCSTATS -S 14d -a user -F qos:xinyuz -g $PLOTDIR/xiz14026.png -t "Users in QOS xinhuz" $DATAFILE
$RSYNC -a $PLOTDIR/ $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR