# # This awk script will take the information from bjobs -l -uall on agave.tamu.edu and display it in column format # # This script was created by Lisa M. Perez at the Laboratory for Molecular Simulation and is provided as is and may give incorrect # results periodically. # # Please e-mail Lisa M. Perez at mouse@mail.chem.tamu.edu with problems. # # To use this script you should make an alias in your .cshrc or .login file: # # alias qa 'bjobs -l -uall | awk -f ~/bjobs.awk' # # This alias implies that you put bjobs.awk in your home directory and you will type qa to execute # # last updated 11/13/03 # BEGIN { FS="<|>";i=0 print " Time Time CPU CPU MEM(MB) MEM(MB) Queue S " print " User Job ID Job Name Submitted Started Proc Limit Used Req Used " print "----------------------------------------------------------------------------------------------------------------------------------------"} # read in the information to the array head # each line between User and SCHEDULING will be appended /User/,/SCHEDULING/ { if (/User/) {i=i+1} temp=$0 sub (/^ */, "",temp) head[i]=head[i]temp } END { for (l=1;l<=i;l++) { # split each record into fields with dividers < > and , split(head[l],a,FS="<|>|,") for (k=1;k<=50;k++) { # Get the user name if ( a[k] ~ /User/ ) U[l] = (a[k+1]) # Get the Job ID if ( a[k] == "Job ") J[l] = (a[k+1]) # Get the Job Name if there is one if ( a[k] ~ /Job Name/ ) JN[l] = (a[k+1]) # Get the Status if ( a[k] ~ /Status/ ) S[l] = (a[k+1]) # Get the Queue if ( a[k] ~ /Queue/ ) Q[l] = (a[k+1]) ### MEMORY ### # Get the Memory of running jobs if ( a[k] ~ /MEM:/ ) {split(a[k],b,FS="MEM: | Mbytes");UM[l] = (b[2])} # Get the Memory Limit of Queued jobs if ( a[k] ~ /MEMLIMIT/ ) {split(a[k],b,FS="MEMLIMIT| K");ML[l] = (b[2]/1000)} # Get the Requested Memory if ( a[k] ~ /-M/ ) {x=split(a[k],b,FS="")} for (n=1;n