source: lmdz_wrf/trunk/tools/check_PBS.bash @ 545

Last change on this file since 545 was 457, checked in by lfita, 9 years ago

Fixing `queue' variable

  • Property svn:executable set to *
File size: 1.6 KB
RevLine 
[456]1#!/bin/bash
2if test $1 = '-h'; then
3  echo "***********************************"
4  echo "*** Script to verify owned jobs ***"
5  echo "***********************************"
6  echo "check_PBS.bash [jobNum](job number or nothing for all jobs)"
7else
8  Njob=$1
9
10  if test $# -eq 1; then
11    jobs=${Njob}
12  else
13    server=`qstat -f | grep server | head -n 1 | awk '{print $3}' | tr '.' ' ' | awk '{print $1}'`
14    jobs=`qstat -u $USER | grep ${server} | awk '{print $1}' | grep -v ':'`
15  fi
16
17  for job in ${jobs}; do
18    numjob=`echo ${job} | tr '.' ' ' | awk '{print $1}'`
19    echo ${numjob}"..."
20    qstat -f -1 ${numjob} >& allout.tmp
21    jname=`cat allout.tmp | grep Job_Name | awk '{print $3}'`
22    rundir=`dirname $(cat allout.tmp | grep Output_Path | awk '{print $3}' | tr ':' ' ' | awk '{print $2}')`
23    statusv=`cat allout.tmp | grep job_state | awk '{print $3}'`
[457]24    queue=`cat allout.tmp | grep queue | grep -v type | awk '{print $3}'`
[456]25    nodes=`cat allout.tmp | grep Resource_List.nodes | awk '{print $3}'`
26    vmem=`cat allout.tmp | grep Resource_List.vmem | awk '{print $3}'`
27    walltime=`cat allout.tmp | grep Resource_List.walltime | awk '{print $3}'`
28    runtime=`cat allout.tmp | grep resources_used.walltime | awk '{print $3}'`
29
30    echo ${numjob}"  jobName: "${jname}
31    echo ${numjob}"  rundir: "${rundir}
32    echo ${numjob}"  status: "${statusv}
33    echo ${numjob}"  queue: "${queue}
34    echo ${numjob}"  nodes: "${nodes}
35    echo ${numjob}"  vmem: "${vmem}
36    echo ${numjob}"  walltime: "${walltime}
37    echo ${numjob}"  runtime: "${runtime}
38
39#    exit
40 
41  done
42  rm allout.tmp
43fi
Note: See TracBrowser for help on using the repository browser.