Changeset 811
- Timestamp:
- 03/05/13 15:39:16 (11 years ago)
- Location:
- trunk/libIGCM/libIGCM_sys
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh
r809 r811 251 251 echo "IGCM_sys_RshPost :" $@ 252 252 fi 253 254 # keep standard input to keep it for postpone if ulam don't answer 253 # keep standard input (stdin) for the loop onto temporary file 255 254 cat >/tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 256 255 … … 627 626 IGCM_debug_PushStack "IGCM_sys_Qsub" $@ 628 627 629 typeset ERROR 630 ERROR=0 628 typeset status 631 629 632 630 if ( $DEBUG_sys ) ; then … … 639 637 -e "s:\# \@ error *= .*:\# \@ error = ${Script_Output}:" \ 640 638 $1 > ${REP_FOR_JOB}/JOB_FOR_IGCM 641 cd $REP_FOR_JOB ; /usr/bin/llsubmit JOB_FOR_IGCM ; ERROR=$? ; cd - ;642 643 if [ ${ ERROR} -gt 0 ] ; then644 echo "IGCM_sys_Qsub : erreur $@"639 cd $REP_FOR_JOB ; /usr/bin/llsubmit JOB_FOR_IGCM ; status=$? ; cd - ; 640 641 if [ ${status} -gt 0 ] ; then 642 IGCM_debug_Print 2 "IGCM_sys_Qsub $1 : error code ${status}" 645 643 IGCM_debug_Exit "IGCM_sys_Qsub" 646 644 else … … 658 656 IGCM_debug_PushStack "IGCM_sys_QsubPost" $@ 659 657 660 typeset ERROR 661 ERROR=0 658 typeset status 662 659 663 660 if ( $DEBUG_sys ) ; then … … 672 669 ${libIGCM_POST}/$1.job > ${REP_FOR_JOB}/JOB_FOR_IGCM 673 670 674 cd $REP_FOR_JOB ; /usr/bin/llsubmit JOB_FOR_IGCM ; ERROR=$? ; cd - ;675 if [ ${ ERROR} -gt 0 ] ; then676 echo "IGCM_sys_QsubPost : erreur $@."671 cd $REP_FOR_JOB ; /usr/bin/llsubmit JOB_FOR_IGCM ; status=$? ; cd - ; 672 if [ ${status} -gt 0 ] ; then 673 IGCM_debug_Print 2 "IGCM_sys_QsubPost $1 : error code ${status}" 677 674 IGCM_debug_Exit "IGCM_sys_QsubPost" 678 675 else 679 676 IGCM_sys_Rm ${REP_FOR_JOB}/JOB_FOR_IGCM 680 677 fi 681 682 678 IGCM_debug_PopStack "IGCM_sys_QsubPost" 683 679 } … … 800 796 #D-#================================================== 801 797 #D-function IGCM_sys_Miror_libIGCM 802 #D-* Purpose: Mirror libIGCM PATH and lib to ulam798 #D-* Purpose: Mirror libIGCM PATH and lib to frontend 803 799 #D-* Examples: 804 800 #D- … … 818 814 819 815 if [ ${status} -gt 0 ] ; then 820 echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on cesium."816 echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on frontend." 821 817 cat out_rsync 822 818 fi … … 1214 1210 fi 1215 1211 echo $( basename $1 ) 1216 1217 1212 IGCM_debug_PopStack "IGCM_sys_PrepareTaredRestart" 1218 1213 } … … 1615 1610 # REBUILD OPERATOR 1616 1611 1612 #D-#================================================== 1613 #D-function IGCM_sys_rebuild 1614 #D-* Purpose: rebuild parallel files 1615 #D-* Examples: 1616 #D- 1617 1617 function IGCM_sys_rebuild { 1618 1618 IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@ … … 1654 1654 } 1655 1655 1656 #D-#================================================== 1657 #D-function IGCM_sys_rebuild_station 1658 #D-* Purpose: rebuild parallel files describing station 1659 #D-* Examples: 1660 #D- 1656 1661 function IGCM_sys_rebuild_station { 1657 1662 IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@ … … 1748 1753 # Activate Running Environnment Variables 1749 1754 1755 #D-#================================================== 1756 #D-function IGCM_sys_desactiv_variables 1757 #D-* Purpose: set environement variables prior to execution 1758 #D-* Examples: 1759 #D- 1750 1760 function IGCM_sys_activ_variables { 1751 1761 IGCM_debug_PushStack "IGCM_sys_activ_variables" 1752 1762 if ( $DEBUG_sys ) ; then 1753 echo "IGCM_sys_activ_variables " 1754 fi 1763 echo "IGCM_sys_activ_variables" 1764 fi 1765 1766 # -------------------------------------------------------------------- 1767 #D- MPI specifications 1768 # -------------------------------------------------------------------- 1769 1770 # -------------------------------------------------------------------- 1771 #D- Other specifications 1772 # -------------------------------------------------------------------- 1755 1773 1756 1774 ulimit -s unlimited … … 1767 1785 # Desactivate Running Environnment Variables 1768 1786 1787 #D-#================================================== 1788 #D-function IGCM_sys_desactiv_variables 1789 #D-* Purpose: unset environement variables after execution 1790 #D-* Examples: 1791 #D- 1769 1792 function IGCM_sys_desactiv_variables { 1770 1793 IGCM_debug_PushStack "IGCM_sys_desactiv_variables" 1771 1794 if ( $DEBUG_sys ) ; then 1772 echo "IGCM_sys_desactiv_variables 1795 echo "IGCM_sys_desactiv_variables" 1773 1796 fi 1774 1797 # -------------------------------------------------------------------- … … 1786 1809 # Build MPI/OMP scripts run file (dummy function) 1787 1810 1811 #D-#================================================== 1812 #D-function IGCM_sys_build_run_file 1813 #D-* Purpose: build run file (deprecated) 1814 #D-* Examples: 1815 #D- 1788 1816 function IGCM_sys_build_run_file { 1789 1817 1790 IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file "1818 IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file " 1791 1819 1792 1820 } … … 1794 1822 ############################################################ 1795 1823 # Build MPI/OMP scripts 1824 1825 #D-#================================================== 1826 #D-function IGCM_sys_build_execution_scripts 1827 #D-* Purpose: build execution scripts to be launch by ${HOST_MPIRUN_COMMAND} 1828 #D-* Examples: 1829 #D- 1796 1830 function IGCM_sys_build_execution_scripts 1797 1831 { … … 1873 1907 else # Only one executable. launch it. 1874 1908 1875 #1876 1909 for comp in ${config_ListOfComponents[*]} ; do 1877 1910 … … 1893 1926 1894 1927 ############################################################ 1895 # Check of space available on temporary filesytems 1928 # Check of space available on temporary filesytems. 1929 1930 #D-#================================================== 1931 #D-function IGCM_sys_check_quota 1932 #D-* Purpose: check user quota. Stop the simulation if quota above 90% 1933 #D-* Examples: 1934 #D- 1896 1935 function IGCM_sys_check_quota { 1897 1936 IGCM_debug_PushStack "IGCM_sys_check_quota" 1898 1937 if ( $DEBUG_sys ) ; then 1899 echo "IGCM_sys_check_quota 1938 echo "IGCM_sys_check_quota" 1900 1939 fi 1901 1940 # Limit of quota (in %) 1902 1941 limit_quota=90 1942 1903 1943 # Check of the volume 1904 1944 volume_quota=$(quota_u -w | grep 'Quota soft' | awk '{print $5}') … … 1925 1965 #D-* Examples: IGCM_sys_CountJobInQueue ${JobName} NbRun 1926 1966 #D- 1927 1928 1967 function IGCM_sys_CountJobInQueue { 1929 1968 IGCM_debug_PushStack "IGCM_sys_CountJobInQueue" … … 1943 1982 # NCO OPERATOR 1944 1983 1984 #D-#================================================== 1985 #D-function IGCM_sys_ncap2 1986 #D-* Purpose: encapsulate ncap2 call so as to manage error code and retry 1987 #D-* Examples: 1988 #D- 1945 1989 function IGCM_sys_ncap2 { 1946 1990 IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ … … 1973 2017 1974 2018 if [ ${status} -gt 0 ] ; then 1975 1976 2019 echo "IGCM_sys_ncap2 : ncap2 error" 2020 IGCM_debug_Exit "ncap2" 1977 2021 fi 1978 2022 … … 1980 2024 } 1981 2025 2026 #D-#================================================== 2027 #D-function IGCM_sys_ncatted 2028 #D-* Purpose: encapsulate ncatted call so as to manage error code and retry 2029 #D-* Examples: 2030 #D- 1982 2031 function IGCM_sys_ncatted { 1983 2032 IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@ … … 2010 2059 2011 2060 if [ ${status} -gt 0 ] ; then 2012 2013 2061 echo "IGCM_sys_ncatted : ncatted error" 2062 IGCM_debug_Exit "ncatted" 2014 2063 fi 2015 2064 … … 2017 2066 } 2018 2067 2068 #D-#================================================== 2069 #D-function IGCM_sys_ncbo 2070 #D-* Purpose: encapsulate ncbo call so as to manage error code and retry 2071 #D-* Examples: 2072 #D- 2019 2073 function IGCM_sys_ncbo { 2020 2074 IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@ … … 2047 2101 2048 2102 if [ ${status} -gt 0 ] ; then 2049 2050 2103 echo "IGCM_sys_ncbo : ncbo error" 2104 IGCM_debug_Exit "ncbo" 2051 2105 fi 2052 2106 … … 2054 2108 } 2055 2109 2110 #D-#================================================== 2111 #D-function IGCM_sys_ncdif 2112 #D-* Purpose: encapsulate ncdiff call so as to manage error code and retry 2113 #D-* Examples: 2114 #D- 2056 2115 function IGCM_sys_ncdiff { 2057 2116 IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@ … … 2084 2143 2085 2144 if [ ${status} -gt 0 ] ; then 2086 2087 2145 echo "IGCM_sys_ncdiff : ncdiff error" 2146 IGCM_debug_Exit "ncdiff" 2088 2147 fi 2089 2148 … … 2091 2150 } 2092 2151 2152 #D-#================================================== 2153 #D-function IGCM_sys_ncea 2154 #D-* Purpose: encapsulate ncea call so as to manage error code and retry 2155 #D-* Examples: 2156 #D- 2093 2157 function IGCM_sys_ncea { 2094 2158 IGCM_debug_PushStack "IGCM_sys_ncea" -- $@ … … 2121 2185 2122 2186 if [ ${status} -gt 0 ] ; then 2123 2124 2187 echo "IGCM_sys_ncea : ncea error" 2188 IGCM_debug_Exit "ncea" 2125 2189 fi 2126 2190 … … 2128 2192 } 2129 2193 2194 #D-#================================================== 2195 #D-function IGCM_sys_ncecat 2196 #D-* Purpose: encapsulate ncecat call so as to manage error code and retry 2197 #D-* Examples: 2198 #D- 2130 2199 function IGCM_sys_ncecat { 2131 2200 IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@ … … 2158 2227 2159 2228 if [ ${status} -gt 0 ] ; then 2160 2161 2229 echo "IGCM_sys_ncecat : ncecat error" 2230 IGCM_debug_Exit "ncecat" 2162 2231 fi 2163 2232 … … 2165 2234 } 2166 2235 2236 #D-#================================================== 2237 #D-function IGCM_sys_ncflint 2238 #D-* Purpose: encapsulate ncflint call so as to manage error code and retry 2239 #D-* Examples: 2240 #D- 2167 2241 function IGCM_sys_ncflint { 2168 2242 IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@ … … 2195 2269 2196 2270 if [ ${status} -gt 0 ] ; then 2197 2198 2271 echo "IGCM_sys_ncflint : ncflint error" 2272 IGCM_debug_Exit "ncflint" 2199 2273 fi 2200 2274 … … 2202 2276 } 2203 2277 2278 #D-#================================================== 2279 #D-function IGCM_sys_ncks 2280 #D-* Purpose: encapsulate ncks call so as to manage error code and retry 2281 #D-* Examples: 2282 #D- 2204 2283 function IGCM_sys_ncks { 2205 2284 IGCM_debug_PushStack "IGCM_sys_ncks" -- $@ … … 2232 2311 2233 2312 if [ ${status} -gt 0 ] ; then 2234 2235 2313 echo "IGCM_sys_ncks : ncks error" 2314 IGCM_debug_Exit "ncks" 2236 2315 fi 2237 2316 … … 2239 2318 } 2240 2319 2320 #D-#================================================== 2321 #D-function IGCM_sys_ncpdq 2322 #D-* Purpose: encapsulate ncpdq call so as to manage error code and retry 2323 #D-* Examples: 2324 #D- 2241 2325 function IGCM_sys_ncpdq { 2242 2326 IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@ … … 2269 2353 2270 2354 if [ ${status} -gt 0 ] ; then 2271 2272 2355 echo "IGCM_sys_ncpdq : ncpdq error" 2356 IGCM_debug_Exit "ncpdq" 2273 2357 fi 2274 2358 … … 2276 2360 } 2277 2361 2362 #D-#================================================== 2363 #D-function IGCM_sys_ncra 2364 #D-* Purpose: encapsulate ncra call so as to manage error code and retry 2365 #D-* Examples: 2366 #D- 2278 2367 function IGCM_sys_ncra { 2279 2368 IGCM_debug_PushStack "IGCM_sys_ncra" -- $@ … … 2306 2395 2307 2396 if [ ${status} -gt 0 ] ; then 2308 2309 2397 echo "IGCM_sys_ncra : ncra error" 2398 IGCM_debug_Exit "ncra" 2310 2399 fi 2311 2400 … … 2313 2402 } 2314 2403 2404 #D-#================================================== 2405 #D-function IGCM_sys_ncrcat 2406 #D-* Purpose: encapsulate ncrcat call so as to manage error code and retry 2407 #D-* Examples: 2408 #D- 2315 2409 function IGCM_sys_ncrcat { 2316 2410 IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@ … … 2353 2447 2354 2448 if [ ${status} -gt 0 ] ; then 2355 2356 2449 echo "IGCM_sys_ncrcat : ncrcat error" 2450 #IGCM_debug_Exit "ncrcat" 2357 2451 fi 2358 2452 … … 2360 2454 } 2361 2455 2456 #D-#================================================== 2457 #D-function IGCM_sys_ncrename 2458 #D-* Purpose: encapsulate ncrename call so as to manage error code and retry 2459 #D-* Examples: 2460 #D- 2362 2461 function IGCM_sys_ncrename { 2363 2462 IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@ … … 2390 2489 2391 2490 if [ ${status} -gt 0 ] ; then 2392 2393 2491 echo "IGCM_sys_ncrename : ncrename error" 2492 IGCM_debug_Exit "ncrename" 2394 2493 fi 2395 2494 … … 2397 2496 } 2398 2497 2498 #D-#================================================== 2499 #D-function IGCM_sys_ncwa 2500 #D-* Purpose: encapsulate ncwa call so as to manage error code and retry 2501 #D-* Examples: 2502 #D- 2399 2503 function IGCM_sys_ncwa { 2400 2504 IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@ … … 2427 2531 2428 2532 if [ ${status} -gt 0 ] ; then 2429 2430 2533 echo "IGCM_sys_ncwa : ncwa error" 2534 IGCM_debug_Exit "ncwa" 2431 2535 fi 2432 2536 … … 2437 2541 # CDO OPERATOR 2438 2542 2543 #D-#================================================== 2544 #D-function IGCM_sys_cdo 2545 #D-* Purpose: encapsulate cdo call so as to manage error code and retry 2546 #D-* Examples: 2547 #D- 2439 2548 function IGCM_sys_cdo { 2440 2549 IGCM_debug_PushStack "IGCM_sys_cdo" -- $@ -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
r809 r811 248 248 ${@} 249 249 EOF 250 if [ $? -gt 0 ] ; then 251 echo "IGCM_sys_RshArchive : erreur." 250 status=$? 251 if [ ${status} -gt 0 ] ; then 252 IGCM_debug_Print 2 "IGCM_sys_RshArchive : command failed error code ${status}" 252 253 IGCM_debug_Exit "IGCM_sys_RshArchive" 253 254 fi … … 265 266 echo "IGCM_sys_RshPost :" $@ 266 267 fi 267 268 #echo cat tmp_IGCM_sys_RshPost_$$ INITIAL269 #cat tmp_IGCM_sys_RshPost_$$270 268 # keep standard input (stdin) for the loop onto temporary file 271 cat >tmp_IGCM_sys_RshPost_$$ 272 273 # ============ FRONTEND START ============ # 274 275 /bin/ksh <tmp_IGCM_sys_RshPost_$$ 269 cat >/tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 270 271 /bin/ksh </tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 276 272 if [ $? -gt 0 ] ; then 277 273 echo "IGCM_sys_RshPost : erreur." … … 279 275 fi 280 276 # delete temporary file 281 \rm tmp_IGCM_sys_RshPost_$$277 \rm /tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 282 278 283 279 # ============ FRONTEND END ============ # … … 372 368 mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 373 369 fi 370 374 371 sleep 10 375 372 rm -f job_end.mail 376 373 377 374 if [ $? -gt 0 ] ; then 378 375 echo "IGCM_sys_SendMail : erreur." … … 420 417 if [ ! -d ${1} ]; then 421 418 \mkdir -p $1 422 if [ $? -gt 0 ] ; then 423 echo "IGCM_sys_MkdirArchive : erreur." 419 status=$? 420 421 if [ ${status} -gt 0 ] ; then 422 IGCM_debug_Print 2 "IGCM_sys_MkdirArchive : mkdir failed error code ${status}" 424 423 IGCM_debug_Exit "IGCM_sys_MkdirArchive" 425 424 fi … … 533 532 ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 ) 534 533 IGCM_debug_PopStack "IGCM_sys_TestDirArchive" 535 536 534 return ${ExistFlag} 537 535 } … … 672 670 echo "IGCM_sys_Qsub :" $@ 673 671 fi 674 typeset options 672 typeset options status 675 673 if [ ${config_UserChoices_JobName}.${CumulPeriod} = "." ] ; then 676 674 options=" -o ${Script_Output} -e ${Script_Output}" … … 680 678 681 679 /usr/bin/ccc_msub ${options} < $1 682 if [ $? -gt 0 ] ; then 683 echo "IGCM_sys_Qsub : erreur ${options} $1" 680 status=$? 681 if [ ${status} -gt 0 ] ; then 682 IGCM_debug_Print 2 "IGCM_sys_Qsub ${options} $1 : error code ${status}" 684 683 IGCM_debug_Exit "IGCM_sys_Qsub" 685 684 fi … … 697 696 echo "IGCM_sys_QsubPost :" $@ 698 697 fi 698 typeset status 699 699 MY_PROJECT=$(echo ${BRIDGE_MSUB_PROJECT} | cut -d@ -f1 ) 700 700 /usr/bin/ccc_msub -Q normal -A ${MY_PROJECT} -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.out ${libIGCM_POST}/$1.job 701 if [ $? -gt 0 ] ; then 702 echo "IGCM_sys_QsubPost : erreur " $@ 701 status=$? 702 if [ ${status} -gt 0 ] ; then 703 IGCM_debug_Print 2 "IGCM_sys_QsubPost $1 : error code ${status}" 703 704 IGCM_debug_Exit "IGCM_sys_QsubPost" 704 705 fi … … 823 824 #D-#================================================== 824 825 #D-function IGCM_sys_Miror_libIGCM 825 #D-* Purpose: Mirror libIGCM PATH and lib to cesium826 #D-* Purpose: Mirror libIGCM PATH and lib to frontend 826 827 #D-* Examples: 827 828 #D- … … 841 842 842 843 if [ ${status} -gt 0 ] ; then 843 echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on cesium."844 echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on frontend." 844 845 cat out_rsync 845 846 fi … … 920 921 921 922 if [ ${status} -gt 0 ] ; then 922 echo "IGCM_sys_RmRunDir : error code ${status}"923 echo "IGCM_sys_RmRunDir : rm error code is ${status}." 923 924 cat out_rsync 924 925 IGCM_debug_Exit "IGCM_sys_RmRunDir" … … 989 990 990 991 if [ ${status} -gt 0 ] ; then 991 echo "IGCM_sys_Put_Dir :error code ${status}"992 IGCM_debug_Print 2 "IGCM_sys_Put_Dir : cp failed error code ${status}" 992 993 cat out_rsync 993 994 IGCM_debug_Exit "IGCM_sys_Put_Dir" … … 1035 1036 \cp -ur $1 $2 >> out_rsync 2>&1 1036 1037 status=$? 1037 if [ ${status} -gt 0 ] ; then1038 if [ ${status} -gt 0 ] ; then 1038 1039 IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status} ${i}/${NB_ESSAI}" 1039 1040 IGCM_debug_Print 2 "IGCM_sys_Get_Dir : sleep ${DELAI} seconds and try again." … … 1389 1390 if [ "X$( diff $1 $2 )" = X ] ; then 1390 1391 IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy" 1392 status=0 1391 1393 skip=true 1392 1394 else … … 1835 1837 # REBUILD OPERATOR 1836 1838 1839 #D-#================================================== 1840 #D-function IGCM_sys_rebuild 1841 #D-* Purpose: rebuild parallel files 1842 #D-* Examples: 1843 #D- 1837 1844 function IGCM_sys_rebuild { 1838 1845 IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@ … … 1874 1881 } 1875 1882 1883 #D-#================================================== 1884 #D-function IGCM_sys_rebuild_station 1885 #D-* Purpose: rebuild parallel files describing station 1886 #D-* Examples: 1887 #D- 1876 1888 function IGCM_sys_rebuild_station { 1877 1889 IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@ … … 1968 1980 # Activate Running Environnment Variables 1969 1981 1982 #D-#================================================== 1983 #D-function IGCM_sys_desactiv_variables 1984 #D-* Purpose: set environement variables prior to execution 1985 #D-* Examples: 1986 #D- 1970 1987 function IGCM_sys_activ_variables { 1971 1988 IGCM_debug_PushStack "IGCM_sys_activ_variables" … … 1974 1991 fi 1975 1992 1993 # -------------------------------------------------------------------- 1994 #D- MPI specifications 1995 # -------------------------------------------------------------------- 1996 1997 # -------------------------------------------------------------------- 1998 #D- Other specifications 1999 # -------------------------------------------------------------------- 2000 1976 2001 ulimit -s unlimited 1977 2002 … … 1982 2007 # Desactivate Running Environnment Variables 1983 2008 2009 #D-#================================================== 2010 #D-function IGCM_sys_desactiv_variables 2011 #D-* Purpose: unset environement variables after execution 2012 #D-* Examples: 2013 #D- 1984 2014 function IGCM_sys_desactiv_variables { 1985 2015 IGCM_debug_PushStack "IGCM_sys_desactiv_variables" … … 1987 2017 echo "IGCM_sys_desactiv_variables" 1988 2018 fi 2019 # -------------------------------------------------------------------- 2020 #D- MPI specifications 2021 # -------------------------------------------------------------------- 2022 2023 # -------------------------------------------------------------------- 2024 #D- Other specifications 2025 # -------------------------------------------------------------------- 2026 1989 2027 IGCM_debug_PopStack "IGCM_sys_desactiv_variables" 1990 2028 } … … 1993 2031 # Build MPI/OMP scripts run file (dummy function) 1994 2032 2033 #D-#================================================== 2034 #D-function IGCM_sys_build_run_file 2035 #D-* Purpose: build run file (deprecated) 2036 #D-* Examples: 2037 #D- 1995 2038 function IGCM_sys_build_run_file { 1996 2039 1997 IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file "2040 IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file " 1998 2041 1999 2042 } … … 2001 2044 ############################################################ 2002 2045 # Build MPI/OMP scripts 2046 2047 #D-#================================================== 2048 #D-function IGCM_sys_build_execution_scripts 2049 #D-* Purpose: build execution scripts to be launch by ${HOST_MPIRUN_COMMAND} 2050 #D-* Examples: 2051 #D- 2003 2052 function IGCM_sys_build_execution_scripts 2004 2053 { … … 2008 2057 fi 2009 2058 2010 # Verification with MSUB parameter2011 2059 EXECUTION=${HOST_MPIRUN_COMMAND} 2012 2060 … … 2022 2070 # Then first loop on the components for the coupler ie oasis 2023 2071 2024 ## #the coupler ie oasis must be the first one2072 ## the coupler ie oasis must be the first one 2025 2073 for comp in ${config_ListOfComponents[*]} ; do 2026 2074 … … 2063 2111 else # Only one executable. launch it. 2064 2112 2065 #2066 2113 for comp in ${config_ListOfComponents[*]} ; do 2067 2114 … … 2114 2161 2115 2162 ############################################################ 2116 # Check of space available on temporary filesytems 2163 # Check of space available on temporary filesytems. 2164 2165 #D-#================================================== 2166 #D-function IGCM_sys_check_quota 2167 #D-* Purpose: check user quota. Stop the simulation if quota above 90% 2168 #D-* Examples: 2169 #D- 2117 2170 function IGCM_sys_check_quota { 2118 2171 IGCM_debug_PushStack "IGCM_sys_check_quota" … … 2133 2186 2134 2187 if [ "${unit_quota}" = "*" ] ; then 2135 2136 2137 2138 2139 2140 2188 IGCM_debug_Print 1 "Please, check your quota of volume on scratch" 2189 IGCM_debug_Print 1 "More than 100% of your quota is used" 2190 IGCM_debug_Print 1 "Use the ccc_quota command to check" 2191 IGCM_debug_Print 1 "You must have more than 10% available to run" 2192 IGCM_debug_Exit "Not enough space to run ! STOP HERE" 2193 IGCM_debug_Verif_Exit 2141 2194 fi 2142 2195 … … 2196 2249 2197 2250 if [ "${unit_quota}" = "*" ] ; then 2198 2199 2200 2201 2202 2203 2251 IGCM_debug_Print 1 "Please, check your quota of inode on scratch" 2252 IGCM_debug_Print 1 "More than 100% of your quota is used" 2253 IGCM_debug_Print 1 "Use the ccc_quota command to check" 2254 IGCM_debug_Print 1 "You must have more than 10% available to run" 2255 IGCM_debug_Exit "Not enough space to run ! STOP HERE" 2256 IGCM_debug_Verif_Exit 2204 2257 fi 2205 2258 … … 2255 2308 #D-* Examples: IGCM_sys_CountJobInQueue ${JobName} NbRun 2256 2309 #D- 2257 2258 2310 function IGCM_sys_CountJobInQueue { 2259 2311 IGCM_debug_PushStack "IGCM_sys_CountJobInQueue" … … 2275 2327 # NCO OPERATOR 2276 2328 2329 #D-#================================================== 2330 #D-function IGCM_sys_ncap2 2331 #D-* Purpose: encapsulate ncap2 call so as to manage error code and retry 2332 #D-* Examples: 2333 #D- 2277 2334 function IGCM_sys_ncap2 { 2278 2335 IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ … … 2305 2362 2306 2363 if [ ${status} -gt 0 ] ; then 2307 2308 2364 echo "IGCM_sys_ncap2 : ncap2 error" 2365 IGCM_debug_Exit "ncap2" 2309 2366 fi 2310 2367 … … 2312 2369 } 2313 2370 2371 #D-#================================================== 2372 #D-function IGCM_sys_ncatted 2373 #D-* Purpose: encapsulate ncatted call so as to manage error code and retry 2374 #D-* Examples: 2375 #D- 2314 2376 function IGCM_sys_ncatted { 2315 2377 IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@ … … 2342 2404 2343 2405 if [ ${status} -gt 0 ] ; then 2344 2345 2406 echo "IGCM_sys_ncatted : ncatted error" 2407 IGCM_debug_Exit "ncatted" 2346 2408 fi 2347 2409 … … 2349 2411 } 2350 2412 2413 #D-#================================================== 2414 #D-function IGCM_sys_ncbo 2415 #D-* Purpose: encapsulate ncbo call so as to manage error code and retry 2416 #D-* Examples: 2417 #D- 2351 2418 function IGCM_sys_ncbo { 2352 2419 IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@ … … 2379 2446 2380 2447 if [ ${status} -gt 0 ] ; then 2381 2382 2448 echo "IGCM_sys_ncbo : ncbo error" 2449 IGCM_debug_Exit "ncbo" 2383 2450 fi 2384 2451 … … 2386 2453 } 2387 2454 2455 #D-#================================================== 2456 #D-function IGCM_sys_ncdif 2457 #D-* Purpose: encapsulate ncdiff call so as to manage error code and retry 2458 #D-* Examples: 2459 #D- 2388 2460 function IGCM_sys_ncdiff { 2389 2461 IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@ … … 2416 2488 2417 2489 if [ ${status} -gt 0 ] ; then 2418 2419 2490 echo "IGCM_sys_ncdiff : ncdiff error" 2491 IGCM_debug_Exit "ncdiff" 2420 2492 fi 2421 2493 … … 2423 2495 } 2424 2496 2497 #D-#================================================== 2498 #D-function IGCM_sys_ncea 2499 #D-* Purpose: encapsulate ncea call so as to manage error code and retry 2500 #D-* Examples: 2501 #D- 2425 2502 function IGCM_sys_ncea { 2426 2503 IGCM_debug_PushStack "IGCM_sys_ncea" -- $@ … … 2453 2530 2454 2531 if [ ${status} -gt 0 ] ; then 2455 2456 2532 echo "IGCM_sys_ncea : ncea error" 2533 IGCM_debug_Exit "ncea" 2457 2534 fi 2458 2535 … … 2460 2537 } 2461 2538 2539 #D-#================================================== 2540 #D-function IGCM_sys_ncecat 2541 #D-* Purpose: encapsulate ncecat call so as to manage error code and retry 2542 #D-* Examples: 2543 #D- 2462 2544 function IGCM_sys_ncecat { 2463 2545 IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@ … … 2490 2572 2491 2573 if [ ${status} -gt 0 ] ; then 2492 2493 2574 echo "IGCM_sys_ncecat : ncecat error" 2575 IGCM_debug_Exit "ncecat" 2494 2576 fi 2495 2577 … … 2497 2579 } 2498 2580 2581 #D-#================================================== 2582 #D-function IGCM_sys_ncflint 2583 #D-* Purpose: encapsulate ncflint call so as to manage error code and retry 2584 #D-* Examples: 2585 #D- 2499 2586 function IGCM_sys_ncflint { 2500 2587 IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@ … … 2527 2614 2528 2615 if [ ${status} -gt 0 ] ; then 2529 2530 2616 echo "IGCM_sys_ncflint : ncflint error" 2617 IGCM_debug_Exit "ncflint" 2531 2618 fi 2532 2619 … … 2534 2621 } 2535 2622 2623 #D-#================================================== 2624 #D-function IGCM_sys_ncks 2625 #D-* Purpose: encapsulate ncks call so as to manage error code and retry 2626 #D-* Examples: 2627 #D- 2536 2628 function IGCM_sys_ncks { 2537 2629 IGCM_debug_PushStack "IGCM_sys_ncks" -- $@ … … 2564 2656 2565 2657 if [ ${status} -gt 0 ] ; then 2566 2567 2658 echo "IGCM_sys_ncks : ncks error" 2659 IGCM_debug_Exit "ncks" 2568 2660 fi 2569 2661 … … 2571 2663 } 2572 2664 2665 #D-#================================================== 2666 #D-function IGCM_sys_ncpdq 2667 #D-* Purpose: encapsulate ncpdq call so as to manage error code and retry 2668 #D-* Examples: 2669 #D- 2573 2670 function IGCM_sys_ncpdq { 2574 2671 IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@ … … 2601 2698 2602 2699 if [ ${status} -gt 0 ] ; then 2603 2604 2700 echo "IGCM_sys_ncpdq : ncpdq error" 2701 IGCM_debug_Exit "ncpdq" 2605 2702 fi 2606 2703 … … 2608 2705 } 2609 2706 2707 #D-#================================================== 2708 #D-function IGCM_sys_ncra 2709 #D-* Purpose: encapsulate ncra call so as to manage error code and retry 2710 #D-* Examples: 2711 #D- 2610 2712 function IGCM_sys_ncra { 2611 2713 IGCM_debug_PushStack "IGCM_sys_ncra" -- $@ … … 2638 2740 2639 2741 if [ ${status} -gt 0 ] ; then 2640 2641 2742 echo "IGCM_sys_ncra : ncra error" 2743 IGCM_debug_Exit "ncra" 2642 2744 fi 2643 2745 … … 2645 2747 } 2646 2748 2749 #D-#================================================== 2750 #D-function IGCM_sys_ncrcat 2751 #D-* Purpose: encapsulate ncrcat call so as to manage error code and retry 2752 #D-* Examples: 2753 #D- 2647 2754 function IGCM_sys_ncrcat { 2648 2755 IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@ … … 2685 2792 2686 2793 if [ ${status} -gt 0 ] ; then 2687 2688 2794 echo "IGCM_sys_ncrcat : ncrcat error" 2795 #IGCM_debug_Exit "ncrcat" 2689 2796 fi 2690 2797 … … 2692 2799 } 2693 2800 2801 #D-#================================================== 2802 #D-function IGCM_sys_ncrename 2803 #D-* Purpose: encapsulate ncrename call so as to manage error code and retry 2804 #D-* Examples: 2805 #D- 2694 2806 function IGCM_sys_ncrename { 2695 2807 IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@ … … 2722 2834 2723 2835 if [ ${status} -gt 0 ] ; then 2724 2725 2836 echo "IGCM_sys_ncrename : ncrename error" 2837 IGCM_debug_Exit "ncrename" 2726 2838 fi 2727 2839 … … 2729 2841 } 2730 2842 2843 #D-#================================================== 2844 #D-function IGCM_sys_ncwa 2845 #D-* Purpose: encapsulate ncwa call so as to manage error code and retry 2846 #D-* Examples: 2847 #D- 2731 2848 function IGCM_sys_ncwa { 2732 2849 IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@ … … 2759 2876 2760 2877 if [ ${status} -gt 0 ] ; then 2761 2762 2878 echo "IGCM_sys_ncwa : ncwa error" 2879 IGCM_debug_Exit "ncwa" 2763 2880 fi 2764 2881 … … 2769 2886 # CDO OPERATOR 2770 2887 2888 #D-#================================================== 2889 #D-function IGCM_sys_cdo 2890 #D-* Purpose: encapsulate cdo call so as to manage error code and retry 2891 #D-* Examples: 2892 #D- 2771 2893 function IGCM_sys_cdo { 2772 2894 IGCM_debug_PushStack "IGCM_sys_cdo" -- $@ -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh
r809 r811 115 115 116 116 #==================================================== 117 #- ARCHIVE (dedicated to large files)118 typeset -r ARCHIVE=/home/${LOGIN}117 #- ARCHIVE 118 typeset ARCHIVE=${ARCHIVE:=/home/${LOGIN}} 119 119 120 120 #==================================================== 121 121 #- STORAGE (dedicated to small/medium files) 122 typeset -rSTORAGE=${ARCHIVE}122 typeset STORAGE=${ARCHIVE} 123 123 124 124 #==================================================== … … 165 165 #D- 166 166 function IGCM_sys_ChangeArchive { 167 168 167 IGCM_debug_Print 1 " dummy function : IGCM_sys_ChangeArchive " 169 170 168 } 171 169 … … 201 199 ${@} 202 200 EOF 203 if [ $? -gt 0 ] ; then 204 echo "IGCM_sys_RshArchive : erreur." 201 status=$? 202 if [ ${status} -gt 0 ] ; then 203 IGCM_debug_Print 2 "IGCM_sys_RshArchive : command failed error code ${status}" 205 204 IGCM_debug_Exit "IGCM_sys_RshArchive" 206 205 fi … … 219 218 fi 220 219 221 #echo cat tmp_IGCM_sys_RshPost_$$ INITIAL222 #cat tmp_IGCM_sys_RshPost_$$223 220 # keep standard input (stdin) for the loop onto temporary file 224 221 cat >tmp_IGCM_sys_RshPost_$$ … … 231 228 # delete temporary file 232 229 \rm tmp_IGCM_sys_RshPost_$$ 233 234 230 IGCM_debug_PopStack "IGCM_sys_RshPost" 235 231 } … … 270 266 fi 271 267 268 sleep 10 269 rm -f job_end.mail 270 272 271 if [ $? -gt 0 ] ; then 273 272 echo "IGCM_sys_SendMail : erreur." … … 313 312 fi 314 313 #- creation de repertoire sur le serveur fichier 315 if [ ! -d ${1} ]; then316 \mkdir -p $1317 if [ $? -gt 0 ] ; then 318 echo "IGCM_sys_MkdirArchive : erreur."319 IGCM_debug_Exit "IGCM_sys_MkdirArchive"320 fi314 mkdir -p $1 315 status=$? 316 317 if [ ${status} -gt 0 ] ; then 318 IGCM_debug_Print 2 "IGCM_sys_MkdirArchive : mkdir failed error code ${status}" 319 IGCM_debug_Exit "IGCM_sys_MkdirArchive" 321 320 fi 322 321 IGCM_debug_PopStack "IGCM_sys_MkdirArchive" … … 428 427 ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 ) 429 428 IGCM_debug_PopStack "IGCM_sys_TestDirArchive" 430 431 429 return ${ExistFlag} 432 430 } … … 712 710 713 711 #D-#================================================== 712 #D-function IGCM_sys_Miror_libIGCM 713 #D-* Purpose: Mirror libIGCM PATH and lib to frontend 714 #D-* Examples: 715 #D- 716 function IGCM_sys_Mirror_libIGCM { 717 IGCM_debug_PushStack "IGCM_sys_Mirror_libIGCM" 718 if ( $DEBUG_sys ) ; then 719 echo "IGCM_sys_Mirror_libIGCM" 720 fi 721 722 typeset status 723 724 mkdir -p ${HOME}/MIRROR/${PATHlibIGCM} 725 726 echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1 727 ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1 728 status=$? 729 730 if [ ${status} -gt 0 ] ; then 731 echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on frontend." 732 cat out_rsync 733 fi 734 IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM" 735 } 736 737 #D-#================================================== 714 738 #D-function IGCM_sys_Cp 715 739 #D-* Purpose: generic cp … … 841 865 842 866 if [ ${status} -gt 0 ] ; then 843 echo "IGCM_sys_Put_Dir :error code ${status}"867 IGCM_debug_Print 2 "IGCM_sys_Put_Dir : cp failed error code ${status}" 844 868 cat out_rsync 845 869 IGCM_debug_Exit "IGCM_sys_Put_Dir" … … 870 894 fi 871 895 872 typeset RET896 typeset status 873 897 874 898 #USUAL WAY 875 \cp - R$1 $2 > out_rsync 2>&1876 RET=$?877 878 if [ ${ RET} -gt 0 ] ; then879 echo "IGCM_sys_Get_Dir : error."899 \cp -ur $1 $2 > out_rsync 2>&1 900 status=$? 901 902 if [ ${status} -gt 0 ] ; then 903 IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status}" 880 904 cat out_rsync 881 905 IGCM_debug_Exit "IGCM_sys_Get_Dir" … … 906 930 fi 907 931 908 typeset RET 909 910 #USUAL WAY 911 cp -RL $1 $2 > out_rsync 2>&1 912 RET=$? 913 914 if [ ${RET} -gt 0 ] ; then 932 typeset NB_ESSAI DELAI status i 933 # number of tentative 934 NB_ESSAI=3 935 # time delay between tentative 936 DELAI=2 937 938 i=0 939 while [ $i -lt $NB_ESSAI ] ; do 940 \cp -urL $1 $2 > out_rsync 2>&1 941 status=$? 942 if [ ${status} -gt 0 ]; then 943 IGCM_debug_Print 2 "IGCM_sys_Get_Master : cp failed error code ${status} ${i}/${NB_ESSAI}" 944 IGCM_debug_Print 2 "IGCM_sys_Get_Master : sleep ${DELAI} seconds and try again." 945 sleep $DELAI 946 else 947 break 948 fi 949 (( i = i + 1 )) 950 done 951 952 if [ ${status} -gt 0 ] ; then 915 953 echo "IGCM_sys_Get_Master : error." 916 954 cat out_rsync … … 924 962 IGCM_debug_PopStack "IGCM_sys_Get_Master" 925 963 } 964 965 #==================================================== 966 #- Call IGCM_sys_Mirror_libIGCM now ! 967 if ( $MirrorlibIGCM ) ; then 968 IGCM_sys_Mirror_libIGCM 969 fi 926 970 927 971 #D-#================================================== … … 947 991 IGCM_sys_Chmod 444 ${1} 948 992 fi 993 # 994 # Only if we use rsync 995 #IGCM_sys_MkdirArchive $( dirname $2 ) 996 # 997 #USUAL WAY 998 \cp $1 $2 > out_rsync 2>&1 999 status=$? 1000 1001 # #RSYNC WITH NETWORK SSH CALL 1002 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1 1003 # ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1 1004 1005 # #RSYNC WITH NFS USE 1006 # echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 1007 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1008 1009 # status=$? 1010 # IGCM_sys_Rsync_out $status 1011 1012 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1013 # (( status=status+$? )) 1014 1015 if [ ${status} -gt 0 ] ; then 1016 echo "IGCM_sys_Put_Rest : cp failed error code ${status}" 1017 cat out_rsync 1018 IGCM_debug_Exit "IGCM_sys_Put_Rest" 1019 else 1020 \rm out_rsync 1021 fi 1022 else 1023 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1024 fi 1025 IGCM_debug_PopStack "IGCM_sys_Put_Rest" 1026 } 1027 1028 #D-#================================================== 1029 #D-function IGCM_sys_PutBuffer_Rest 1030 #D-* Purpose: Put computied restarts on ${SCRATCHDIR}. 1031 #D- File and target directory must exist. 1032 #D-* Examples: 1033 #D- 1034 function IGCM_sys_PutBuffer_Rest { 1035 IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@ 1036 if ( $DEBUG_sys ) ; then 1037 echo "IGCM_sys_PutBuffer_Rest :" $@ 1038 fi 1039 if [ $DRYRUN = 0 ]; then 1040 if [ ! -f ${1} ] ; then 1041 echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ." 1042 IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 1043 fi 1044 1045 typeset status 1046 # 1047 if [ X${JobType} = XRUN ] ; then 1048 IGCM_sys_Chmod 444 ${1} 1049 fi 949 1050 950 1051 # … … 953 1054 status=$? 954 1055 955 # #RSYNC WITH NETWORK SSH CALL956 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1957 # ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1958 959 # #RSYNC WITH NFS USE960 # echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1961 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1962 963 # status=$?964 # IGCM_sys_Rsync_out $status965 966 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync967 # (( status=status+$? ))968 969 if [ ${status} -gt 0 ] ; then970 echo "IGCM_sys_Put_Rest : cp failed error code ${status}"971 cat out_rsync972 IGCM_debug_Exit "IGCM_sys_Put_Rest"973 else974 \rm out_rsync975 fi976 else977 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack978 fi979 IGCM_debug_PopStack "IGCM_sys_Put_Rest"980 }981 982 #D-#==================================================983 #D-function IGCM_sys_PutBuffer_Rest984 #D-* Purpose: Put computied restarts on ${SCRATCHDIR}.985 #D- File and target directory must exist.986 #D-* Examples:987 #D-988 function IGCM_sys_PutBuffer_Rest {989 IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@990 if ( $DEBUG_sys ) ; then991 echo "IGCM_sys_PutBuffer_Rest :" $@992 fi993 if [ $DRYRUN = 0 ]; then994 if [ ! -f ${1} ] ; then995 echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ."996 IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"997 fi998 999 typeset status1000 #1001 if [ X${JobType} = XRUN ] ; then1002 IGCM_sys_Chmod 444 ${1}1003 fi1004 1005 #1006 # USUAL WAY1007 \cp $1 $2 > out_rsync 2>&11008 status=$?1009 1010 1056 if [ ${status} -gt 0 ] ; then 1011 1057 echo "IGCM_sys_PutBuffer_Rest : error code ${status}" 1058 [ -f ${2} ] && ls -l ${2} 1059 [ -f ${2}/${1} ] && ls -l ${2}/${1} 1012 1060 cat out_rsync 1013 1061 IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" … … 1042 1090 echo "IGCM_sys_Put_Out :" $@ 1043 1091 fi 1092 1093 typeset status 1094 1044 1095 if [ $DRYRUN = 0 ]; then 1045 if [ -f ${1} ] ; then 1046 if [ ! -d $( dirname $2 ) ] ; then 1047 IGCM_sys_MkdirArchive $( dirname $2 ) 1048 fi 1049 else 1096 if [ ! -f ${1} ] ; then 1050 1097 echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ." 1051 1098 IGCM_debug_PopStack "IGCM_sys_Put_Out" 1052 1099 return 1 1053 1100 fi 1054 1055 typeset RET1101 # 1102 IGCM_sys_MkdirArchive $( dirname $2 ) 1056 1103 # 1057 1104 if [ X${JobType} = XRUN ] ; then … … 1064 1111 echo ${RSYNC} ${RSYNC_opt} $1 $2 > out_rsync 2>&1 1065 1112 ${RSYNC} ${RSYNC_opt} $1 $2 >> out_rsync 2>&1 1066 RET=$?1067 IGCM_sys_Rsync_out $ RET1113 status=$? 1114 IGCM_sys_Rsync_out $status 1068 1115 1069 1116 ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1070 (( RET=RET+$? ))1071 1072 if [ ${ RET} -gt 0 ] ; then1073 echo "IGCM_sys_Put_Out : error."1117 (( status=status+$? )) 1118 1119 if [ ${status} -gt 0 ] ; then 1120 IGCM_debug_Print 2 "IGCM_sys_Put_Out : rsync failed error code ${status}" 1074 1121 cat out_rsync 1075 1122 IGCM_debug_Exit "IGCM_sys_Put_Out" … … 1094 1141 echo "IGCM_sys_PutBuffer_Out :" $@ 1095 1142 fi 1143 1144 typeset NB_ESSAI DELAI status i exist skip 1145 1146 # number of tentative 1147 NB_ESSAI=3 1148 # time delay between tentative 1149 DELAI=2 1150 1096 1151 if [ $DRYRUN = 0 ]; then 1097 1152 if [ ! -f ${1} ] ; then … … 1103 1158 IGCM_sys_Mkdir $( dirname $2 ) 1104 1159 # 1105 typeset RET 1106 1107 if [ X${JobType} = XRUN ] ; then 1108 if [ X${3} = X ] ; then 1109 IGCM_sys_Chmod 444 ${1} 1160 1161 exist=false 1162 skip=false 1163 if [ -f $2 ] ; then 1164 IGCM_debug_Print 1 "$2 already exist" 1165 exist=true 1166 if [ "X$( diff $1 $2 )" = X ] ; then 1167 IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy" 1168 status=0 1169 skip=true 1170 else 1171 IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy" 1172 skip=false 1110 1173 fi 1111 1174 fi 1112 1175 # 1113 # USUAL WAY 1114 \cp $1 $2 > out_rsync 2>&1 1115 RET=$? 1116 1117 if [ ${RET} -gt 0 ] ; then 1176 if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then 1177 IGCM_sys_Chmod u+w $2 1178 fi 1179 1180 if [ X${skip} = Xfalse ] ; then 1181 i=0 1182 while [ $i -lt $NB_ESSAI ] ; do 1183 # USUAL WAY 1184 \cp $1 $2 > out_rsync 2>&1 1185 status=$? 1186 if [ ${status} -gt 0 ]; then 1187 IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}" 1188 IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : sleep ${DELAI} seconds and try again." 1189 [ -f ${2} ] && ls -l ${2} 1190 [ -f ${2}/${1} ] && ls -l ${2}/${1} 1191 sleep $DELAI 1192 else 1193 break 1194 fi 1195 (( i = i + 1 )) 1196 done 1197 fi 1198 1199 if [ ${status} -gt 0 ] ; then 1118 1200 echo "IGCM_sys_PutBuffer_Out : error." 1201 [ -f ${2} ] && ls -l ${2} 1202 [ -f ${2}/${1} ] && ls -l ${2}/${1} 1119 1203 cat out_rsync 1120 1204 IGCM_debug_Exit "IGCM_sys_PutBuffer_Out" 1121 1205 else 1206 1207 if [ X${JobType} = XRUN ] ; then 1208 if [ X${3} = X ] ; then 1209 [ -f ${2} ] && IGCM_sys_Chmod 444 ${2} 1210 [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1} 1211 fi 1212 fi 1213 1122 1214 \rm out_rsync 1123 1215 fi … … 1137 1229 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1138 1230 1139 typeset DEST RET dm_liste ifile target1231 typeset DEST status dm_liste 1140 1232 1141 1233 if ( $DEBUG_sys ) ; then … … 1153 1245 # test if the (first) file is present in the old computation : 1154 1246 IGCM_sys_TestFileArchive ${dm_liste[0]} 1155 RET=$?1156 if [ ${ RET} -gt 0 ] ; then1247 status=$? 1248 if [ ${status} -gt 0 ] ; then 1157 1249 echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 1158 1250 IGCM_debug_Exit "IGCM_sys_Get" 1159 #return 1160 fi 1161 1162 (( RET=0 )) 1163 for target in ${dm_liste[*]} ; do 1164 \cp ${target} ${DEST} >> out_rsync 2>&1 1165 (( RET=RET+$? )) 1166 done 1167 1168 # echo ${RSYNC} ${RSYNC_opt} $@ > out_rsync 2>&1 1169 # ${RSYNC} ${RSYNC_opt} $@ >> out_rsync 2>&1 1170 # RET=$? 1171 # IGCM_sys_Rsync_out $RET 1172 1173 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1174 # (( RET=RET+$? )) 1175 1176 if [ ${RET} -gt 0 ] ; then 1177 echo "IGCM_sys_Get : error" 1251 return 1252 fi 1253 1254 #USUAL WAY 1255 \cp ${dm_liste[*]} ${DEST} > out_rsync 2>&1 1256 status=$? 1257 1258 if [ ${status} -gt 0 ] ; then 1259 IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status}" 1178 1260 cat out_rsync 1179 \rm out_rsync1180 1261 IGCM_debug_Exit "IGCM_sys_Get" 1181 1262 else … … 1196 1277 IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 1197 1278 1198 typeset DEST RET status buf_liste ifile target file_work 1279 typeset DEST buf_liste target file_work 1280 typeset NB_ESSAI DELAI status i 1199 1281 1200 1282 if ( $DEBUG_sys ) ; then 1201 1283 echo "IGCM_sys_GetBuffer :" $@ 1202 1284 fi 1285 1286 # number of tentative 1287 NB_ESSAI=3 1288 # time delay between tentative 1289 DELAI=2 1290 1203 1291 if [ $DRYRUN -le 2 ]; then 1204 1292 if [ X${1} = X'/l' ] ; then … … 1212 1300 #USUAL WAY 1213 1301 if [ X${1} = X'/l' ] ; then 1214 (( RET=0 ))1215 1302 for target in ${buf_liste[*]} ; do 1216 1303 local_file=$( basename ${target} ) 1217 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1218 (( RET = RET + $? )) 1304 i=0 1305 while [ $i -lt $NB_ESSAI ] ; do 1306 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1307 status=$? 1308 if [ ${status} -gt 0 ]; then 1309 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 1310 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 1311 sleep $DELAI 1312 else 1313 break 1314 fi 1315 (( i = i + 1 )) 1316 done 1317 if [ ${status} -gt 0 ] ; then 1318 echo "IGCM_sys_Get : error" 1319 cat out_rsync 1320 \rm out_rsync 1321 IGCM_debug_Exit "IGCM_sys_GetBuffer" 1322 else 1323 \rm out_rsync 1324 fi 1219 1325 done 1220 1326 else 1221 \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 1222 status=$? 1223 fi 1224 1225 if [ ${RET} -gt 0 ] ; then 1226 echo "IGCM_sys_GetBuffer : error" 1227 cat out_rsync 1228 \rm out_rsync 1229 IGCM_debug_Exit "IGCM_sys_GetBuffer" 1230 else 1231 \rm out_rsync 1327 i=0 1328 while [ $i -lt $NB_ESSAI ] ; do 1329 \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 1330 status=$? 1331 if [ ${status} -gt 0 ]; then 1332 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 1333 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 1334 sleep $DELAI 1335 else 1336 break 1337 fi 1338 (( i = i + 1 )) 1339 done 1340 if [ ${status} -gt 0 ] ; then 1341 echo "IGCM_sys_Get : error" 1342 cat out_rsync 1343 \rm out_rsync 1344 IGCM_debug_Exit "IGCM_sys_GetBuffer" 1345 else 1346 \rm out_rsync 1347 fi 1232 1348 fi 1233 1349 else … … 1286 1402 #D-#================================================== 1287 1403 #D-function IGCM_sys_Dods_Cp 1288 #D-* Purpose: Copy from $(ARCHIVE) files to /tmp/DODS for simulation ofinternet protocole.1404 #D-* Purpose: Copy $(ARCHIVE) files on DODS internet protocole. 1289 1405 #D-* Examples: 1290 1406 #D- … … 1298 1414 #D-#================================================== 1299 1415 #D-function IGCM_sys_Put_Dods 1300 #D-* Purpose: Put $ (ARCHIVE) files on /tmp/DODS for simulation of internet protocole.1416 #D-* Purpose: Put ${ARCHIVE} files on DODS internet protocole. Dummy function here 1301 1417 #D-* Examples: 1302 1418 #D- … … 1306 1422 echo "IGCM_sys_Put_Dods :" $@ 1307 1423 fi 1308 if [ $DRYRUN = 0 ]; then1309 RET=01310 1311 if [ ${RET} -gt 0 ] ; then1312 echo "IGCM_sys_Put_Dods : error."1313 IGCM_debug_Exit "IGCM_sys_Put_Dods"1314 fi1315 else1316 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack1317 fi1318 1424 IGCM_debug_PopStack "IGCM_sys_Put_Dods" 1319 1425 } … … 1322 1428 # REBUILD OPERATOR 1323 1429 1430 #D-#================================================== 1431 #D-function IGCM_sys_rebuild 1432 #D-* Purpose: rebuild parallel files 1433 #D-* Examples: 1434 #D- 1324 1435 function IGCM_sys_rebuild { 1325 1436 IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@ … … 1327 1438 echo "IGCM_sys_rebuild :" $@ 1328 1439 fi 1329 rebuild -f -o $@ 1330 if [ $? -gt 0 ] ; then 1331 echo "IGCM_sys_rebuild : rebuild error" 1440 1441 typeset NB_ESSAI DELAI status i firstArg 1442 # number of tentative 1443 NB_ESSAI=3 1444 # time delay between tentative 1445 DELAI=2 1446 1447 i=0 1448 while [ $i -lt $NB_ESSAI ] ; do 1449 rebuild -f -o $@ > out_rsync 2>&1 1450 status=$? 1451 if [ ${status} -gt 0 ] ; then 1452 IGCM_debug_Print 2 "IGCM_sys_rebuild : error code ${status}" 1453 cat out_rsync 1454 \rm out_rsync 1455 IGCM_debug_Print 2 "IGCM_sys_rebuild : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 1456 firstArg=${1} 1457 \rm ${firstArg} 1458 sleep $DELAI 1459 else 1460 \rm out_rsync 1461 break 1462 fi 1463 (( i = i + 1 )) 1464 done 1465 1466 if [ ${status} -gt 0 ] ; then 1467 echo "IGCM_sys_rebuild : rebuild error code is ${status}" 1332 1468 IGCM_debug_Exit "rebuild" 1333 1469 fi … … 1336 1472 } 1337 1473 1474 #D-#================================================== 1475 #D-function IGCM_sys_rebuild_station 1476 #D-* Purpose: rebuild parallel files describing station 1477 #D-* Examples: 1478 #D- 1338 1479 function IGCM_sys_rebuild_station { 1339 1480 IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@ … … 1430 1571 # Activate Running Environnment Variables 1431 1572 1573 #D-#================================================== 1574 #D-function IGCM_sys_desactiv_variables 1575 #D-* Purpose: set environement variables prior to execution 1576 #D-* Examples: 1577 #D- 1432 1578 function IGCM_sys_activ_variables { 1433 1579 IGCM_debug_PushStack "IGCM_sys_activ_variables" … … 1435 1581 echo "IGCM_sys_activ_variables" 1436 1582 fi 1583 1584 # -------------------------------------------------------------------- 1585 #D- MPI specifications 1586 # -------------------------------------------------------------------- 1587 1588 # -------------------------------------------------------------------- 1589 #D- Other specifications 1590 # -------------------------------------------------------------------- 1591 1437 1592 IGCM_debug_PopStack "IGCM_sys_activ_variables" 1438 1593 } … … 1441 1596 # Desactivate Running Environnment Variables 1442 1597 1598 #D-#================================================== 1599 #D-function IGCM_sys_desactiv_variables 1600 #D-* Purpose: unset environement variables after execution 1601 #D-* Examples: 1602 #D- 1443 1603 function IGCM_sys_desactiv_variables { 1444 1604 IGCM_debug_PushStack "IGCM_sys_desactiv_variables" … … 1446 1606 echo "IGCM_sys_desactiv_variables" 1447 1607 fi 1608 # -------------------------------------------------------------------- 1609 #D- MPI specifications 1610 # -------------------------------------------------------------------- 1611 1612 # -------------------------------------------------------------------- 1613 #D- Other specifications 1614 # -------------------------------------------------------------------- 1615 1448 1616 IGCM_debug_PopStack "IGCM_sys_desactiv_variables" 1449 1617 } … … 1452 1620 # Build MPI/OMP scripts run file (dummy function) 1453 1621 1622 #D-#================================================== 1623 #D-function IGCM_sys_build_run_file 1624 #D-* Purpose: build run file (deprecated) 1625 #D-* Examples: 1626 #D- 1454 1627 function IGCM_sys_build_run_file { 1455 1628 … … 1460 1633 ############################################################ 1461 1634 # Build MPI/OMP scripts 1635 1636 #D-#================================================== 1637 #D-function IGCM_sys_build_execution_scripts 1638 #D-* Purpose: build execution scripts to be launch by ${HOST_MPIRUN_COMMAND} 1639 #D-* Examples: 1640 #D- 1462 1641 function IGCM_sys_build_execution_scripts 1463 1642 { … … 1471 1650 1472 1651 if [ ! -f ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ] ; then 1473 IGCM_debug_Exit "IGCM_sys_ titane build_execution_scripts : Job_${config_UserChoices_JobName} doesn't exist in SUBMIT_DIR : ${SUBMIT_DIR} "1652 IGCM_debug_Exit "IGCM_sys_default build_execution_scripts : Job_${config_UserChoices_JobName} don't exist in SUBMIT_DIR : ${SUBMIT_DIR} " 1474 1653 fi 1475 1654 … … 1712 1891 fi 1713 1892 1714 IGCM_debug_Print 1 "sys $( hostname ) : La commande d execution est"1715 IGCM_debug_Print 1 $EXECUTION1893 IGCM_debug_Print 1 "sys $( hostname ) : execution command is" 1894 IGCM_debug_Print 1 "$EXECUTION" 1716 1895 1717 1896 IGCM_debug_PopStack "IGCM_sys_build_execution_scripts" … … 1719 1898 1720 1899 ############################################################ 1721 # Check of space available on temporary filesytems 1900 # Check of space available on temporary filesytems. Dummy function here 1901 1902 #D-#================================================== 1903 #D-function IGCM_sys_check_quota. Dummy call here 1904 #D-* Purpose: check user quota. Stop the simulation if quota above 90% 1905 #D-* Examples: 1906 #D- 1722 1907 function IGCM_sys_check_quota { 1723 1908 IGCM_debug_PushStack "IGCM_sys_check_quota" … … 1728 1913 } 1729 1914 1915 #D-#================================================== 1916 #D-function IGCM_sys_CountJobInQueue 1917 #D-* Purpose: Check if job_name is currently 1918 #D- running or in queue 1919 #D-* Examples: IGCM_sys_CountJobInQueue ${JobName} NbRun 1920 #D- 1921 function IGCM_sys_CountJobInQueue { 1922 IGCM_debug_PushStack "IGCM_sys_CountJobInQueue" 1923 if ( $DEBUG_sys ) ; then 1924 echo "IGCM_sys_CountJobInQueue" 1925 fi 1926 IGCM_debug_PopStack "IGCM_sys_CountJobInQueue" 1927 } 1928 1730 1929 ############################################################## 1731 1930 # NCO OPERATOR 1732 1931 1932 #D-#================================================== 1933 #D-function IGCM_sys_ncap2 1934 #D-* Purpose: encapsulate ncap2 call so as to manage error code and retry 1935 #D-* Examples: 1936 #D- 1733 1937 function IGCM_sys_ncap2 { 1734 1938 IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ … … 1761 1965 1762 1966 if [ ${status} -gt 0 ] ; then 1763 1764 1967 echo "IGCM_sys_ncap2 : ncap2 error" 1968 IGCM_debug_Exit "ncap2" 1765 1969 fi 1766 1970 … … 1768 1972 } 1769 1973 1974 #D-#================================================== 1975 #D-function IGCM_sys_ncatted 1976 #D-* Purpose: encapsulate ncatted call so as to manage error code and retry 1977 #D-* Examples: 1978 #D- 1770 1979 function IGCM_sys_ncatted { 1771 1980 IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@ … … 1798 2007 1799 2008 if [ ${status} -gt 0 ] ; then 1800 1801 2009 echo "IGCM_sys_ncatted : ncatted error" 2010 IGCM_debug_Exit "ncatted" 1802 2011 fi 1803 2012 … … 1805 2014 } 1806 2015 2016 #D-#================================================== 2017 #D-function IGCM_sys_ncbo 2018 #D-* Purpose: encapsulate ncbo call so as to manage error code and retry 2019 #D-* Examples: 2020 #D- 1807 2021 function IGCM_sys_ncbo { 1808 2022 IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@ … … 1835 2049 1836 2050 if [ ${status} -gt 0 ] ; then 1837 1838 2051 echo "IGCM_sys_ncbo : ncbo error" 2052 IGCM_debug_Exit "ncbo" 1839 2053 fi 1840 2054 … … 1842 2056 } 1843 2057 2058 #D-#================================================== 2059 #D-function IGCM_sys_ncdif 2060 #D-* Purpose: encapsulate ncdiff call so as to manage error code and retry 2061 #D-* Examples: 2062 #D- 1844 2063 function IGCM_sys_ncdiff { 1845 2064 IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@ … … 1872 2091 1873 2092 if [ ${status} -gt 0 ] ; then 1874 1875 2093 echo "IGCM_sys_ncdiff : ncdiff error" 2094 IGCM_debug_Exit "ncdiff" 1876 2095 fi 1877 2096 … … 1879 2098 } 1880 2099 2100 #D-#================================================== 2101 #D-function IGCM_sys_ncea 2102 #D-* Purpose: encapsulate ncea call so as to manage error code and retry 2103 #D-* Examples: 2104 #D- 1881 2105 function IGCM_sys_ncea { 1882 2106 IGCM_debug_PushStack "IGCM_sys_ncea" -- $@ … … 1909 2133 1910 2134 if [ ${status} -gt 0 ] ; then 1911 1912 2135 echo "IGCM_sys_ncea : ncea error" 2136 IGCM_debug_Exit "ncea" 1913 2137 fi 1914 2138 … … 1916 2140 } 1917 2141 2142 #D-#================================================== 2143 #D-function IGCM_sys_ncecat 2144 #D-* Purpose: encapsulate ncecat call so as to manage error code and retry 2145 #D-* Examples: 2146 #D- 1918 2147 function IGCM_sys_ncecat { 1919 2148 IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@ … … 1946 2175 1947 2176 if [ ${status} -gt 0 ] ; then 1948 1949 2177 echo "IGCM_sys_ncecat : ncecat error" 2178 IGCM_debug_Exit "ncecat" 1950 2179 fi 1951 2180 … … 1953 2182 } 1954 2183 2184 #D-#================================================== 2185 #D-function IGCM_sys_ncflint 2186 #D-* Purpose: encapsulate ncflint call so as to manage error code and retry 2187 #D-* Examples: 2188 #D- 1955 2189 function IGCM_sys_ncflint { 1956 2190 IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@ … … 1983 2217 1984 2218 if [ ${status} -gt 0 ] ; then 1985 1986 2219 echo "IGCM_sys_ncflint : ncflint error" 2220 IGCM_debug_Exit "ncflint" 1987 2221 fi 1988 2222 … … 1990 2224 } 1991 2225 2226 #D-#================================================== 2227 #D-function IGCM_sys_ncks 2228 #D-* Purpose: encapsulate ncks call so as to manage error code and retry 2229 #D-* Examples: 2230 #D- 1992 2231 function IGCM_sys_ncks { 1993 2232 IGCM_debug_PushStack "IGCM_sys_ncks" -- $@ … … 2020 2259 2021 2260 if [ ${status} -gt 0 ] ; then 2022 2023 2261 echo "IGCM_sys_ncks : ncks error" 2262 IGCM_debug_Exit "ncks" 2024 2263 fi 2025 2264 … … 2027 2266 } 2028 2267 2268 #D-#================================================== 2269 #D-function IGCM_sys_ncpdq 2270 #D-* Purpose: encapsulate ncpdq call so as to manage error code and retry 2271 #D-* Examples: 2272 #D- 2029 2273 function IGCM_sys_ncpdq { 2030 2274 IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@ … … 2057 2301 2058 2302 if [ ${status} -gt 0 ] ; then 2059 2060 2303 echo "IGCM_sys_ncpdq : ncpdq error" 2304 IGCM_debug_Exit "ncpdq" 2061 2305 fi 2062 2306 … … 2064 2308 } 2065 2309 2310 #D-#================================================== 2311 #D-function IGCM_sys_ncra 2312 #D-* Purpose: encapsulate ncra call so as to manage error code and retry 2313 #D-* Examples: 2314 #D- 2066 2315 function IGCM_sys_ncra { 2067 2316 IGCM_debug_PushStack "IGCM_sys_ncra" -- $@ … … 2094 2343 2095 2344 if [ ${status} -gt 0 ] ; then 2096 2097 2345 echo "IGCM_sys_ncra : ncra error" 2346 IGCM_debug_Exit "ncra" 2098 2347 fi 2099 2348 … … 2101 2350 } 2102 2351 2352 #D-#================================================== 2353 #D-function IGCM_sys_ncrcat 2354 #D-* Purpose: encapsulate ncrcat call so as to manage error code and retry 2355 #D-* Examples: 2356 #D- 2103 2357 function IGCM_sys_ncrcat { 2104 2358 IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@ … … 2107 2361 fi 2108 2362 2109 typeset NB_ESSAI DELAI status i 2363 typeset NB_ESSAI DELAI status i lastArg 2110 2364 # number of tentative 2111 2365 NB_ESSAI=3 … … 2123 2377 IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 2124 2378 sleep $DELAI 2379 elif [ ! "X$( grep "WARNING Intra-file non-monotonicity" out_rsync )" = "X" ] ; then 2380 IGCM_debug_Print 2 "IGCM_sys_ncrcat : WARNING Intra-file non-monotonicity" 2381 cat out_rsync 2382 # remove files having corrupted time axis 2383 eval lastArg=\${$#} 2384 IGCM_debug_Print 2 "IGCM_sys_ncrcat : Delete ${lastArg}" 2385 \rm ${lastArg} 2386 \rm out_rsync 2387 IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 2388 sleep $DELAI 2125 2389 else 2126 2390 \rm out_rsync … … 2131 2395 2132 2396 if [ ${status} -gt 0 ] ; then 2133 2134 2397 echo "IGCM_sys_ncrcat : ncrcat error" 2398 #IGCM_debug_Exit "ncrcat" 2135 2399 fi 2136 2400 … … 2138 2402 } 2139 2403 2404 #D-#================================================== 2405 #D-function IGCM_sys_ncrename 2406 #D-* Purpose: encapsulate ncrename call so as to manage error code and retry 2407 #D-* Examples: 2408 #D- 2140 2409 function IGCM_sys_ncrename { 2141 2410 IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@ … … 2168 2437 2169 2438 if [ ${status} -gt 0 ] ; then 2170 2171 2439 echo "IGCM_sys_ncrename : ncrename error" 2440 IGCM_debug_Exit "ncrename" 2172 2441 fi 2173 2442 … … 2175 2444 } 2176 2445 2446 #D-#================================================== 2447 #D-function IGCM_sys_ncwa 2448 #D-* Purpose: encapsulate ncwa call so as to manage error code and retry 2449 #D-* Examples: 2450 #D- 2177 2451 function IGCM_sys_ncwa { 2178 2452 IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@ … … 2205 2479 2206 2480 if [ ${status} -gt 0 ] ; then 2207 2208 2481 echo "IGCM_sys_ncwa : ncwa error" 2482 IGCM_debug_Exit "ncwa" 2209 2483 fi 2210 2484 … … 2215 2489 # CDO OPERATOR 2216 2490 2491 #D-#================================================== 2492 #D-function IGCM_sys_cdo 2493 #D-* Purpose: encapsulate cdo call so as to manage error code and retry 2494 #D-* Examples: 2495 #D- 2217 2496 function IGCM_sys_cdo { 2218 2497 IGCM_debug_PushStack "IGCM_sys_cdo" -- $@ -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh
r810 r811 210 210 function IGCM_sys_RshArchive { 211 211 IGCM_debug_PushStack "IGCM_sys_RshArchive" $@ 212 DEBUG_sys=false IGCM_sys_IsFileArchived "$@" 213 if [ $? = 0 ] ; then 214 /bin/ksh <<-EOF 212 /bin/ksh <<-EOF 215 213 ${@} 216 214 EOF 217 status=$? 218 else 219 /bin/ksh <<-EOF 220 ${@} 221 EOF 222 status=$? 223 fi 215 status=$? 224 216 if [ ${status} -gt 0 ] ; then 225 217 IGCM_debug_Print 2 "IGCM_sys_RshArchive : command failed error code ${status}" … … 547 539 fi 548 540 549 \ ls -r$@541 \tree -f $@ 550 542 551 543 IGCM_debug_PopStack "IGCM_sys_Tree" … … 596 588 IGCM_debug_PushStack "IGCM_sys_Qsub" $@ 597 589 598 typeset ERROR 599 ERROR=0 590 typeset status 600 591 601 592 if ( $DEBUG_sys ) ; then … … 606 597 [ ${#@} = 2 ] && REP_FOR_JOB=${2} 607 598 sed -e "s:\# \@ output *= .*:\# \@ output = ${Script_Output}:" \ 608 609 610 cd $REP_FOR_JOB ; /usr/lpp/LoadL/full/bin/llsubmit JOB_FOR_IGCM ; ERROR=$? ; cd - ;611 612 if [ ${ ERROR} -gt 0 ] ; then613 echo "IGCM_sys_Qsub : erreur $@"599 -e "s:\# \@ error *= .*:\# \@ error = ${Script_Output}:" \ 600 $1 > ${REP_FOR_JOB}/JOB_FOR_IGCM 601 cd $REP_FOR_JOB ; /usr/lpp/LoadL/full/bin/llsubmit JOB_FOR_IGCM ; status=$? ; cd - ; 602 603 if [ ${status} -gt 0 ] ; then 604 IGCM_debug_Print 2 "IGCM_sys_Qsub $1 : error code ${status}" 614 605 IGCM_debug_Exit "IGCM_sys_Qsub" 615 606 else … … 627 618 IGCM_debug_PushStack "IGCM_sys_QsubPost" $@ 628 619 629 typeset ERROR 630 ERROR=0 620 typeset status 631 621 632 622 if ( $DEBUG_sys ) ; then … … 638 628 639 629 sed -e "s:\# \@ output *= .*:\# \@ output = ${Script_Post_Output}.out:" \ 640 641 642 643 cd $REP_FOR_JOB ; /usr/lpp/LoadL/full/bin/llsubmit JOB_FOR_IGCM ; ERROR=$? ; cd - ;644 if [ ${ ERROR} -gt 0 ] ; then645 echo "IGCM_sys_QsubPost : erreur $@."630 -e "s:\# \@ error *= .*:\# \@ error = ${Script_Post_Output}.out:" \ 631 ${libIGCM_POST}/$1.job > ${REP_FOR_JOB}/JOB_FOR_IGCM 632 633 cd $REP_FOR_JOB ; /usr/lpp/LoadL/full/bin/llsubmit JOB_FOR_IGCM ; status=$? ; cd - ; 634 if [ ${status} -gt 0 ] ; then 635 IGCM_debug_Print 2 "IGCM_sys_QsubPost $1 : error code ${status}" 646 636 IGCM_debug_Exit "IGCM_sys_QsubPost" 647 637 else 648 638 IGCM_sys_Rm ${REP_FOR_JOB}/JOB_FOR_IGCM 649 639 fi 650 651 640 IGCM_debug_PopStack "IGCM_sys_QsubPost" 652 641 } … … 872 861 \rm out_rsync 873 862 fi 874 875 863 IGCM_debug_PopStack "IGCM_sys_RmRunDir" 876 864 } … … 967 955 typeset status 968 956 969 970 \cp - rp$1 $2 > out_rsync 2>&1957 #USUAL WAY 958 \cp -ur $1 $2 > out_rsync 2>&1 971 959 status=$? 972 960 … … 1158 1146 # 1159 1147 IGCM_sys_MkdirArchive $( dirname $2 ) 1160 #1161 typeset RET1162 1148 # 1163 1149 if [ X${JobType} = XRUN ] ; then … … 1312 1298 return 1313 1299 fi 1314 1315 # SD : dm_liste is not suited for computing job1316 # because we change filename during transfert1317 # dm_liste is better suited for post-treatment1318 #dm_liste=" "1319 #(( ifile=1 ))1320 #while [ $ifile -lt $# ] ; do1321 # dm_liste=$( eval echo ${dm_liste} " "\${${ifile}} )1322 # (( ifile = ifile + 1 ))1323 #done1324 #DEST=$( eval echo \${${#}} )1325 1300 1326 1301 #USUAL WAY … … 1453 1428 1454 1429 #D-#================================================== 1430 #D-function IGCM_sys_Dods_Rm 1431 #D-* Purpose: DO NOTHING ! Put ${ARCHIVE} files on DODS internet protocole. 1432 #D-* Examples: 1433 #D- 1434 function IGCM_sys_Dods_Rm { 1435 if ( $DEBUG_sys ) ; then 1436 echo "IGCM_sys_Dods_Rm :" $@ 1437 fi 1438 return 0 1439 } 1440 1441 #D-#================================================== 1442 #D-function IGCM_sys_Dods_Cp 1443 #D-* Purpose: Copy $(ARCHIVE) files on DODS internet protocole. 1444 #D-* Examples: 1445 #D- 1446 function IGCM_sys_Dods_Cp { 1447 if ( $DEBUG_sys ) ; then 1448 echo "IGCM_sys_Dods_Cp :" $@ 1449 fi 1450 return 0 1451 } 1452 1453 #D-#================================================== 1455 1454 #D-function IGCM_sys_Put_Dods 1456 1455 #D-* Purpose: Put ${ARCHIVE} files on DODS internet protocole. Dummy function here … … 1619 1618 IGCM_debug_PushStack "IGCM_sys_activ_variables" 1620 1619 if ( $DEBUG_sys ) ; then 1621 echo "IGCM_sys_activ_variables 1620 echo "IGCM_sys_activ_variables" 1622 1621 fi 1623 1622 … … 1644 1643 IGCM_debug_PushStack "IGCM_sys_desactiv_variables" 1645 1644 if ( $DEBUG_sys ) ; then 1646 echo "IGCM_sys_desactiv_variables 1645 echo "IGCM_sys_desactiv_variables" 1647 1646 fi 1648 1647 # -------------------------------------------------------------------- … … 1667 1666 function IGCM_sys_build_run_file { 1668 1667 1669 IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file "1668 IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file " 1670 1669 1671 1670 } … … 1831 1830 fi 1832 1831 1833 IGCM_debug_Print 1 "sys iitm : execution command is 1832 IGCM_debug_Print 1 "sys iitm : execution command is" 1834 1833 IGCM_debug_Print 1 "$EXECUTION" 1835 1834 … … 1911 1910 1912 1911 if [ ${status} -gt 0 ] ; then 1913 1914 1912 echo "IGCM_sys_ncap2 : ncap2 error" 1913 IGCM_debug_Exit "ncap2" 1915 1914 fi 1916 1915 … … 1953 1952 1954 1953 if [ ${status} -gt 0 ] ; then 1955 1956 1954 echo "IGCM_sys_ncatted : ncatted error" 1955 IGCM_debug_Exit "ncatted" 1957 1956 fi 1958 1957 … … 1995 1994 1996 1995 if [ ${status} -gt 0 ] ; then 1997 1998 1996 echo "IGCM_sys_ncbo : ncbo error" 1997 IGCM_debug_Exit "ncbo" 1999 1998 fi 2000 1999 … … 2037 2036 2038 2037 if [ ${status} -gt 0 ] ; then 2039 2040 2038 echo "IGCM_sys_ncdiff : ncdiff error" 2039 IGCM_debug_Exit "ncdiff" 2041 2040 fi 2042 2041 … … 2079 2078 2080 2079 if [ ${status} -gt 0 ] ; then 2081 2082 2080 echo "IGCM_sys_ncea : ncea error" 2081 IGCM_debug_Exit "ncea" 2083 2082 fi 2084 2083 … … 2121 2120 2122 2121 if [ ${status} -gt 0 ] ; then 2123 2124 2122 echo "IGCM_sys_ncecat : ncecat error" 2123 IGCM_debug_Exit "ncecat" 2125 2124 fi 2126 2125 … … 2163 2162 2164 2163 if [ ${status} -gt 0 ] ; then 2165 2166 2164 echo "IGCM_sys_ncflint : ncflint error" 2165 IGCM_debug_Exit "ncflint" 2167 2166 fi 2168 2167 … … 2205 2204 2206 2205 if [ ${status} -gt 0 ] ; then 2207 2208 2206 echo "IGCM_sys_ncks : ncks error" 2207 IGCM_debug_Exit "ncks" 2209 2208 fi 2210 2209 … … 2247 2246 2248 2247 if [ ${status} -gt 0 ] ; then 2249 2250 2248 echo "IGCM_sys_ncpdq : ncpdq error" 2249 IGCM_debug_Exit "ncpdq" 2251 2250 fi 2252 2251 … … 2289 2288 2290 2289 if [ ${status} -gt 0 ] ; then 2291 2292 2290 echo "IGCM_sys_ncra : ncra error" 2291 IGCM_debug_Exit "ncra" 2293 2292 fi 2294 2293 … … 2341 2340 2342 2341 if [ ${status} -gt 0 ] ; then 2343 2342 echo "IGCM_sys_ncrcat : ncrcat error" 2344 2343 #IGCM_debug_Exit "ncrcat" 2345 2344 fi … … 2383 2382 2384 2383 if [ ${status} -gt 0 ] ; then 2385 2386 2384 echo "IGCM_sys_ncrename : ncrename error" 2385 IGCM_debug_Exit "ncrename" 2387 2386 fi 2388 2387 … … 2425 2424 2426 2425 if [ ${status} -gt 0 ] ; then 2427 2428 2426 echo "IGCM_sys_ncwa : ncwa error" 2427 IGCM_debug_Exit "ncwa" 2429 2428 fi 2430 2429 -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
r809 r811 123 123 124 124 #==================================================== 125 #- ARCHIVE (dedicated to large files)125 #- ARCHIVE 126 126 typeset ARCHIVE=${ARCHIVE:=/home/scratch01/${LOGIN}} 127 127 … … 173 173 #D- 174 174 function IGCM_sys_ChangeArchive { 175 176 175 IGCM_debug_Print 1 " dummy function : IGCM_sys_ChangeArchive " 177 178 176 } 179 177 … … 209 207 ${@} 210 208 EOF 211 if [ $? -gt 0 ] ; then 212 echo "IGCM_sys_RshArchive : erreur." 209 status=$? 210 if [ ${status} -gt 0 ] ; then 211 IGCM_debug_Print 2 "IGCM_sys_RshArchive : command failed error code ${status}" 213 212 IGCM_debug_Exit "IGCM_sys_RshArchive" 214 213 fi … … 227 226 fi 228 227 229 #echo cat tmp_IGCM_sys_RshPost_$$ INITIAL230 #cat tmp_IGCM_sys_RshPost_$$231 228 # keep standard input (stdin) for the loop onto temporary file 232 229 cat >tmp_IGCM_sys_RshPost_$$ … … 234 231 # ============ FRONTEND START ============ # 235 232 236 233 ssh obelix3 exec /bin/ksh <tmp_IGCM_sys_RshPost_$$ 237 234 if [ $? -gt 0 ] ; then 238 235 echo "IGCM_sys_RshPost : erreur." … … 279 276 fi 280 277 278 sleep 10 279 rm -f job_end.mail 280 281 281 if [ $? -gt 0 ] ; then 282 282 echo "IGCM_sys_SendMail : erreur." … … 323 323 #- creation de repertoire sur le serveur fichier 324 324 if [ ! -d ${1} ]; then 325 \mkdir -p $1 326 if [ $? -gt 0 ] ; then 327 echo "IGCM_sys_MkdirArchive : erreur." 325 mkdir -p $1 326 status=$? 327 328 if [ ${status} -gt 0 ] ; then 329 IGCM_debug_Print 2 "IGCM_sys_MkdirArchive : mkdir failed error code ${status}" 328 330 IGCM_debug_Exit "IGCM_sys_MkdirArchive" 329 331 fi … … 437 439 ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 ) 438 440 IGCM_debug_PopStack "IGCM_sys_TestDirArchive" 439 440 441 return ${ExistFlag} 441 442 } … … 577 578 echo "IGCM_sys_Qsub :" $@ 578 579 fi 580 typeset status 579 581 /usr/local/bin/qsub -q medium -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} < $1 580 if [ $? -gt 0 ] ; then 581 echo "IGCM_sys_Qsub : erreur." 582 status=$? 583 if [ ${status} -gt 0 ] ; then 584 IGCM_debug_Print 2 "IGCM_sys_Qsub $1 : error code ${status}" 582 585 IGCM_debug_Exit "IGCM_sys_Qsub" 583 586 fi … … 595 598 echo "IGCM_sys_QsubPost :" $@ 596 599 fi 600 typeset status 597 601 /usr/local/bin/qsub -q medium -o ${POST_DIR}/${Script_Post_Output}.out ${libIGCM_POST}/$1.job -v ${listVarEnv} 598 if [ $? -gt 0 ] ; then 599 echo "IGCM_sys_QsubPost : erreur " $@ 602 status=$? 603 if [ ${status} -gt 0 ] ; then 604 IGCM_debug_Print 2 "IGCM_sys_QsubPost $1 : error code ${status}" 600 605 IGCM_debug_Exit "IGCM_sys_QsubPost" 601 606 fi … … 719 724 720 725 #D-#================================================== 726 #D-function IGCM_sys_Miror_libIGCM 727 #D-* Purpose: Mirror libIGCM PATH and lib to frontend 728 #D-* Examples: 729 #D- 730 function IGCM_sys_Mirror_libIGCM { 731 IGCM_debug_PushStack "IGCM_sys_Mirror_libIGCM" 732 if ( $DEBUG_sys ) ; then 733 echo "IGCM_sys_Mirror_libIGCM" 734 fi 735 736 typeset status 737 738 mkdir -p ${HOME}/MIRROR/${PATHlibIGCM} 739 740 echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1 741 ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1 742 status=$? 743 744 if [ ${status} -gt 0 ] ; then 745 echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on frontend." 746 cat out_rsync 747 fi 748 IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM" 749 } 750 751 #D-#================================================== 721 752 #D-function IGCM_sys_Cp 722 753 #D-* Purpose: generic cp … … 791 822 792 823 if [ ${status} -gt 0 ] ; then 793 echo "IGCM_sys_RmRunDir : error code ${status}"824 echo "IGCM_sys_RmRunDir : rm error code is ${status}." 794 825 cat out_rsync 795 826 IGCM_debug_Exit "IGCM_sys_RmRunDir" … … 860 891 861 892 if [ ${status} -gt 0 ] ; then 862 echo "IGCM_sys_Put_Dir :error code ${status}"893 IGCM_debug_Print 2 "IGCM_sys_Put_Dir : cp failed error code ${status}" 863 894 cat out_rsync 864 895 IGCM_debug_Exit "IGCM_sys_Put_Dir" … … 892 923 893 924 #USUAL WAY 894 \cp - R$1 $2 > out_rsync 2>&1925 \cp -ur $1 $2 > out_rsync 2>&1 895 926 status=$? 896 927 897 928 if [ ${status} -gt 0 ] ; then 898 echo "IGCM_sys_Get_Dir : error."929 IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status}" 899 930 cat out_rsync 900 931 IGCM_debug_Exit "IGCM_sys_Get_Dir" … … 925 956 fi 926 957 927 typeset status 928 929 #USUAL WAY 930 cp -RL $1 $2 > out_rsync 2>&1 931 status=$? 958 typeset NB_ESSAI DELAI status i 959 # number of tentative 960 NB_ESSAI=3 961 # time delay between tentative 962 DELAI=2 963 964 i=0 965 while [ $i -lt $NB_ESSAI ] ; do 966 \cp -urL $1 $2 > out_rsync 2>&1 967 status=$? 968 if [ ${status} -gt 0 ]; then 969 IGCM_debug_Print 2 "IGCM_sys_Get_Master : cp failed error code ${status} ${i}/${NB_ESSAI}" 970 IGCM_debug_Print 2 "IGCM_sys_Get_Master : sleep ${DELAI} seconds and try again." 971 sleep $DELAI 972 else 973 break 974 fi 975 (( i = i + 1 )) 976 done 932 977 933 978 if [ ${status} -gt 0 ] ; then … … 936 981 IGCM_debug_Exit "IGCM_sys_Get_Master" 937 982 else 938 rm out_rsync983 \rm out_rsync 939 984 fi 940 985 else … … 943 988 IGCM_debug_PopStack "IGCM_sys_Get_Master" 944 989 } 990 991 #==================================================== 992 #- Call IGCM_sys_Mirror_libIGCM now ! 993 if ( $MirrorlibIGCM ) ; then 994 IGCM_sys_Mirror_libIGCM 995 fi 945 996 946 997 #D-#================================================== … … 966 1017 IGCM_sys_Chmod 444 ${1} 967 1018 fi 1019 # 1020 # Only if we use rsync 1021 #IGCM_sys_MkdirArchive $( dirname $2 ) 1022 # 1023 #USUAL WAY 1024 \cp $1 $2 > out_rsync 2>&1 1025 status=$? 1026 1027 # #RSYNC WITH NETWORK SSH CALL 1028 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1 1029 # ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1 1030 1031 # #RSYNC WITH NFS USE 1032 # echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 1033 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1034 1035 # status=$? 1036 # IGCM_sys_Rsync_out $status 1037 1038 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1039 # (( status=status+$? )) 1040 1041 if [ ${status} -gt 0 ] ; then 1042 echo "IGCM_sys_Put_Rest : cp failed error code ${status}" 1043 cat out_rsync 1044 IGCM_debug_Exit "IGCM_sys_Put_Rest" 1045 else 1046 \rm out_rsync 1047 fi 1048 else 1049 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1050 fi 1051 IGCM_debug_PopStack "IGCM_sys_Put_Rest" 1052 } 1053 1054 #D-#================================================== 1055 #D-function IGCM_sys_PutBuffer_Rest 1056 #D-* Purpose: Put computied restarts on ${SCRATCHDIR}. 1057 #D- File and target directory must exist. 1058 #D-* Examples: 1059 #D- 1060 function IGCM_sys_PutBuffer_Rest { 1061 IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@ 1062 if ( $DEBUG_sys ) ; then 1063 echo "IGCM_sys_PutBuffer_Rest :" $@ 1064 fi 1065 if [ $DRYRUN = 0 ]; then 1066 if [ ! -f ${1} ] ; then 1067 echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ." 1068 IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 1069 fi 1070 1071 typeset status 1072 # 1073 if [ X${JobType} = XRUN ] ; then 1074 IGCM_sys_Chmod 444 ${1} 1075 fi 968 1076 969 1077 # … … 972 1080 status=$? 973 1081 974 # #RSYNC WITH NETWORK SSH CALL975 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1976 # ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1977 978 # #RSYNC WITH NFS USE979 # echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1980 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1981 982 # status=$?983 # IGCM_sys_Rsync_out $status984 985 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync986 # (( status=status+$? ))987 988 if [ ${status} -gt 0 ] ; then989 echo "IGCM_sys_Put_Rest : cp failed error code ${status}"990 cat out_rsync991 IGCM_debug_Exit "IGCM_sys_Put_Rest"992 else993 \rm out_rsync994 fi995 else996 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack997 fi998 IGCM_debug_PopStack "IGCM_sys_Put_Rest"999 }1000 1001 #D-#==================================================1002 #D-function IGCM_sys_PutBuffer_Rest1003 #D-* Purpose: Put computied restarts on ${SCRATCHDIR}.1004 #D- File and target directory must exist.1005 #D-* Examples:1006 #D-1007 function IGCM_sys_PutBuffer_Rest {1008 IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@1009 if ( $DEBUG_sys ) ; then1010 echo "IGCM_sys_PutBuffer_Rest :" $@1011 fi1012 if [ $DRYRUN = 0 ]; then1013 if [ ! -f ${1} ] ; then1014 echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ."1015 IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"1016 fi1017 1018 typeset status1019 #1020 if [ X${JobType} = XRUN ] ; then1021 IGCM_sys_Chmod 444 ${1}1022 fi1023 1024 #1025 # USUAL WAY1026 \cp $1 $2 > out_rsync 2>&11027 status=$?1028 1029 1082 if [ ${status} -gt 0 ] ; then 1030 1083 echo "IGCM_sys_PutBuffer_Rest : error code ${status}" 1084 [ -f ${2} ] && ls -l ${2} 1085 [ -f ${2}/${1} ] && ls -l ${2}/${1} 1031 1086 cat out_rsync 1032 1087 IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" … … 1061 1116 echo "IGCM_sys_Put_Out :" $@ 1062 1117 fi 1118 1119 typeset status 1120 1063 1121 if [ $DRYRUN = 0 ]; then 1064 if [ -f ${1} ] ; then 1065 if [ ! -d $( dirname $2 ) ] ; then 1066 IGCM_sys_MkdirArchive $( dirname $2 ) 1067 fi 1068 else 1122 if [ ! -f ${1} ] ; then 1069 1123 echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ." 1070 1124 IGCM_debug_PopStack "IGCM_sys_Put_Out" 1071 1125 return 1 1072 1126 fi 1073 1074 typeset status1127 # 1128 IGCM_sys_MkdirArchive $( dirname $2 ) 1075 1129 # 1076 1130 if [ X${JobType} = XRUN ] ; then … … 1090 1144 1091 1145 if [ ${status} -gt 0 ] ; then 1092 echo "IGCM_sys_Put_Out : error."1146 IGCM_debug_Print 2 "IGCM_sys_Put_Out : rsync failed error code ${status}" 1093 1147 cat out_rsync 1094 1148 IGCM_debug_Exit "IGCM_sys_Put_Out" … … 1114 1168 fi 1115 1169 1116 typeset status 1170 typeset NB_ESSAI DELAI status i exist skip 1171 1172 # number of tentative 1173 NB_ESSAI=3 1174 # time delay between tentative 1175 DELAI=2 1117 1176 1118 1177 if [ $DRYRUN = 0 ]; then … … 1126 1185 # 1127 1186 1128 if [ X${JobType} = XRUN ] ; then 1129 if [ X${3} = X ] ; then 1130 IGCM_sys_Chmod 444 ${1} 1187 exist=false 1188 skip=false 1189 if [ -f $2 ] ; then 1190 IGCM_debug_Print 1 "$2 already exist" 1191 exist=true 1192 if [ "X$( diff $1 $2 )" = X ] ; then 1193 IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy" 1194 status=0 1195 skip=true 1196 else 1197 IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy" 1198 skip=false 1131 1199 fi 1132 1200 fi 1133 1201 # 1134 # USUAL WAY 1135 \cp $1 $2 > out_rsync 2>&1 1136 status=$? 1202 if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then 1203 IGCM_sys_Chmod u+w $2 1204 fi 1205 1206 if [ X${skip} = Xfalse ] ; then 1207 i=0 1208 while [ $i -lt $NB_ESSAI ] ; do 1209 # USUAL WAY 1210 \cp $1 $2 > out_rsync 2>&1 1211 status=$? 1212 if [ ${status} -gt 0 ]; then 1213 IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}" 1214 IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : sleep ${DELAI} seconds and try again." 1215 [ -f ${2} ] && ls -l ${2} 1216 [ -f ${2}/${1} ] && ls -l ${2}/${1} 1217 sleep $DELAI 1218 else 1219 break 1220 fi 1221 (( i = i + 1 )) 1222 done 1223 fi 1137 1224 1138 1225 if [ ${status} -gt 0 ] ; then 1139 1226 echo "IGCM_sys_PutBuffer_Out : error." 1227 [ -f ${2} ] && ls -l ${2} 1228 [ -f ${2}/${1} ] && ls -l ${2}/${1} 1140 1229 cat out_rsync 1141 1230 IGCM_debug_Exit "IGCM_sys_PutBuffer_Out" 1142 1231 else 1232 1233 if [ X${JobType} = XRUN ] ; then 1234 if [ X${3} = X ] ; then 1235 [ -f ${2} ] && IGCM_sys_Chmod 444 ${2} 1236 [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1} 1237 fi 1238 fi 1239 1143 1240 \rm out_rsync 1144 1241 fi … … 1158 1255 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1159 1256 1160 typeset DEST RET status dm_liste ifile target1257 typeset DEST status dm_liste 1161 1258 1162 1259 if ( $DEBUG_sys ) ; then … … 1178 1275 echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 1179 1276 IGCM_debug_Exit "IGCM_sys_Get" 1180 #return 1181 fi 1182 1183 (( RET=0 )) 1184 for target in ${dm_liste[*]} ; do 1185 \cp ${target} ${DEST} >> out_rsync 2>&1 1186 (( RET=RET+$? )) 1187 done 1188 1189 # echo ${RSYNC} ${RSYNC_opt} $@ > out_rsync 2>&1 1190 # ${RSYNC} ${RSYNC_opt} $@ >> out_rsync 2>&1 1191 # status=$? 1192 # IGCM_sys_Rsync_out $status 1193 1194 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1195 # (( RET=RET+$? )) 1196 1197 if [ ${RET} -gt 0 ] ; then 1198 echo "IGCM_sys_Get : error" 1277 return 1278 fi 1279 1280 #USUAL WAY 1281 \cp ${dm_liste[*]} ${DEST} > out_rsync 2>&1 1282 status=$? 1283 1284 if [ ${status} -gt 0 ] ; then 1285 IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status}" 1199 1286 cat out_rsync 1200 \rm out_rsync1201 1287 IGCM_debug_Exit "IGCM_sys_Get" 1202 1288 else … … 1217 1303 IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 1218 1304 1219 typeset DEST RET status buf_liste ifile target file_work 1305 typeset DEST buf_liste target file_work 1306 typeset NB_ESSAI DELAI status i 1220 1307 1221 1308 if ( $DEBUG_sys ) ; then 1222 1309 echo "IGCM_sys_GetBuffer :" $@ 1223 1310 fi 1311 1312 # number of tentative 1313 NB_ESSAI=3 1314 # time delay between tentative 1315 DELAI=2 1316 1224 1317 if [ $DRYRUN -le 2 ]; then 1225 1318 if [ X${1} = X'/l' ] ; then … … 1233 1326 #USUAL WAY 1234 1327 if [ X${1} = X'/l' ] ; then 1235 (( RET=0 ))1236 1328 for target in ${buf_liste[*]} ; do 1237 1329 local_file=$( basename ${target} ) 1238 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1239 (( RET = RET + $? )) 1330 i=0 1331 while [ $i -lt $NB_ESSAI ] ; do 1332 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1333 status=$? 1334 if [ ${status} -gt 0 ]; then 1335 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 1336 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 1337 sleep $DELAI 1338 else 1339 break 1340 fi 1341 (( i = i + 1 )) 1342 done 1343 if [ ${status} -gt 0 ] ; then 1344 echo "IGCM_sys_Get : error" 1345 cat out_rsync 1346 \rm out_rsync 1347 IGCM_debug_Exit "IGCM_sys_GetBuffer" 1348 else 1349 \rm out_rsync 1350 fi 1240 1351 done 1241 1352 else 1242 \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 1243 status=$? 1244 fi 1245 1246 if [ ${RET} -gt 0 ] ; then 1247 echo "IGCM_sys_GetBuffer : error" 1248 cat out_rsync 1249 \rm out_rsync 1250 IGCM_debug_Exit "IGCM_sys_GetBuffer" 1251 else 1252 \rm out_rsync 1353 i=0 1354 while [ $i -lt $NB_ESSAI ] ; do 1355 \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 1356 status=$? 1357 if [ ${status} -gt 0 ]; then 1358 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 1359 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 1360 sleep $DELAI 1361 else 1362 break 1363 fi 1364 (( i = i + 1 )) 1365 done 1366 if [ ${status} -gt 0 ] ; then 1367 echo "IGCM_sys_Get : error" 1368 cat out_rsync 1369 \rm out_rsync 1370 IGCM_debug_Exit "IGCM_sys_GetBuffer" 1371 else 1372 \rm out_rsync 1373 fi 1253 1374 fi 1254 1375 else … … 1319 1440 #D-#================================================== 1320 1441 #D-function IGCM_sys_Put_Dods 1321 #D-* Purpose: Put $ (ARCHIVE) files on DODS internet protocole.1442 #D-* Purpose: Put ${ARCHIVE} files on DODS internet protocole. Dummy function here 1322 1443 #D-* Examples: 1323 1444 #D- … … 1333 1454 # REBUILD OPERATOR 1334 1455 1456 #D-#================================================== 1457 #D-function IGCM_sys_rebuild 1458 #D-* Purpose: rebuild parallel files 1459 #D-* Examples: 1460 #D- 1335 1461 function IGCM_sys_rebuild { 1336 1462 IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@ … … 1339 1465 fi 1340 1466 1341 typeset status 1342 1343 /home/users/igcmg/rebuild/bin/rebuild -f -o $@ 1344 status=$? 1467 typeset NB_ESSAI DELAI status i firstArg 1468 # number of tentative 1469 NB_ESSAI=3 1470 # time delay between tentative 1471 DELAI=2 1472 1473 i=0 1474 while [ $i -lt $NB_ESSAI ] ; do 1475 /home/users/igcmg/rebuild/bin/rebuild -f -o $@ > out_rsync 2>&1 1476 status=$? 1477 if [ ${status} -gt 0 ] ; then 1478 IGCM_debug_Print 2 "IGCM_sys_rebuild : error code ${status}" 1479 cat out_rsync 1480 \rm out_rsync 1481 IGCM_debug_Print 2 "IGCM_sys_rebuild : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 1482 firstArg=${1} 1483 \rm ${firstArg} 1484 sleep $DELAI 1485 else 1486 \rm out_rsync 1487 break 1488 fi 1489 (( i = i + 1 )) 1490 done 1491 1345 1492 if [ ${status} -gt 0 ] ; then 1346 IGCM_debug_Print 2 "IGCM_sys_rebuild : error code${status}"1493 echo "IGCM_sys_rebuild : rebuild error code is ${status}" 1347 1494 IGCM_debug_Exit "rebuild" 1348 1495 fi … … 1351 1498 } 1352 1499 1500 #D-#================================================== 1501 #D-function IGCM_sys_rebuild_station 1502 #D-* Purpose: rebuild parallel files describing station 1503 #D-* Examples: 1504 #D- 1353 1505 function IGCM_sys_rebuild_station { 1354 1506 IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@ … … 1445 1597 # Activate Running Environnment Variables 1446 1598 1599 #D-#================================================== 1600 #D-function IGCM_sys_desactiv_variables 1601 #D-* Purpose: set environement variables prior to execution 1602 #D-* Examples: 1603 #D- 1447 1604 function IGCM_sys_activ_variables { 1448 1605 IGCM_debug_PushStack "IGCM_sys_activ_variables" … … 1450 1607 echo "IGCM_sys_activ_variables" 1451 1608 fi 1609 1610 # -------------------------------------------------------------------- 1611 #D- MPI specifications 1612 # -------------------------------------------------------------------- 1613 1614 # -------------------------------------------------------------------- 1615 #D- Other specifications 1616 # -------------------------------------------------------------------- 1617 1452 1618 IGCM_debug_PopStack "IGCM_sys_activ_variables" 1453 1619 } … … 1456 1622 # Desactivate Running Environnment Variables 1457 1623 1624 #D-#================================================== 1625 #D-function IGCM_sys_desactiv_variables 1626 #D-* Purpose: unset environement variables after execution 1627 #D-* Examples: 1628 #D- 1458 1629 function IGCM_sys_desactiv_variables { 1459 1630 IGCM_debug_PushStack "IGCM_sys_desactiv_variables" … … 1461 1632 echo "IGCM_sys_desactiv_variables" 1462 1633 fi 1634 # -------------------------------------------------------------------- 1635 #D- MPI specifications 1636 # -------------------------------------------------------------------- 1637 1638 # -------------------------------------------------------------------- 1639 #D- Other specifications 1640 # -------------------------------------------------------------------- 1641 1463 1642 IGCM_debug_PopStack "IGCM_sys_desactiv_variables" 1464 1643 } … … 1467 1646 # Build MPI/OMP scripts run file (dummy function) 1468 1647 1648 #D-#================================================== 1649 #D-function IGCM_sys_build_run_file 1650 #D-* Purpose: build run file (deprecated) 1651 #D-* Examples: 1652 #D- 1469 1653 function IGCM_sys_build_run_file { 1470 1654 … … 1475 1659 ############################################################ 1476 1660 # Build MPI/OMP scripts 1661 1662 #D-#================================================== 1663 #D-function IGCM_sys_build_execution_scripts 1664 #D-* Purpose: build execution scripts to be launch by ${HOST_MPIRUN_COMMAND} 1665 #D-* Examples: 1666 #D- 1477 1667 function IGCM_sys_build_execution_scripts 1478 1668 { … … 1486 1676 1487 1677 if [ ! -f ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ] ; then 1488 IGCM_debug_Exit "IGCM_sys_ titane build_execution_scripts : Job_${config_UserChoices_JobName} doesn't exist in SUBMIT_DIR : ${SUBMIT_DIR} "1678 IGCM_debug_Exit "IGCM_sys_obelix build_execution_scripts : Job_${config_UserChoices_JobName} don't exist in SUBMIT_DIR : ${SUBMIT_DIR} " 1489 1679 fi 1490 1680 … … 1675 1865 done 1676 1866 1677 1867 # Then second loop on the components 1678 1868 1679 1869 for comp in ${config_ListOfComponents[*]} ; do … … 1727 1917 fi 1728 1918 1729 IGCM_debug_Print 1 "sys Obelix : La commande d execution est"1730 IGCM_debug_Print 1 $EXECUTION1919 IGCM_debug_Print 1 "sys Obelix : execution command is" 1920 IGCM_debug_Print 1 "$EXECUTION" 1731 1921 1732 1922 IGCM_debug_PopStack "IGCM_sys_build_execution_scripts" … … 1734 1924 1735 1925 ############################################################ 1736 # Check of space available on temporary filesytems 1926 # Check of space available on temporary filesytems. Dummy function here 1927 1928 #D-#================================================== 1929 #D-function IGCM_sys_check_quota. Dummy call here 1930 #D-* Purpose: check user quota. Stop the simulation if quota above 90% 1931 #D-* Examples: 1932 #D- 1737 1933 function IGCM_sys_check_quota { 1738 1934 IGCM_debug_PushStack "IGCM_sys_check_quota" … … 1743 1939 } 1744 1940 1941 #D-#================================================== 1942 #D-function IGCM_sys_CountJobInQueue 1943 #D-* Purpose: Check if job_name is currently 1944 #D- running or in queue 1945 #D-* Examples: IGCM_sys_CountJobInQueue ${JobName} NbRun 1946 #D- 1947 function IGCM_sys_CountJobInQueue { 1948 IGCM_debug_PushStack "IGCM_sys_CountJobInQueue" 1949 if ( $DEBUG_sys ) ; then 1950 echo "IGCM_sys_CountJobInQueue" 1951 fi 1952 IGCM_debug_PopStack "IGCM_sys_CountJobInQueue" 1953 } 1954 1745 1955 ############################################################## 1746 1956 # NCO OPERATOR 1747 1957 1958 #D-#================================================== 1959 #D-function IGCM_sys_ncap2 1960 #D-* Purpose: encapsulate ncap2 call so as to manage error code and retry 1961 #D-* Examples: 1962 #D- 1748 1963 function IGCM_sys_ncap2 { 1749 1964 IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ … … 1776 1991 1777 1992 if [ ${status} -gt 0 ] ; then 1778 1779 1993 echo "IGCM_sys_ncap2 : ncap2 error" 1994 IGCM_debug_Exit "ncap2" 1780 1995 fi 1781 1996 … … 1783 1998 } 1784 1999 2000 #D-#================================================== 2001 #D-function IGCM_sys_ncatted 2002 #D-* Purpose: encapsulate ncatted call so as to manage error code and retry 2003 #D-* Examples: 2004 #D- 1785 2005 function IGCM_sys_ncatted { 1786 2006 IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@ … … 1813 2033 1814 2034 if [ ${status} -gt 0 ] ; then 1815 1816 2035 echo "IGCM_sys_ncatted : ncatted error" 2036 IGCM_debug_Exit "ncatted" 1817 2037 fi 1818 2038 … … 1820 2040 } 1821 2041 2042 #D-#================================================== 2043 #D-function IGCM_sys_ncbo 2044 #D-* Purpose: encapsulate ncbo call so as to manage error code and retry 2045 #D-* Examples: 2046 #D- 1822 2047 function IGCM_sys_ncbo { 1823 2048 IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@ … … 1850 2075 1851 2076 if [ ${status} -gt 0 ] ; then 1852 1853 2077 echo "IGCM_sys_ncbo : ncbo error" 2078 IGCM_debug_Exit "ncbo" 1854 2079 fi 1855 2080 … … 1857 2082 } 1858 2083 2084 #D-#================================================== 2085 #D-function IGCM_sys_ncdif 2086 #D-* Purpose: encapsulate ncdiff call so as to manage error code and retry 2087 #D-* Examples: 2088 #D- 1859 2089 function IGCM_sys_ncdiff { 1860 2090 IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@ … … 1887 2117 1888 2118 if [ ${status} -gt 0 ] ; then 1889 1890 2119 echo "IGCM_sys_ncdiff : ncdiff error" 2120 IGCM_debug_Exit "ncdiff" 1891 2121 fi 1892 2122 … … 1894 2124 } 1895 2125 2126 #D-#================================================== 2127 #D-function IGCM_sys_ncea 2128 #D-* Purpose: encapsulate ncea call so as to manage error code and retry 2129 #D-* Examples: 2130 #D- 1896 2131 function IGCM_sys_ncea { 1897 2132 IGCM_debug_PushStack "IGCM_sys_ncea" -- $@ … … 1924 2159 1925 2160 if [ ${status} -gt 0 ] ; then 1926 1927 2161 echo "IGCM_sys_ncea : ncea error" 2162 IGCM_debug_Exit "ncea" 1928 2163 fi 1929 2164 … … 1931 2166 } 1932 2167 2168 #D-#================================================== 2169 #D-function IGCM_sys_ncecat 2170 #D-* Purpose: encapsulate ncecat call so as to manage error code and retry 2171 #D-* Examples: 2172 #D- 1933 2173 function IGCM_sys_ncecat { 1934 2174 IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@ … … 1961 2201 1962 2202 if [ ${status} -gt 0 ] ; then 1963 1964 2203 echo "IGCM_sys_ncecat : ncecat error" 2204 IGCM_debug_Exit "ncecat" 1965 2205 fi 1966 2206 … … 1968 2208 } 1969 2209 2210 #D-#================================================== 2211 #D-function IGCM_sys_ncflint 2212 #D-* Purpose: encapsulate ncflint call so as to manage error code and retry 2213 #D-* Examples: 2214 #D- 1970 2215 function IGCM_sys_ncflint { 1971 2216 IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@ … … 1998 2243 1999 2244 if [ ${status} -gt 0 ] ; then 2000 2001 2245 echo "IGCM_sys_ncflint : ncflint error" 2246 IGCM_debug_Exit "ncflint" 2002 2247 fi 2003 2248 … … 2005 2250 } 2006 2251 2252 #D-#================================================== 2253 #D-function IGCM_sys_ncks 2254 #D-* Purpose: encapsulate ncks call so as to manage error code and retry 2255 #D-* Examples: 2256 #D- 2007 2257 function IGCM_sys_ncks { 2008 2258 IGCM_debug_PushStack "IGCM_sys_ncks" -- $@ … … 2035 2285 2036 2286 if [ ${status} -gt 0 ] ; then 2037 2038 2287 echo "IGCM_sys_ncks : ncks error" 2288 IGCM_debug_Exit "ncks" 2039 2289 fi 2040 2290 … … 2042 2292 } 2043 2293 2294 #D-#================================================== 2295 #D-function IGCM_sys_ncpdq 2296 #D-* Purpose: encapsulate ncpdq call so as to manage error code and retry 2297 #D-* Examples: 2298 #D- 2044 2299 function IGCM_sys_ncpdq { 2045 2300 IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@ … … 2072 2327 2073 2328 if [ ${status} -gt 0 ] ; then 2074 2075 2329 echo "IGCM_sys_ncpdq : ncpdq error" 2330 IGCM_debug_Exit "ncpdq" 2076 2331 fi 2077 2332 … … 2079 2334 } 2080 2335 2336 #D-#================================================== 2337 #D-function IGCM_sys_ncra 2338 #D-* Purpose: encapsulate ncra call so as to manage error code and retry 2339 #D-* Examples: 2340 #D- 2081 2341 function IGCM_sys_ncra { 2082 2342 IGCM_debug_PushStack "IGCM_sys_ncra" -- $@ … … 2109 2369 2110 2370 if [ ${status} -gt 0 ] ; then 2111 2112 2371 echo "IGCM_sys_ncra : ncra error" 2372 IGCM_debug_Exit "ncra" 2113 2373 fi 2114 2374 … … 2116 2376 } 2117 2377 2378 #D-#================================================== 2379 #D-function IGCM_sys_ncrcat 2380 #D-* Purpose: encapsulate ncrcat call so as to manage error code and retry 2381 #D-* Examples: 2382 #D- 2118 2383 function IGCM_sys_ncrcat { 2119 2384 IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@ … … 2122 2387 fi 2123 2388 2124 typeset NB_ESSAI DELAI status i 2389 typeset NB_ESSAI DELAI status i lastArg 2125 2390 # number of tentative 2126 2391 NB_ESSAI=3 … … 2138 2403 IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 2139 2404 sleep $DELAI 2405 elif [ ! "X$( grep "WARNING Intra-file non-monotonicity" out_rsync )" = "X" ] ; then 2406 IGCM_debug_Print 2 "IGCM_sys_ncrcat : WARNING Intra-file non-monotonicity" 2407 cat out_rsync 2408 # remove files having corrupted time axis 2409 eval lastArg=\${$#} 2410 IGCM_debug_Print 2 "IGCM_sys_ncrcat : Delete ${lastArg}" 2411 \rm ${lastArg} 2412 \rm out_rsync 2413 IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 2414 sleep $DELAI 2140 2415 else 2141 2416 \rm out_rsync … … 2146 2421 2147 2422 if [ ${status} -gt 0 ] ; then 2148 2149 2423 echo "IGCM_sys_ncrcat : ncrcat error" 2424 #IGCM_debug_Exit "ncrcat" 2150 2425 fi 2151 2426 … … 2153 2428 } 2154 2429 2430 #D-#================================================== 2431 #D-function IGCM_sys_ncrename 2432 #D-* Purpose: encapsulate ncrename call so as to manage error code and retry 2433 #D-* Examples: 2434 #D- 2155 2435 function IGCM_sys_ncrename { 2156 2436 IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@ … … 2183 2463 2184 2464 if [ ${status} -gt 0 ] ; then 2185 2186 2465 echo "IGCM_sys_ncrename : ncrename error" 2466 IGCM_debug_Exit "ncrename" 2187 2467 fi 2188 2468 … … 2190 2470 } 2191 2471 2472 #D-#================================================== 2473 #D-function IGCM_sys_ncwa 2474 #D-* Purpose: encapsulate ncwa call so as to manage error code and retry 2475 #D-* Examples: 2476 #D- 2192 2477 function IGCM_sys_ncwa { 2193 2478 IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@ … … 2220 2505 2221 2506 if [ ${status} -gt 0 ] ; then 2222 2223 2507 echo "IGCM_sys_ncwa : ncwa error" 2508 IGCM_debug_Exit "ncwa" 2224 2509 fi 2225 2510 … … 2230 2515 # CDO OPERATOR 2231 2516 2517 #D-#================================================== 2518 #D-function IGCM_sys_cdo 2519 #D-* Purpose: encapsulate cdo call so as to manage error code and retry 2520 #D-* Examples: 2521 #D- 2232 2522 function IGCM_sys_cdo { 2233 2523 IGCM_debug_PushStack "IGCM_sys_cdo" -- $@
Note: See TracChangeset
for help on using the changeset viewer.