#!/bin/sh # ================================================================ # This script runs Tom Kennedy's simul_saw_bridge, with input parameters in # this script file, and output redirected to a specified output file. This # makes it possible to run simul_saw_bridge in the background on a compute # server, rather than from an interactive session. # # Sample usage: # # ssh chivo1 (or chivo2, chivo3, chivo4) # cd {your directory where these files are} # ./wrapper.sh & # logout # # Save this file as wrapper.sh, then # chmod +x wrapper.sh # That will make it executable. # # ================================================================ # John Kerl # kerl.john.r@gmail.com # 2009-08-12 # ================================================================ # Edit the following parameters to taste. mailto="kerl@math.arizona.edu" output_file="myoutput.txt" junkdata_name=junkdata passright_name=passright RNG_seed=-1 num_walk_steps=100000 FWSAW_flag=1 nsimplify=0 max_num_bridge=100 nsample=100000 bridge_type=1 height=0.2 endpoint_or_walk=0 # ---------------------------------------------------------------- # From here on down, you shouldn't need to change. # FYI: # # * The @@@ business is called a "here document" in shell-scripting jargon. # This allows us to specify input parameters without having to type them # manually. # # * The > redirects output to the specified file, instead of the terminal. # # * The 2>&1 sends stderr to the same file as stdout. # # * nice -10 reduces the compute job's scheduling priority. # # * nohup means the program will keep running after you log out ("hang up"). host_name=`hostname` start_time="`date`" nohup nice -10 simul_saw_bridge > $output_file 2>&1 <<@@@ $junkdata_name $passright_name $RNG_seed $num_walk_steps $FWSAW_flag $nsimplify $max_num_bridge $nsample $bridge_type $height $endpoint_or_walk @@@ end_time="`date`" mail -s "Compute job complete." $mailto <<@@@ Host: $host_name Start time: $start_time End time: $end_time Output file: $output_file @@@ # ---------------------------------------------------------------- # Example of running simul_saw_bridge interactively: # kerl@mundt:bridges% simul_saw_bridge # Enter name of file in which to store data (junkdata) # junkdata # Enter name of file in which to store pass right array (passright) # passright # seed for random number generator (-1) # -1 # number of steps in the walk (100000) # 100000 # 1 for strictly or 2 for weakly or 3 for FWSAW (1) # 1 # nsimplify (0) # 0 # max_num_bridge (100) # 100 # nsample (100000) # 100000 # bridge type, 1=horizontal line, 2=circle, -2=circle for full plane (1) # 1 # height (0.2) # 0.2 # just endpoint or walk? 0=endpt, 1=walk (0) # 0 # clock generated seed=435707 # nsteps=100000 # Initial walk has turn fraction 0.607606 # >>>>>>>>> 1 -1 0 2.011603 secs <<<<<<< # >>>>>>>>> 2 -1 0 3.964455 secs <<<<<<< # ...