Changeset 1468 for palm/trunk/SCRIPTS/mrun
- Timestamp:
- Sep 24, 2014 2:06:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/mrun
r1443 r1468 22 22 # Current revisions: 23 23 # ------------------ 24 # 24 # Typo removed (addres->address) 25 # Bugfix: returning files to IMUK via ssh did not work for lccrayh and lcycrayb 26 # Added support for restart runs (remote) for lcxe6 25 27 # 26 28 # Former revisions: … … 257 259 if [[ `hostname` = rte10 ]] 258 260 then 259 return_addres =133.5.185.60260 echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"261 return_address=133.5.185.60 262 echo "+++ WARNING: fixed return_address = $return_address is used !!!!!" 261 263 elif [[ `hostname` = climate0 ]] 262 264 then 263 return_addres =165.132.26.68264 echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"265 return_address=165.132.26.68 266 echo "+++ WARNING: fixed return_address = $return_address is used !!!!!" 265 267 elif [[ `hostname` = urban00 ]] 266 268 then 267 return_addres =147.46.30.151268 echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"269 return_address=147.46.30.151 270 echo "+++ WARNING: fixed return_address = $return_address is used !!!!!" 269 271 else 270 return_addres =$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')272 return_address=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}') 271 273 fi 272 274 return_password="" … … 409 411 (q) queue=$OPTARG; mc="$mc -q$OPTARG";; 410 412 (r) run_mode=$OPTARG; mc="$mc -r'$OPTARG'";; 411 (R) remotecall=true;return_addres =$OPTARG; mc="$mc -R$OPTARG";;413 (R) remotecall=true;return_address=$OPTARG; mc="$mc -R$OPTARG";; 412 414 (s) source_list=$OPTARG; mc="$mc -s'$OPTARG'";; 413 415 (S) read_from_config=false; mc="$mc -S";; … … 670 672 671 673 # READ AND EVALUATE THE CONFIGURATION-FILE FROM WITHIN THIS SHELLSCRIPT 672 # (OPTION -S). THE DEFAULT IS USING THE ROUTINE interpret_config674 # (OPTION -S). THE DEFAULT IS USING THE ROUTINE <<<< 673 675 if [[ "$read_from_config" = false ]] 674 676 then … … 3407 3409 echo "fname=$fname" >> mpi_exec_shell 3408 3410 echo "localhost=$localhost" >> mpi_exec_shell 3409 echo "return_addres =$return_addres">> mpi_exec_shell3411 echo "return_address=$return_address" >> mpi_exec_shell 3410 3412 echo "return_username=$return_username" >> mpi_exec_shell 3411 3413 echo "tasks_per_node=$tasks_per_node" >> mpi_exec_shell … … 3419 3421 echo "export fname" >> mpi_exec_shell 3420 3422 echo "export localhost" >> mpi_exec_shell 3421 echo "export return_addres ">> mpi_exec_shell3423 echo "export return_address" >> mpi_exec_shell 3422 3424 echo "export return_username" >> mpi_exec_shell 3423 3425 echo "export tasks_per_node" >> mpi_exec_shell … … 3794 3796 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst" 3795 3797 printf "\n or higher cycle\n" 3796 echo "batch_scp $PORTOPT $cps -b -m -u $return_username $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]}3798 echo "batch_scp $PORTOPT $cps -b -m -u $return_username $return_address $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} 3797 3799 3798 3800 echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]} … … 3818 3820 if [[ $localhost = lccrayb ]] 3819 3821 then 3820 ssh $usern@blogin1 " cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m -u $return_username $return_addres ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}"3822 ssh $usern@blogin1 ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3821 3823 elif [[ $localhost = lccrayh ]] 3822 3824 then 3823 ssh $usern@hlogin1 "cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m -u $return_username $return_addres ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3825 ssh $usern@hlogin1 ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3826 elif [[ $localhost = lcxe6 ]] 3827 then 3828 ssh $usern@hexagon ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3824 3829 else 3825 batch_scp $PORTOPT $cps -b -m -u $return_username $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]}3830 batch_scp $PORTOPT $cps -b -m -u $return_username $return_address ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} 3826 3831 fi 3827 3832 [[ $? != 0 ]] && transfer_failed=true … … 3874 3879 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" 3875 3880 printf "\n or higher cycle\n" 3876 echo "batch_scp $PORTOPT -A -b -m -u $return_username $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]}3881 echo "batch_scp $PORTOPT -A -b -m -u $return_username $return_address $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} 3877 3882 3878 3883 echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]} … … 3898 3903 if [[ $localhost = lccrayb ]] 3899 3904 then 3900 ssh $usern@blogin1 " cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_addres ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}"3905 ssh $usern@blogin1 ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3901 3906 elif [[ $localhost = lccrayh ]] 3902 3907 then 3903 ssh $usern@hlogin1 "cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_addres ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3908 ssh $usern@hlogin1 ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3909 elif [[ $localhost = lcxe6 ]] 3910 then 3911 ssh $usern@hexagon ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3904 3912 else 3905 batch_scp $PORTOPT -A -b -m -u $return_username $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]}3913 batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} 3906 3914 fi 3907 3915 [[ $? != 0 ]] && transfer_failed=true … … 4372 4380 4373 4381 # START THE RESTART-JOB 4374 printf "\n\n *** initiating restart-run on \"$return_addres \" using command:\n"4382 printf "\n\n *** initiating restart-run on \"$return_address\" using command:\n" 4375 4383 echo " $mc" 4376 4384 printf "\n$dashes\n" … … 4378 4386 then 4379 4387 4380 if [[ $localhost = lccrayb || $localhost = lccrayh || $localhost = nech || $localhost = ibmh || $localhost = ibmkisti || $localhost = ibmku || $localhost = ibms || $localhost = lcflow || $localhost = lckyu* ]]4388 if [[ $localhost = lccrayb || $localhost = lccrayh || $localhost = nech || $localhost = ibmh || $localhost = ibmkisti || $localhost = ibmku || $localhost = ibms || $localhost = lcflow || $localhost = lckyu* || $localhost = lcxe6 ]] 4381 4389 then 4382 4390 echo "*** ssh will be used to initiate restart-runs!" 4383 echo " return_addres =\"$return_addres\" "4391 echo " return_address=\"$return_address\" " 4384 4392 echo " return_username=\"$return_username\" " 4385 if [[ $(echo $return_addres | grep -c "130.75.105") = 1 ]]4393 if [[ $(echo $return_address | grep -c "130.75.105") = 1 ]] 4386 4394 then 4387 4395 if [[ $localhost = ibmh ]] 4388 4396 then 4389 ssh $SSH_PORTOPT $usern@136.172.40.15 "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;. /muksoft_i/packages/intel/composer_xe_2013_sp1.2.144/bin/compilervars.sh intel64;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" "4397 ssh $SSH_PORTOPT $usern@136.172.40.15 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4390 4398 elif [[ $localhost = lccrayb ]] 4391 4399 then 4392 ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;. /muksoft_i/packages/intel/composer_xe_2013_sp1.2.144/bin/compilervars.sh intel64;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" "4400 ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4393 4401 elif [[ $localhost = lccrayh ]] 4394 4402 then 4395 ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;. /muksoft_i/packages/intel/composer_xe_2013_sp1.2.144/bin/compilervars.sh intel64;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4396 4403 ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4404 elif [[ $localhost = lcxe6 ]] 4405 then 4406 ssh $usern@hexagon "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4397 4407 else 4398 ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;. /muksoft_i/packages/intel/composer_xe_2013_sp1.2.144/bin/compilervars.sh intel64;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "4408 ssh $SSH_PORTOPT $return_address -l $return_username ". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 4399 4409 fi 4400 4410 else 4401 4411 if [[ $localhost = ibmkisti ]] 4402 4412 then 4403 ssh $SSH_PORTOPT $usern@gaiad "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" "4413 ssh $SSH_PORTOPT $usern@gaiad "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4404 4414 elif [[ $localhost = lcflow ]] 4405 4415 then 4406 /usr/bin/ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "4416 /usr/bin/ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 4407 4417 elif [[ $localhost = lccrayb ]] 4408 4418 then 4409 ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" "4419 ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4410 4420 elif [[ $localhost = lccrayh ]] 4411 4421 then 4412 ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" "4422 ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4413 4423 else 4414 ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "4424 ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 4415 4425 fi 4416 4426 fi … … 4509 4519 4510 4520 # BUILD THE MRUN-COMMAND TO BE CALLED IN THE BATCH-JOB ON THE REMOTE-MACHINE 4511 mrun_com="$mrun_script_name -a $afname -c $config_file -d $fname -h $host -H $fromhost -m $memory -t $cpumax -q $queue -R $return_addres -U $return_username -u $remote_username"4521 mrun_com="$mrun_script_name -a $afname -c $config_file -d $fname -h $host -H $fromhost -m $memory -t $cpumax -q $queue -R $return_address -U $return_username -u $remote_username" 4512 4522 [[ "$cpp_opts" != "" ]] && mrun_com=${mrun_com}" -D \"$cpp_opts\"" 4513 4523 [[ "$global_revision" != "" ]] && mrun_com=${mrun_com}" -G \"$global_revision\"" … … 4648 4658 # ON KISTI'S IBM FIREWALL IS ONLY OPENED ON INTERACTIVE NODE 4649 4659 echo "localdir=\`pwd\`" >> $jobfile 4650 echo "ssh $SSH_PORTOPT $remote_username@gaiad \"cd \$localdir; scp $PORTOPT -r $return_username@$return_addres :$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile4660 echo "ssh $SSH_PORTOPT $remote_username@gaiad \"cd \$localdir; scp $PORTOPT -r $return_username@$return_address:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile 4651 4661 elif [[ $host = lccrayb ]] 4652 4662 then 4653 4663 echo "localdir=\`pwd\`" >> $jobfile 4654 echo "ssh $SSH_PORTOPT $remote_username@blogin1 \"cd \$localdir; scp $PORTOPT -r $return_username@$return_addres :$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile4664 echo "ssh $SSH_PORTOPT $remote_username@blogin1 \"cd \$localdir; scp $PORTOPT -r $return_username@$return_address:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile 4655 4665 elif [[ $host = lccrayh ]] 4656 4666 then 4657 4667 echo "localdir=\`pwd\`" >> $jobfile 4658 echo "ssh $SSH_PORTOPT $remote_username@hlogin1 \"cd \$localdir; scp $PORTOPT -r $return_username@$return_addres :$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile4668 echo "ssh $SSH_PORTOPT $remote_username@hlogin1 \"cd \$localdir; scp $PORTOPT -r $return_username@$return_address:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile 4659 4669 4660 4670 else 4661 echo "scp $PORTOPT -r $return_username@$return_addres :$working_directory/SOURCES_FOR_RUN_$fname ." >> $jobfile4671 echo "scp $PORTOPT -r $return_username@$return_address:$working_directory/SOURCES_FOR_RUN_$fname ." >> $jobfile 4662 4672 fi 4663 4673 fi … … 4757 4767 echo "%END%" >> $jobfile 4758 4768 else 4759 echo "batch_scp $PORTOPT -b -o -g -s -u $return_username $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >> $jobfile4769 echo "batch_scp $PORTOPT -b -o -g -s -u $return_username $return_address ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >> $jobfile 4760 4770 fi 4761 4771
Note: See TracChangeset
for help on using the changeset viewer.