[749] | 1 | #! /bin/sh |
---|
| 2 | |
---|
| 3 | DISPLAY=:0 |
---|
| 4 | export DISPLAY |
---|
| 5 | |
---|
[1231] | 6 | # Fail on errors |
---|
| 7 | set -e |
---|
| 8 | |
---|
[1265] | 9 | # Use the IP address of this host to construct a broadcast address. This |
---|
| 10 | # feature will be hopefully going away very soon. |
---|
| 11 | |
---|
[1278] | 12 | broadcast=`hostname -i | sed 's/\.[0-9]*$/.255/'` |
---|
[1265] | 13 | |
---|
[1131] | 14 | render_dir="@prefix@" |
---|
[1111] | 15 | nanoscale_port=2000 |
---|
| 16 | nanovis_port=2000 |
---|
| 17 | pymol_port=2020 |
---|
[985] | 18 | |
---|
[1131] | 19 | # Build the name of the run directory. This is where nanoscale and the |
---|
| 20 | # visualization programs will reside. The directory name is the same as the |
---|
| 21 | # render directory. |
---|
| 22 | dir="/tmp/`basename $render_dir`" |
---|
[749] | 23 | |
---|
[1231] | 24 | |
---|
[753] | 25 | PATH=${dir}/bin:$PATH |
---|
[749] | 26 | LD_LIBRARY_PATH=${dir}/lib:$LD_LIBRARY_PATH |
---|
[760] | 27 | PYMOL_PATH=${dir}/lib/pymol |
---|
[1131] | 28 | |
---|
[760] | 29 | export PATH LD_LIBRARY_PATH PYMOL_PATH |
---|
[749] | 30 | |
---|
[1265] | 31 | # Determine the number of video cards we have. The new render server |
---|
| 32 | # motherboards have the useless XGI Volaria onboard video controllers (no 3D |
---|
| 33 | # capabilities) so we have to make sure we count only the nVidia cards. |
---|
| 34 | |
---|
| 35 | nvideo=`lspci | fgrep VGA | fgrep nVidia | wc -l` |
---|
| 36 | |
---|
[1233] | 37 | nanoscale="${dir}/bin/nanoscale -x ${nvideo} -b $nanoscale_port -s $broadcast" |
---|
[1111] | 38 | nanovis="${dir}/bin/nanovis -p ${dir}/lib/shaders:${dir}/lib/resources" |
---|
| 39 | pymolproxy="${dir}/bin/pymolproxy ${dir}/bin/pymol -p -q -i -x -X 0 -Y 0" |
---|
| 40 | |
---|
[1131] | 41 | # Copy from render directory if the run copy doesn't already exist. |
---|
| 42 | # Otherwise use what's there. This means that successive invocations |
---|
| 43 | # of nanoscale won't create their own run directories (only the first |
---|
| 44 | # one will). |
---|
[749] | 45 | |
---|
[1187] | 46 | if test -d "$dir" ; then |
---|
[1131] | 47 | echo "Reusing previously installed version from $render_dir" |
---|
| 48 | else |
---|
| 49 | echo "Copying rappture from $render_dir" |
---|
| 50 | mkdir -p $dir |
---|
| 51 | tar -C ${render_dir} -clf - . | tar -C $dir -xpf - |
---|
| 52 | fi |
---|
| 53 | |
---|
[749] | 54 | cd ${dir} |
---|
| 55 | |
---|
[1132] | 56 | # Don't let nanoscale and the visualization servers run away. |
---|
[1131] | 57 | # Limit cpu time to 20 minutes. |
---|
[852] | 58 | minutes=20 |
---|
| 59 | ulimit -t $(expr ${minutes} \* 60 ) |
---|
| 60 | |
---|
[1131] | 61 | echo "$nanoscale -l $nanovis_port -c \"$nanovis\" -l $pymol_port -c \"$pymolproxy\"" |
---|
| 62 | $nanoscale -l $nanovis_port -c "$nanovis" -l $pymol_port -c "$pymolproxy" |
---|
[1111] | 63 | |
---|