Ignore:
Timestamp:
04/14/12 19:52:40 (12 years ago)
Author:
aclsce
Message:

Added check to be sure there is enough space on temporary filesystems (only on vargas, titane and mercure sx9).
If there is not enough space, we stop.

File:
1 edited

Legend:

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

    r645 r651  
    15871587 
    15881588} 
     1589 
     1590############################################################ 
     1591# Check of space available on temporary filesytems 
     1592function IGCM_sys_check_quota { 
     1593  IGCM_debug_PushStack "IGCM_sys_check_quota"  
     1594  if ( $DEBUG_sys ) ; then 
     1595    echo "IGCM_sys_check_quota " 
     1596  fi 
     1597  # Limit of quota (in %) 
     1598  limit_quota=90 
     1599 
     1600  # Check of the volume 
     1601  volume_quota=$(ccc_quota | grep ' scratch' | awk '{print $2}') 
     1602  volume_avail=$(ccc_quota | grep ' scratch' | awk '{print $3}') 
     1603 
     1604  if ( [ ! X${volume_quota} = X ] && [ ! ${volume_quota} = "-" ] ) ; then 
     1605 
     1606    unit_avail=${volume_avail: -1} 
     1607    unit_quota=${volume_quota: -1} 
     1608 
     1609    temp_avail=${volume_avail%%${volume_avail: -1}*} 
     1610    temp_quota=${volume_quota%%${volume_quota: -1}*} 
     1611 
     1612    if [ ! ${unit_avail} = ${unit_quota} ] ; then 
     1613 
     1614    # Convertion 
     1615      if [ ${volume_avail: -1} = "T" ] ; then 
     1616          (( temp_avail = temp_avail * 1000000000000 )) 
     1617      elif [ ${volume_avail: -1} = "G" ] ; then 
     1618          (( temp_avail = temp_avail * 1000000000 )) 
     1619      elif [ ${volume_avail: -1} = "M" ] ; then 
     1620          (( temp_avail = temp_avail * 1000000 )) 
     1621      elif [ ${volume_avail: -1} = "k" ] ; then 
     1622          (( temp_avail = temp_avail * 1000 )) 
     1623      else 
     1624          (( temp_avail = volume_avail )) 
     1625      fi 
     1626      if [ ${volume_quota: -1} = "T" ] ; then 
     1627          (( temp_quota = temp_quota * 1000000000000 )) 
     1628      elif [ ${volume_quota: -1} = "G" ] ; then 
     1629          (( temp_quota = temp_quota * 1000000000 )) 
     1630      elif [ ${volume_quota: -1} = "M" ] ; then 
     1631          (( temp_quota = temp_quota * 1000000 )) 
     1632      elif [ ${volume_quota: -1} = "k" ] ; then 
     1633          (( temp_quota = temp_quota * 1000 )) 
     1634      else 
     1635          (( temp_quota = volume_quota )) 
     1636      fi 
     1637    fi 
     1638 
     1639    quota_volume=$(echo "scale=2 ; $temp_quota/$temp_avail*100" | bc) 
     1640#    echo "volume ratio is " $quota_volume 
     1641 
     1642    if [ ${quota_volume} -ge ${limit_quota} ] ; then 
     1643      IGCM_debug_Print 1 "Please, check your quota of inode on scratch" 
     1644      IGCM_debug_Print 1 "Use the ccc_quota command" 
     1645      IGCM_debug_Print 1 "You must have more than 10% available to run" 
     1646      IGCM_debug_Exit "Not enough space to run ! STOP HERE" 
     1647      IGCM_debug_Verif_Exit 
     1648    fi 
     1649 
     1650  fi 
     1651  IGCM_debug_PopStack "IGCM_sys_check_quota" 
     1652} 
Note: See TracChangeset for help on using the changeset viewer.