Changeset 2605 for palm/trunk/SCRIPTS
- Timestamp:
- Nov 9, 2017 3:31:46 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmrun
r2600 r2605 27 27 # ----------------- 28 28 # $Id$ 29 # in case of remote jobs, input files with "job" or "jobopt" (new) attribute 30 # will not be sent with the job file any more, but copied into the 31 # SOURCES_FOR_RUN... folder on the remote host, before he job is submitted 32 # 33 # 2600 2017-11-01 14:11:20Z raasch 29 34 # cycle numbers are made three digits wide 30 35 # … … 568 573 typein[$iin]=$s3; pathin[$iin]=$s4; endin[$iin]=$s5; 569 574 extin[$iin]=$s6 575 576 # FILES WITH JOB-ATTRIBUTE ARE STORED IN THE SOURCES_FOR_RUN 577 # FOLDER IF THE JOB IS RUNNING ON A REMOTE HOST 578 if [[ $running_on_remote = true && ( "$s2b" = job || "$s2b" = jobopt ) ]] 579 then 580 pathin[$iin]=${fast_io_catalog}/${sources_for_run_catalog} 581 fi 582 570 583 fi 571 584 elif [[ "$s2a" = out && ! ( $create_remote_batch_job = true && "$s2b" = loc ) ]] … … 854 867 fi 855 868 869 856 870 # GET THE GLOBAL REVISION-NUMBER OF THE SVN-REPOSITORY 857 871 # (HANDED OVER TO RESTART-RUNS USING OPTION -G) … … 977 991 978 992 # FILES WITH ATTRIBUTE locopt ARE OPTIONAL. NO ABORT, IF THEY DO NOT EXIST. 979 if [[ "${transin[$i]}" != "locopt" ]]993 if [[ "${transin[$i]}" != "locopt" && "${transin[$i]}" != "jobopt" ]] 980 994 then 981 995 printf "\n\n +++ INPUT-file: " … … 991 1005 transin[$i]="unavailable" 992 1006 fi 1007 993 1008 else 994 1009 … … 1658 1673 1659 1674 1675 # WHEN CREATING A REMOTE BATCH JOB, THOSE INPUT FILES WITH JOB-ATTRIBUT WILL 1676 # BE COPIED TO THE REMOTE HOST 1677 if [[ $create_remote_batch_job = true ]] 1678 then 1679 (( i = 0 )) 1680 while (( i < iin )) 1681 do 1682 (( i = i + 1 )) 1683 if [[ "${transin[$i]}" = job || "${transin[$i]}" = jobopt ]] 1684 then 1685 eval inputfile=${pathin[$i]}/${frelin[$i]} 1686 scp -q $ssh_key $PORTOPT $inputfile ${remote_username}@${remote_ip}:${fast_io_catalog}/${sources_for_run_catalog}/${frelin[$i]} 1687 fi 1688 done 1689 if (( i > 0 )) 1690 then 1691 printf " *** input files have been copied to the remote host\n" 1692 fi 1693 fi 1694 1695 1660 1696 # NOW PERFORM THOSE ACTIONS REQUIRED TO EXECUTE THE PROGRAM (PALM) ON THIS MACHINE 1661 1697 # (COMPILING/LINKING, EXECUTING, COPYING I/O FILES) … … 1837 1873 ln -f ${absnamein[$i]} ${localin[$i]} 1838 1874 fi 1839 # If "ln -f" fails o fif "$link_local_input = false" do a normal "cp"1875 # If "ln -f" fails or if "$link_local_input = false" do a normal "cp" 1840 1876 if [[ ! -f "${localin[$i]}" ]] 1841 1877 then … … 1844 1880 printf "\n --- WARNING: ln failed, using cp instead (might be time consuming...)" 1845 1881 fi 1846 cp ${absnamein[$i]} ${localin[$i]} 1882 if [[ $running_on_remote = true && ( "${transin[$i]}" = job || "${transin[$i]}" = jobopt ) ]] 1883 then 1884 mv ${absnamein[$i]} ${localin[$i]} 1885 else 1886 cp ${absnamein[$i]} ${localin[$i]} 1887 fi 1847 1888 fi 1848 1889 fi … … 2001 2042 2002 2043 # TEMPORARY SOLUTION TO SKIP combine_plot_fields. THIS IS REQUIRED IN CASE OF HUGE AMOUNT OF 2003 # DATA OUTPUT. TO DO: EXTEND THIS BRANCH BY CREATING A BATCH JOB for combine_plot_fields. 2004 # ??? koennen wir das streichen ??? 2044 # DATA OUTPUT 2005 2045 printf "\n\n\n *** post-processing: skipping combine_plot_fields (-Z option set) ..." 2006 2046 fi … … 2509 2549 2510 2550 2511 # GET REQUIRED INPUT-FILES BY SCP OR BY SENDING THEM WITH THE JOB AS HERE-DOCUMENT2512 # PUT THESE FILES INTO THE USER'S RESPECTIVE PERMANENT DIRECTORIES ON THE REMOTE-HOST2513 # IF THE DIRECTORIES DO NOT EXIST, TRY TO CREATE THEM2514 if [[ $create_remote_batch_job = true ]]2515 then2516 (( i = 0 ))2517 while (( i < iin ))2518 do2519 (( i = i + 1 ))2520 echo "[[ ! -d ${pathin[$i]} ]] && mkdir -p ${pathin[$i]}" >> $jobfile2521 if [[ "${transin[$i]}" = job ]]2522 then2523 echo "cat > ${remotepathin[$i]} <<\"%END%\"" >> $jobfile2524 eval cat ${pathin[$i]}/${frelin[$i]} >> $jobfile2525 echo " " >> $jobfile2526 echo "%END%" >> $jobfile2527 else2528 echo "batch_scp $PORTOPT -b -o -g -s -u $local_username $return_address ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >> $jobfile2529 fi2530 2531 # CHECK, IF FILE COULD BE CREATED2532 echo "if [[ \$? = 1 ]]" >> $jobfile2533 echo "then" >> $jobfile2534 echo " echo \" \" " >> $jobfile2535 echo " echo \"+++ file ${remotepathin[$i]} could not be created\" " >> $jobfile2536 echo " echo \" please check, if directory exists on $host_configuration!\" " >> $jobfile2537 echo " echo \"+++ PALMRUN will not be continued\" " >> $jobfile2538 echo " execute_palmrun=false" >> $jobfile2539 echo "fi" >> $jobfile2540 done2541 fi2542 2543 2544 2551 # PROVIDE NAME OF THE CURRENT WORKING-DIRECTORY ON THE LOCAL MACHINE (FROM WHERE THE JOB IS 2545 2552 # STARTED) BY SETTING AN ENVIRONMENT-VARIABLE. THIS INFORMATION IS USED IN THE JOB BY PALMRUN
Note: See TracChangeset
for help on using the changeset viewer.