|
|
|
|
SynopsisA session is a conceptual notion of how various CIAO applications interact with each other to form an integrated data analysis environment. DescriptionWhile all of the CIAO data analysis tools may be run independently, many of them work together to form a coherent data analysis session. A major benefit of this concept is that it is possible to save the state of an analysis session so that it can be resumed at a later date or shared with a colleague. For instance, if two scientists are collaborating on a research project and have access to the same data, it is possible for one scientist to save the analysis session and send a copy of the save file to the other who may then load the session to check progress, view results, and so forth. While much of the underlying session code is transparent to users, a "Session" menu is available in the prism GUI to allow users to take full advantage of the functionality. This menu contains options to allow a user to save the current state of their analysis session or exit out of all of the applications in the data session with a single action. The parameter file CIAO.par controls the user configurable preferences of the data analysis session; see "ahelp ciao.par" for more information. What is a CIAO analysis session?In simplest terms, a CIAO analysis session is any of the various tools and their data. It could be a single tool examining a data file or a collection of tools used in conjuction with each other to analyze one or more observations. Not all CIAO tools are equipped with the session functionality; at present, only prism utilizes it. In actuality, the session concept is governed by a combination of the username, hostname, and display name on which applications are run. Two applications with identical values for these three factors are considered part of the same session. If any of the three values differ between two applications, they are considered separate sessions. For instance, two users logged into a remote host with the same userid but directing output to their individual terminals would be considered as two different sessions. Additionally, a constraint on the number of instances of any given application is also imposed. What benefit do I get from the analysis session?While a user generally will not notice the interactions within the session, they will still benefit from it. The biggest benefit they may notice is in regards to conflict reduction. Without the session, two users running on the same host may affect each other's applications without even realizing it. For instance, its possible for one of them to attempt to display their data only to have the data appear in the other user's imager. How can I turn session support off?The "-nosession" command-line option allows a GUI to be run outside of the session support. This can be used with prism and taskmonitor. Session support is automatically turned off if the maximum number of instances of an application are already running (the "maxinstances" parameter of ciao.par) or if the application is unable to access the shared memory resources. How do I use the XPA access points?To find out what XPA access points are available you can use either the XPA command-line tools provided with CIAO (see the XPA documentation for details) or the XPA S-Lang module. Here we use the command-line tool xpaget to list all the available nameservers after starting two instances of Prism: unix% xpaget xpans v2.0.ciaouser.chandra.chandra prism gs /tmp/.xpa/v2.0.ciaouser.chandra.chandra_prism.28187 ciaouser v2.0.ciaouser.chandra.chandra prism2 gs /tmp/.xpa/v2.0.ciaouser.chandra.chandra_prism2.28188 ciaouser This shows that the access points are called prism and prism2, and that they all have the same session key. An alternative way to find out if a specific access point exists is to use the xpaaccess tool: unix% xpaaccess prism2 yes To find out what commands are recognised by a particular access point you just use xpaget with the name of the access point and a list of the known commands will be printed to the standard output. As an example, when prism is running you get:
unix% xpaget prism
file: Open file or get filename in browser
options: <filename>
image: View/image either current or new file
options:
file <filename> <block column1 column2>
rectangle <ra dec width height rotation label> |
circle <ra dec radius label> |
line <start_ra start_dec end_ra end_dec label> |
ellipse <ra dec width height rotation label> |
point <ra dec label> |
polygon <[ra dec] ... label> |
multipoints <[ra dec label] ...> |
newarea | area <area num> |
region ciao|ds9|saotng <physical|image>
moveto: Select different block/HDU within the file
options: <block#>
plot: View/plot either current or newly specified file
options:
file <filename> <column1> <column2> |
<column1> <column2> |
print <filename>
save <filename>
selected: Return space-delimited list of selected info
options:
rows (returns list of row numbers) |
cols (returns list of column names)
exit: Exit the current application
options: None
quit: Synonym for "exit"
and so to close down this instance of prism you can say - at the command line - unix% xpaset -p prism quit The XPA documentation provides a much fuller description of how to use these tools. In particular if you want to send or receive data via XPA you should read the descriptions of the xpaset and xpaget routines. THE SESSION KEYThe "Session key" is used to allow tools to communicate with each other and is defined as a string with the following format, v2.0.logname.hostname.display where
If the CXCDS_SESSION_QUALIFIER environment variable is set then this value is appended to the end of the key (separated by a "."), which allows multiple sessions to be defined on the same machine. The value of the key for the current session can be found using: unix% ciaoshmem -i v2.0.ciaouser.chandra.chandra This example assumes that $LOGNAME is set to "ciaouser", that the machine (and hence the $HOST variable) is called "chandra" and $DISPLAY is set to "chandra:0.0". HOUSEKEEPING FILESWhen new resources are allocated for a session, a small file is created in your $HOME/.ciao/ directory and used to store pertinent information about the resource. The file will be automatically deleted when the resource is no longer in use, and should not be changed by the user. It is mainly useful when trying to track down problems when resources have not been cleanly released. Configuration Error: Unable to create or access shared memory segmentThe cause of the above error message - seen when starting an application - is that the program was unable to create or use a system resource it required. This mostly occurs when a previous application has not exited cleanly, such as after a program has crashed. The first thing to try is "ciaoshmem -c", or "ciaoshmem -c all", to clear up the resources. If this does not work then look in your $HOME/.ciao/ directory for any left over files which begin with "session_" and end with the session key; it is best to do this after shutting down all the CIAO GUIs to ensure that any files in this directory are truly due to un-freed resources. If any files do exist then: Cat the fileThe files are short ASCII files that list the allocated resource (the name of the file will depend on the value of the session key): unix% cat $HOME/.ciao/session_v2.0.ciaouser.chandra.chandra Session Key : 0xf75bff1 Session Prefix : Shared Memory id : 72201 Max instances : 10 Buffer size : 14764 Check the allocated resourcesThe UNIX ipcs command can be used to list allocated resources used by the system (by both CIAO and other tools). The output depends on what system you are using; that below is an example of the Solaris 2.8 output: unix% ipcs IPC status from <running system> as of Wed Jun 4 19:20:12 EDT 2003 T ID KEY MODE OWNER GROUP Message Queues: Shared Memory: m 0 0x500002db --rw-r--r-- root root m 72201 0xf75bff1 --rw-rw-rw- ciaouser head Semaphores: s 47710208 0xf75bff1 --ra-ra-ra- ciaouser head The important lines are those whose KEY values match that of the "Session Key" line from the $HOME/.ciao/ file. In this example that is 0xf75bff1 which means the lines m 72201 0xf75bff1 --rw-rw-rw- ciaouser head s 47710208 0xf75bff1 --ra-ra-ra- ciaouser head The UNIX ipcrm command can be used to remove these resources; the exact syntax depends on what system you are using, but for Solaris 2.8 you would say: unix% ipcrm -m 72201 -s 47710208 See Also
|
![]() |
The Chandra X-Ray
Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA. Email: cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2004. All rights reserved. |