#! /bin/sh DISPLAY=:0 export DISPLAY # Fail on errors set -e # Use the IP address of this host to construct a broadcast address. This # feature will be hopefully going away very soon. broadcast=`hostname -i | sed 's/\.[0-9]*$/.255/'` render_dir="@prefix@" nanoscale_port=2000 nanovis_port=2000 pymol_port=2020 # Build the name of the run directory. This is where nanoscale and the # visualization programs will reside. The directory name is the same as the # render directory. dir="/tmp/`basename $render_dir`" PATH=${dir}/bin:$PATH LD_LIBRARY_PATH=${dir}/lib:$LD_LIBRARY_PATH PYMOL_PATH=${dir}/lib/pymol export PATH LD_LIBRARY_PATH PYMOL_PATH # Determine the number of video cards we have. The new render server # motherboards have the useless XGI Volaria onboard video controllers (no 3D # capabilities) so we have to make sure we count only the nVidia cards. nvideo=`lspci | fgrep VGA | fgrep nVidia | wc -l` nanoscale="${dir}/bin/nanoscale -x ${nvideo} -b $nanoscale_port -s $broadcast" nanovis="${dir}/bin/nanovis -p ${dir}/lib/shaders:${dir}/lib/resources" pymolproxy="${dir}/bin/pymolproxy ${dir}/bin/pymol -p -q -i -x -X 0 -Y 0" # Copy from render directory if the run copy doesn't already exist. # Otherwise use what's there. This means that successive invocations # of nanoscale won't create their own run directories (only the first # one will). if test -d "$dir" ; then echo "Reusing previously installed version from $render_dir" else echo "Copying rappture from $render_dir" mkdir -p $dir tar -C ${render_dir} -clf - . | tar -C $dir -xpf - fi cd ${dir} # Don't let nanoscale and the visualization servers run away. # Limit cpu time to 20 minutes. minutes=20 ulimit -t $(expr ${minutes} \* 60 ) echo "$nanoscale -l $nanovis_port -c \"$nanovis\" -l $pymol_port -c \"$pymolproxy\"" $nanoscale -l $nanovis_port -c "$nanovis" -l $pymol_port -c "$pymolproxy"