source: trunk/packages/vizservers/start_viz.sh.in @ 1231

Last change on this file since 1231 was 1231, checked in by gah, 15 years ago

allow multiple screens for render server

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#! /bin/sh
2
3DISPLAY=:0
4export DISPLAY
5
6# Fail on errors
7set -e
8
9broadcast="192.168.200.255"
10render_dir="@prefix@"
11nanoscale_port=2000
12nanovis_port=2000
13pymol_port=2020
14
15# Build the name of the run directory. This is where nanoscale and the
16# visualization programs will reside.  The directory name is the same as the
17# render directory.
18dir="/tmp/`basename $render_dir`"
19
20
21PATH=${dir}/bin:$PATH
22LD_LIBRARY_PATH=${dir}/lib:$LD_LIBRARY_PATH
23PYMOL_PATH=${dir}/lib/pymol
24
25export PATH LD_LIBRARY_PATH PYMOL_PATH
26
27nscreens=`lspci | fgrep VGA | wc -l`
28nanoscale="${dir}/bin/nanoscale -S${nscreens} -b $nanoscale_port -s $broadcast"
29nanovis="${dir}/bin/nanovis -p ${dir}/lib/shaders:${dir}/lib/resources"
30pymolproxy="${dir}/bin/pymolproxy ${dir}/bin/pymol -p -q -i -x -X 0 -Y 0"
31
32# Copy from render directory if the run copy doesn't already exist.
33# Otherwise use what's there.  This means that successive invocations
34# of nanoscale won't create their own run directories (only the first
35# one will).
36
37if test -d "$dir" ; then
38  echo "Reusing previously installed version from $render_dir"
39else
40  echo "Copying rappture from $render_dir"
41  mkdir -p $dir
42  tar -C ${render_dir} -clf - . | tar -C $dir -xpf -
43fi
44
45cd ${dir}
46
47# Don't let nanoscale and the visualization servers run away.
48# Limit cpu time to 20 minutes.
49minutes=20
50ulimit -t $(expr ${minutes} \* 60 )
51
52echo "$nanoscale -l $nanovis_port -c \"$nanovis\" -l $pymol_port -c \"$pymolproxy\""
53$nanoscale -l $nanovis_port -c "$nanovis" -l $pymol_port -c "$pymolproxy"
54
Note: See TracBrowser for help on using the repository browser.