Changeset 4153 for trunk/packages


Ignore:
Timestamp:
Jan 29, 2014, 1:42:54 PM (11 years ago)
Author:
gah
Message:

Update renderservers.tcl file comaments. Bug fix in redirecting stderr.

Location:
trunk/packages/vizservers/nanoscale
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanoscale/renderservers.tcl.in

    r4152 r4153  
    11#
    2 # This file is read by nanoscale to determine the ports to listen
     2# This file is read by nanoscale to determine which ports to listen
    33# to and the how to start the associated render server.
    44#
     
    1515#
    1616# The syntax is
    17 #       register_server <name> <port> <command> <variables>
     17#       register_server <name> <port> ?<flags>? {
     18#           commands...
     19#       } {
     20#           variables...
     21#       }
    1822#
    19 # This registers a server by the given name at the given port.
    20 # When a connection is made to that port, the command is run
    21 # with the environment variables initialized. 
     23# Registers a server by <name> at port <port>.
     24# When a connection is made to <port>, <command> is run.
     25# Environment variables will be set before executing command. 
    2226#
    2327# Note: Don't set DISPLAY here. nanoscale itself sets the DISPLAY
     
    4549}
    4650
    47 # NanoVis server (port 2000) --
    48 #     Volume renderer
     51# NanoVis --
     52#       Server Type     Volume renderer
     53#       Port            2000
     54#       Threaded        yes
     55# Notes:
     56#       o Continue to use default options until we offically upgrade
     57#         nanovis to the latest release.  We are currently using a 1.2
     58#         version of nanovis.
     59#       o Requires change to 1.2 nanovis.  Can't redirect stderr to log
     60#         or X will complain about performing socket operation on non-socket
     61#         descriptor.
    4962#
    50 register_server nanovis 2000 \
    51     -output 3 -logstdout no -logstderr no \
    52 {
    53     ${bindir}/nanovis -o 3 -p ${libdir}/shaders:${libdir}/resources
     63register_server nanovis 2000 {
     64    ${bindir}/nanovis -p ${libdir}/shaders:${libdir}/resources
    5465} {
    5566    LD_LIBRARY_PATH ${libdir}
    5667}
    5768
    58 # VtkVis server (port 2010)--
    59 #    3D drawings (scene graphs), Contour and surface graphs.
    60 #    Can remove ":${vtkdir} when moving to VTK 6.
     69# VtkVis --
     70#       Server type     3D drawings (scene graphs). Contour and surface graphs.
     71#       Port            2010
     72#       Threaded        yes
     73# Notes:
     74#       o Removed ${vtkdir} from LD_LIRBRARY_PATH. Not needed with VTK 6.
     75#       o Using new features in nanoscale/vtkvis to use file descriptor 3
     76#         for server output.  No automatic logging of stdout and stderr.
    6177#
    6278register_server vtkvis 2010 \
     
    6884}
    6985
    70 # Pymol experimental server (port 2019) --
    71 #     Molecular layouts from PDB description. 
    72 #     Need PYMOL_SITE_PATH only for parallelpiped box.py location.
    73 #   
    74 register_server pymolproxy 2019 {
    75     ${bindir}/pymolproxy ${bindir}/pymol -p -q -i -x -X 0 -Y 0
    76 } {
    77     PYMOL_SITE_PATH ${libdir}/pymol
    78     LD_LIBRARY_PATH ${libdir}
    79 }
    80 
    81 # Pymol server (threaded version of proxy) (port 2010) --
    82 #     Molecular layouts from PDB description. 
    83 #     Need PYMOL_SITE_PATH only for parallelpiped box.py location.
    84 #   
    85 register_server pymolproxy-threaded 2020 \
     86# PymolProxy --
     87#       Server type     Molecular layouts using Pymol viewer.
     88#       Port            2020
     89#       Threaded        yes
     90# Notes:
     91#       o Need PYMOL_SITE_PATH for parallelpiped box.py location.
     92#       o Makes no sense to log stdout and stderr of the proxy.
     93#       o Renamed to just pymolproxy and removed non-threaded entry.
     94#
     95register_server pymolproxy 2020 \
    8696    -logstdout no -logstderr no \
    8797{
     
    92102}
    93103
    94 # vmd server (used for mdshowcase)
    95 #
     104# VmdShow --
     105#       Server type     Molecular layouts using VMD viewer (for mdshowcase).
     106#       Port            2018
     107#       Threaded        no
     108# Notes:
     109#       o Commands are sent directly to the VMD process that uses custom
     110#         TCL code to process.
     111#       o Redirect input to descriptor 3: Otherwise VMD will get select hit.
     112#       o Redirect output to descriptor 4: Lots of information written to
     113#         stdout and stderr of VMD.  Captured in log file.
     114#       o Executing binary without wrapper shell script. Requires VMDDIR set.
     115#       o Meshing programs surf and msms require explicit environment variables.
     116#       o __GL_SYNC_TO_VBLANK probably doesn't matter.
     117#       o Client doesn't send data files to VMD, but file paths.  Unlikely
     118#         client will block on a large write. 
     119#       
    96120register_server vmdshow 2018 \
    97121    -input 3 -output 4 -combinelogs yes \
  • trunk/packages/vizservers/nanoscale/server.c

    r4132 r4153  
    6565    int numEnvArgs;                     /* # of args in environment.  */
    6666    char *const *cmdArgs;               /* Command to execute for
    67                                            server. */
     67                                         * server. */
    6868    char *const *envArgs;               /* Environment strings to set. */
    6969    int listenerFd;                     /* Descriptor of the listener
     
    601601                        exit(1);
    602602                    }
    603                     if (dup2(newFd, 1) < 0) {
     603                    if (dup2(newFd, 2) < 0) {
    604604                        ERROR("%s: can't dup stderr to \"%s\": %s",
    605605                              serverPtr->name, path, strerror(errno));
     
    614614                    exit(1);
    615615                }
     616                /* When are the input and output ports of the render server
     617                 * the same?  It's an error when input == output. */
    616618                if (serverPtr->outputFd != serverPtr->inputFd) {
    617619                    if (dup2(sock, serverPtr->outputFd) < 0) { /* output */
     
    633635                    setenv(serverPtr->envArgs[i], serverPtr->envArgs[i+1], 1);
    634636                }
    635                 INFO("Executing %s: client %s, %s in=%d out=%d on DISPLAY=%s",
     637                {
     638                    char *cmd;
     639
     640                    cmd = Tcl_Merge(serverPtr->numCmdArgs,
     641                                    (const char *const *)serverPtr->cmdArgs);
     642                    INFO("Executing %s: client=%s, \"%s\" in=%d out=%d on DISPLAY=%s",
    636643                     serverPtr->name, inet_ntoa(newaddr.sin_addr),
    637                      serverPtr->cmdArgs[0], serverPtr->inputFd,
    638                      serverPtr->outputFd, display);
    639                 /* Replace the current process with the render server. */
    640                 execvp(serverPtr->cmdArgs[0], serverPtr->cmdArgs);
    641                 ERROR("Can't execute \"%s\": %s", serverPtr->cmdArgs[0],
    642                       strerror(errno));
    643                 exit(1);
     644                     cmd, serverPtr->inputFd, serverPtr->outputFd, display);
     645                    /* Replace the current process with the render server. */
     646                    execvp(serverPtr->cmdArgs[0], serverPtr->cmdArgs);
     647                    ERROR("Can't execute \"%s\": %s", cmd, strerror(errno));
     648                    Tcl_Free(cmd);
     649                    exit(1);
     650                }
    644651            } else {
    645652                close(sock);
Note: See TracChangeset for help on using the changeset viewer.