Changeset 4443 for palm/trunk/SCRIPTS/palmrun
- Timestamp:
- Mar 5, 2020 3:31:21 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmrun
r4425 r4443 27 27 # ----------------- 28 28 # $Id$ 29 # add cycle number to initial files too (000), 30 # remove compatibility for cycle numbers which are less than three digits wide 31 # 32 # 4425 2020-02-26 15:35:00Z raasch 29 33 # hard coded path to the fileconnection file replaced by a path that is based on 30 34 # the source path which has been given in the configuration file … … 1355 1359 while read line 1356 1360 do 1357 1358 1361 # filename without path (i.e. after the last "/") 1362 basefilename=$(basename ${line}) 1359 1363 1360 1361 1362 1363 1364 1365 1364 # check if there is an extension 1365 extension=${basefilename##*.} 1366 if [[ "$extension" = "${extin[$nr_of_input_files]}" ]] 1367 then 1368 basefilename=${basefilename%.*} 1369 fi 1366 1370 1367 # check for an existing cycle number 1368 cycle=${basefilename##*.} 1369 if [[ $cycle =~ ^-?[0-9]+$ ]] 1370 then 1371 # NUMBERS WITH LEADING ZEROS ARE INTERPRETED AS OCTAL NUMBERS 1372 # 10# EXPLICITLY SPECIFIES THE NUMBER BASE AS 10 1373 (( icycle = $((10#$cycle)) )) 1374 else 1375 (( icycle = 0 )) 1376 fi 1371 # check for an existing cycle number 1372 cycle=${basefilename##*.} 1373 if [[ $cycle =~ ^-?[0-9]+$ ]] 1374 then 1375 # NUMBERS WITH LEADING ZEROS ARE INTERPRETED AS OCTAL NUMBERS 1376 # 10# EXPLICITLY SPECIFIES THE NUMBER BASE AS 10 1377 (( icycle = $((10#$cycle)) )) 1378 explicit_cycle_number=true 1379 else 1380 (( icycle = 0 )) 1381 explicit_cycle_number=false 1382 fi 1377 1383 1378 if (( icycle > maxcycle )) 1379 then 1380 (( maxcycle = icycle )) 1381 1382 # FOR COMPATIBILITY REASONS WITH OLDER VERSIONS 1383 # CHECK IF CYCLE NUMBER CONTAINS LEADING ZEROS 1384 if [[ $(echo $cycle | cut -c1) = 0 ]] 1385 then 1386 leading_zero=true 1387 else 1388 leading_zero=false 1389 fi 1390 fi 1384 if (( icycle > maxcycle )) 1385 then 1386 (( maxcycle = icycle )) 1387 fi 1391 1388 1392 1389 done <filelist 1393 1390 rm filelist 1391 1394 1392 1395 1393 # MAKE CYCLE NUMBER THREE DIGITS WIDE 1396 if [[ $leading_zero = true ]] 1397 then 1398 cyclestring=`printf "%03d" $maxcycle` 1399 else 1400 cyclestring=$maxcycle 1401 fi 1394 cyclestring=`printf "%03d" $maxcycle` 1395 1402 1396 1403 1397 # APPEND CYCLE NUMBER TO FILENAME 1404 if (( maxcycle > 0 ))1398 if [[ $explicit_cycle_number = true ]] 1405 1399 then 1406 1400 if [[ "${extin[$nr_of_input_files]}" != " " && "${extin[$nr_of_input_files]}" != "" ]] … … 1420 1414 # IS LATER USED FOR TRANSFERRING FILES WIHIN THE JOB (SEE END OF FILE) 1421 1415 absnamein[$nr_of_input_files]=$filename 1422 if (( maxcycle > 0 ))1416 if [[ $explicit_cycle_number = true ]] 1423 1417 then 1424 1418 if [[ "${actionin[$nr_of_input_files]}" = di ]] … … 1996 1990 if [[ $running_in_batch_mode = false ]] 1997 1991 then 1992 1998 1993 # CREATE THE DIRECTORY 1999 1994 mkdir -p $tempdir … … 2166 2161 ln -f ${absnamein[$i]} ${localin[$i]} 2167 2162 fi 2168 # I f "ln -f" fails or if "$link_local_input = false" do a normal"cp"2163 # IF "ln -f" FAILS OR IF "$link_local_input = false" DO A NORMAL "cp" 2169 2164 if [[ ! -f "${localin[$i]}" ]] 2170 2165 then … … 2494 2489 ls -1 -d $filename > filelist 2>/dev/null 2495 2490 ls -1 -d $filename.* >> filelist 2>/dev/null 2491 (( maxcycle = 0 )) 2496 2492 while read line 2497 2493 do … … 2531 2527 if [[ "${actionout[$i]}" = a ]] 2532 2528 then 2533 (( maxcycle = maxcycle - 1 )) 2529 if (( maxcycle > 0 )) 2530 then 2531 (( maxcycle = maxcycle - 1 )) 2532 fi 2534 2533 fi 2535 2534 … … 2554 2553 fi 2555 2554 fi 2556 if (( cycnum[$i] > 0 )) 2557 then 2558 cyclestring=`printf "%03d" ${cycnum[$i]}` 2559 pathout[$i]=${pathout[$i]}.$cyclestring 2560 fi 2561 fi 2555 cyclestring=`printf "%03d" ${cycnum[$i]}` 2556 pathout[$i]=${pathout[$i]}.$cyclestring 2557 fi 2562 2558 2563 2559 # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION)
Note: See TracChangeset
for help on using the changeset viewer.