Changeset 149 for palm/trunk/SCRIPTS


Ignore:
Timestamp:
Feb 28, 2008 3:47:22 PM (16 years ago)
Author:
letzel
Message:

Modifications of mrun concerning hard links:

  • link of restart files with long file name possible
  • If environment variable link_local_output is set to true, mrun tries "ln -f" on local output and resorts to "cp" or "cp -r" on error
File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/mrun

    r146 r149  
    136136     #                     queues
    137137     # 30/10/07 - Marcus - further adjustments for queues on lctit
    138 
     138     # 14/02/08 - Bjoern - link of restart files with long file name possible
     139     # 28/02/08 - Marcus - If environment variable link_local_output is set to
     140     #                     true, mrun tries "ln -f" on local output and resorts
     141     #                     to "cp" or "cp -r" on error
    139142 
    140143    # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
     
    182185 job_on_file=""
    183186 keep_data_from_previous_run=false
     187 link_local_output=false
    184188 localhost_realname=$(hostname)
    185189 local_compile=false
     
    23302334             then
    23312335                mkdir  ${localin[$i]}
    2332                 ln  $tmp_data_catalog/${frelin[$i]}/*  ${localin[$i]}
     2336                cd $tmp_data_catalog/${frelin[$i]}
     2337                for file in $(ls *)
     2338                do
     2339                   ln $file $TEMPDIR/${localin[$i]}
     2340                done
     2341                cd $TEMPDIR
    23332342                got_tmp[$i]=true
    23342343             elif [[ -d "$WORK/${frelin[$i]}"  &&  $ignore_archive_error = true ]]
     
    30983107                printf "\n              $tmp_data_catalog/${frelout[$i]} (temporary data catalog)\n"
    30993108                mkdir  $tmp_data_catalog/${frelout[$i]}
    3100                 ln -f  ${localout[$i]}/*  $tmp_data_catalog/${frelout[$i]}
     3109                cd ${localout[$i]}
     3110                for file in $(ls *)
     3111                do
     3112                   ln -f $file $tmp_data_catalog/${frelout[$i]}
     3113                done
     3114                cd $TEMPDIR
    31013115             fi
    31023116
     
    34123426             then
    34133427                printf "\n  >>> OUTPUT: ${localout[$i]}  to  ${pathout[$i]}.${extout[$i]}\n"
    3414                 cp  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
     3428                if [[ $link_local_output = true ]]
     3429                then
     3430                    printf "      using ln -f\n"
     3431                    ln -f  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
     3432                fi
     3433                # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"
     3434                if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]]
     3435                then
     3436                    if [[ $link_local_output = true ]]
     3437                    then
     3438                        printf "      ln failed, using cp...\n"
     3439                    fi
     3440                    cp  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
     3441                fi
    34153442             else
    34163443                printf "\n  >>> OUTPUT: ${localout[$i]}  to  ${pathout[$i]}\n"
    3417                 cp  ${localout[$i]}  ${pathout[$i]}
     3444                if [[ $link_local_output = true ]]
     3445                then
     3446                    printf "      using ln -f\n"
     3447                    ln -f  ${localout[$i]}  ${pathout[$i]}
     3448                fi
     3449                # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"
     3450                if [[ ! -f "${pathout[$i]}" ]]
     3451                then
     3452                    if [[ $link_local_output = true ]]
     3453                    then
     3454                        printf "      ln failed, using cp...\n"
     3455                    fi
     3456                    cp  ${localout[$i]}  ${pathout[$i]}
     3457                fi
    34183458             fi
    34193459
     
    34263466                # PER MOVE UMBENANNT WERDEN
    34273467             printf "\n  >>> OUTPUT: ${localout[$i]}/_....  to  ${pathout[$i]}\n"
    3428              cp -r  ${localout[$i]}  ${pathout[$i]}
     3468             if [[ $link_local_output = true ]]
     3469             then
     3470                 printf "      using ln -f\n"
     3471                 mkdir  ${pathout[$i]}
     3472                 cd ${localout[$i]}
     3473                 for file in $(ls *)
     3474                 do
     3475                   ln -f $file  ${pathout[$i]}
     3476                 done
     3477                 cd $TEMPDIR
     3478             fi
     3479             # If "ln -f" fails of if "$link_local_output = false" do a normal "cp -r"
     3480             if [[ ! -f "${pathout[$i]}/_0000" ]]
     3481             then
     3482                 if [[ $link_local_output = true ]]
     3483                 then
     3484                     printf "      ln failed for .../_0000, using cp...\n"
     3485                 fi
     3486                 cp -r  ${localout[$i]}  ${pathout[$i]}
     3487             fi
    34293488
    34303489          fi
Note: See TracChangeset for help on using the changeset viewer.