Changeset 811 for trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
- Timestamp:
- 03/05/13 15:39:16 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.