Ignore:
Timestamp:
10/07/13 16:35:45 (11 years ago)
Author:
labetoulle
Message:

RunChecker? :

  • Introduction of getopts to process command line options
  • new option -r to check running simulations

(#131)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh

    r948 r955  
    16821682    echo "IGCM_sys_GetDate_FichWork :" $@ 
    16831683  fi 
     1684 
     1685  if [ $# -ge 3 ] ; then 
     1686    mode=$3 
     1687    TimeStyle=$4 
     1688  else 
     1689    mode="default" 
     1690    TimeStyle="%Y%m%d%H%M%S" 
     1691  fi 
     1692 
    16841693  typeset dateF 
    1685   set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} ) 
    1686   eval ${2}=${dateF[5]} 
     1694  set +A dateF -- $( ls -l --full-time --time-style=+"${TimeStyle}" ${1} ) 
     1695 
     1696  case $mode in 
     1697    "default") 
     1698      eval ${2}=${dateF[5]} 
     1699      ;; 
     1700    "SplitFields") 
     1701      eval ${2}="${dateF[5]}\ ${dateF[6]}" 
     1702      ;; 
     1703  esac 
     1704 
    16871705 
    16881706  # donne la date filesys d'un fichier sur la machine work 
     
    23372355  # With -f option, the full job name is given in the last column 
    23382356  NbRun=$( ccc_mstat -f | gawk -v JobName=$1 'BEGIN { x=0 } ( $NF ~ JobName ) { x=x+1 } END { print x }' ) 
     2357  set -A JobID= 
    23392358 
    23402359  eval ${2}=${NbRun} 
    23412360 
    23422361  IGCM_debug_PopStack "IGCM_sys_CountJobInQueue" 
     2362} 
     2363 
     2364#D-#================================================== 
     2365#D-function IGCM_sys_ListJobInQueue 
     2366#D-* Purpose: Check if job_name is currently 
     2367#D-  running or in queue 
     2368#D-* Examples: IGCM_sys_ListJobInQueue ${User} JobNameList 
     2369#D- 
     2370function IGCM_sys_ListJobInQueue { 
     2371  IGCM_debug_PushStack "IGCM_sys_ListJobInQueue" 
     2372  if ( $DEBUG_sys ) ; then 
     2373    echo "IGCM_sys_ListJobInQueue" 
     2374  fi 
     2375 
     2376  # With -f option, the full job name is given in the last column 
     2377  set -A JobList $( ccc_mstat -f | gawk -v User=$1             \ 
     2378                                        '( $2  == User      && \ 
     2379                                           $NF != /TS/      && \ 
     2380                                           $NF !~ /PACK/    && \ 
     2381                                           $NF !~ /REBUILD/ && \ 
     2382                                           $NF !~ /pack/ )     \ 
     2383                                         { print $NF }' | sed -e "s/\(.*\)\.[0-9]*/\1/" ) 
     2384 
     2385  eval set -A ${2} ${JobList[*]} 
     2386 
     2387  IGCM_debug_PopStack "IGCM_sys_ListJobInQueue" 
    23432388} 
    23442389 
Note: See TracChangeset for help on using the changeset viewer.