Changeset 4536 for palm/trunk/SCRIPTS
- Timestamp:
- May 17, 2020 5:24:13 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmrun
r4481 r4536 27 27 # ----------------- 28 28 # $Id$ 29 # handling of single restart files (created with MPI-I/O) added 30 # 31 # 4481 2020-03-31 18:55:54Z maronga 29 32 # add cycle number to initial files too (000), 30 33 # remove compatibility for cycle numbers which are less than three digits wide … … 2045 2048 files_for_cores=true; filetype=files 2046 2049 actionin[$i]="ln" 2050 # FILE HAS BEEN FOUND INSTEAD OF DIRECTORY 2051 if [[ -f "${absnamein[$i]}" ]] 2052 then 2053 files_for_cores=false; filetype=file 2054 fi 2047 2055 elif [[ "${actionin[$i]}" = lnpe && ! -n $cores ]] 2048 2056 then … … 2572 2580 link_local_output=true 2573 2581 actionout[$i]="" 2582 # FILE HAS BEEN FOUND INSTEAD OF DIRECTORY 2583 if [[ -f ${localout[$i]} ]] 2584 then 2585 files_for_cores=false; filetype=file 2586 fi 2574 2587 elif [[ "${actionout[$i]}" = lnpe && ! -n $cores ]] 2575 2588 then 2576 link_local_output 2589 link_local_output=true 2577 2590 actionout[$i]="" 2578 2591 elif [[ "${actionout[$i]}" = trpe && -n $cores ]] … … 2697 2710 printf "\n >>> OUTPUT: ${localout[$i]} to" 2698 2711 printf "\n ${pathout[$i]}.${extout[$i]}\n" 2699 if [[ $link_local_output = true ]] 2700 then 2701 printf " file will be linked\n" 2702 ln -f ${localout[$i]} ${pathout[$i]}.${extout[$i]} 2703 fi 2704 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp" 2705 if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]] 2712 if [[ $link_local_output = true ]] 2706 2713 then 2707 if [[ $link_local_output = true ]] 2708 then 2714 printf " file will be linked\n" 2715 ln -f ${localout[$i]} ${pathout[$i]}.${extout[$i]} 2716 fi 2717 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp" 2718 if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]] 2719 then 2720 if [[ $link_local_output = true ]] 2721 then 2709 2722 printf " --- WARNING: ln failed, using cp instead (might be time consuming...)\n" 2710 fi 2711 cp ${localout[$i]} ${pathout[$i]}.${extout[$i]} 2712 else 2713 printf "+++ no copy because file ${pathout[$i]}.${extout[$i]} exists\n" 2723 fi 2724 cp ${localout[$i]} ${pathout[$i]}.${extout[$i]} 2714 2725 fi 2715 2726 else 2716 2727 printf "\n >>> OUTPUT: ${localout[$i]} to" 2717 2728 printf "\n ${pathout[$i]}\n" 2718 if [[ $link_local_output = true ]] 2719 then 2720 printf " file will be linked\n" 2721 ln -f ${localout[$i]} ${pathout[$i]} 2722 fi 2723 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp" 2724 if [[ ! -f "${pathout[$i]}" ]] 2729 if [[ $link_local_output = true ]] 2725 2730 then 2726 if [[ $link_local_output = true ]] 2727 then 2731 printf " file will be linked\n" 2732 ln -f ${localout[$i]} ${pathout[$i]} 2733 fi 2734 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp" 2735 if [[ ! -f "${pathout[$i]}" ]] 2736 then 2737 if [[ $link_local_output = true ]] 2738 then 2728 2739 printf " --- WARNING: ln failed, using cp instead (might be time consuming...)\n" 2729 fi 2730 cp ${localout[$i]} ${pathout[$i]} 2731 else 2732 printf "+++ no copy because file ${pathout[$i]} exists\n" 2740 fi 2741 cp ${localout[$i]} ${pathout[$i]} 2733 2742 fi 2734 2743 fi … … 2741 2750 printf "\n >>> OUTPUT: ${localout[$i]}/_.... to" 2742 2751 printf "\n ${pathout[$i]}\n" 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2752 if [[ $link_local_output = true ]] 2753 then 2754 printf " files will be linked\n" 2755 mkdir -p ${pathout[$i]} 2756 cd ${localout[$i]} 2757 for file in $(ls *) 2758 do 2759 ln -f $file ${pathout[$i]} 2760 done >|/dev/null 2>&1 2761 cd $tempdir 2762 fi 2754 2763 2755 2764 # IF "ln -f" HAS FAILED OR IF "$link_local_output = false" DO A NORMAL COPY "cp -r" 2756 2765 if [[ ! -f "${pathout[$i]}/_000000" ]] 2757 2766 then 2758 2759 2767 if [[ $link_local_output = true ]] 2768 then 2760 2769 printf " --- WARNING: ln failed, using cp instead (might be time consuming...)\n" 2761 2762 2763 2770 fi 2771 [[ ! -d "${pathout[$i]}" ]] && mkdir ${pathout[$i]} 2772 cp -r ${localout[$i]}/* ${pathout[$i]} 2764 2773 fi 2765 2774
Note: See TracChangeset
for help on using the changeset viewer.