Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

This document describes a possible software architecture for online physics applications for the LCLS. From the Requirements for High level Software Applications

High-level applications packages refers to the controls software used by physicists and
accelerator operators to:

  • tune or optimize the beam,
  • to keep the beam running stably in the optimized state,
  • monitor performance for long-term optimization
  • to diagnose problems with machine performance
  • detect, prioritize and notify of fault conditions

...

in the Linac Coherent Light Source. The LCLS is an electron particle accelerator and coherent x-ray laser being developed at Stanford University to study phenomena in the 1.5 - 15 Ångstrom, 1-230 femtosecond realm.

Author: Greg White, Dec 2005, Stanford Linear Accelerator Center. 

INDEX

  1. Objective
  2. Desktop
  3. Basic Modelling Environment
  4. Architecture
  5. Applications
  6. Matlab
  7. Error Handling, Logging and Viewing
  8. Tool Summary
  9. Red Flags
  10. Required Additions to SLC Control System
  11. Required Solutions
  12. Job List
  13. Questions
  14. R&D
  15. Details
  16. Glossary
  17. References

Anchor
obj
obj

OBJECTIVE

From the Requirements for High level Software Applications

High-level applications packages refers to the controls software used by physicists and
accelerator operators to:

  • tune or optimize the beam,
  • to keep the beam running stably in the optimized state,
  • monitor performance for long-term optimization
  • to diagnose problems with machine performance
  • detect, prioritize and notify of fault conditions

Here we outline the support for accelerator optics modeling in XAL, and in the exiting online SLC control system, and include recommendations for a technology track, the process for XAL modeling, how SLC and XAL modeling can be brought together to meet the commissioning schedule, and highlight issues that will require attention. It is assumed that both the SLC modeling environment and SCP applications will be replaced by XAL based equivalents over some period.
 

Anchor
dt
dt

DESKTOP

Our target desktop processors will be x86 CPUs running RedHat linux, with the GTK window system (see Details). The executables may be housed on either AFS or NFS filesystems (see Filesystem). Each user (including control room heads) additionally requires require their own configuration file area - therefore the precise configuration seen by each head may be unique therefore. This is a feature of XAL and the other desktop technologies we'll use. That configuration file area will be NFS because a long-lived executable (>25hrs - the AFS token lifetime) must be able to write to it at any time.

...

XAL (that is JFC/Swing) and SWT/Jface applications may be used on any X11 equipped workstation (Windows PC, Solaris) with some performance degradation because JFC/Swing performs poorly over X11 (even in Java >=1.4). These apps could be run "natively" on Windows (since Swing is pure Java, which is platform independent, and any SWT components could be delivered for Windows too). However, the added complexity of synchronizing filesystem resources between the Unix filesystem and the Windows filesystem probably makes this option undesirable - see Redflags. Hence, Proposal: no native Windows apps, Windows only over X.

...

  1. Eclipse external launching (EPICS displays, archive viewer, and MCC SCP are shown launched, but many are available: eg matlab, xterms, DECterms on MCC, Elog, Physics Log).
  2. Eclipse launching external VM java SWT/Jface application (jcmlog shown in bottom right)
  3. Eclipse launching internal VM java SWT/Jface application (aida probe shown bottom right)
  4. Eclipse launching external VM java JFC/Swing (XAL) application (NOT SHOWN YET)

...

In addition to the overall lattice modeling framework and interface to device control, XAL provides one GUI Application framework (based on JFC/Swing) (though not all XAL applications use this framework, even if they use JFC/Swing - #see ref_XAL_applications. All . All the existing XAL applications, using the aplication application framework or not, will be provided through "lips" such, such as Scan ("Correlation Plots"), SCORE ("configs"), XIO ("z-plots"), or just the XAL root application.

...

Additionally applications may be written which leverage the Eclipse Rich Client Platform, in which case they run in-process and in the same VM as Eclipse. A trivial example shown is the Aida probe shown in bottom left, which was started from the "Controls" menu. Such applications may be expected to run with better performing use interfaces (though there is some controversy over this point in the literature) and have native look and feel (as opposed to JFC/Swing apps that always have the Swing look and feel of the operating platform).

See also Application Framework Architecture

...

Use Case: A beamline physicist will provide MAD, Parmela or Elegant files (see #ref ref_latticefiles). Some designated person will update the Oracle DB with relevant information from these files, and run some process (presumably a SQL script) which outputs an XAL lattice input file in XML - the file containing the lattice description of the machine (See questions). Given this input lattice file, software in the XAL package library can then be used by applications to compute optics (Twiss, R-matrices, etc), which they can then use to calculate bumps, orbit corrections, beta-match settings etc.

...

For LCLS, we will pre-compute the optics from the lattice, to produce the XAL files which include the Twiss params, so each modeling application doesn't have to track a lattice for itself before starting. The online modeling "tracker" will be that in XAL (primarily in the gov.sns.xal.model package). The output of this phase will be the Twiss parameters of each element of the beamline. A second probe can calculate the transfer matrices (R-matrices). The Twiss param outputs will be captured in a series of second XAL files. There is presently no file-handling code in XAL for statically recording the R-matrices or global parameters (path length, energy, betamax), so new output files will be designed for that (either extending the XAL syntax, or creating some other XML file). proposal: write tracker to probe Twiss params and (coupled - see Red Flags) R-matrices, and additionally output global parameters to a file.

...

Non-XAL unix based applications in general (eg matlab) can also be developed ahead of the XAL modeling environment using Aida to get R-matrices and Twiss parameters etc from the SLC model environment.

Figure 3

Anchor
arch
arch

ARCHITECTURE

This section articulates the specific libraries, packages and programs that will be used to implement the LCLS high level applications.

...

As stated repeatedly elsewhere, the existing SLC applications, such as correlation plots, steering, bumps etc, can be used to access LCLS beamline orbit and control data. That is, SLC apps will work for LCLS. This is ensured by the "SLC-aware-IOC" project, in which VMS hosted SLC control system signals will be processed by field IOC's IOCs, and data returned in a manner transparent to the VMS SLC control system.

...

New applications however will use the architecture and tools described below.

Anchor
arch_apis
arch_apis

Application Data Flows

Data access and control will be via the following Application Programming Interfaces (APIs):

...

At the time of writing it has not been decided which new history data system to use in LCLS. The nominal EPICS archive protocol stack is given at left. Paul Chu reports reported that specific experiments in the SNS used PVlogger rather than EPICS archiver . The existing SLC history system is show at right; SLC history data can now be acquired by new applications or by matlab through Aida.where possible, but that the archiver is used as a general history facility. It's not clear whether performance questions related to the EPICS archiver are specific to the archive browser, or to data retrieval in general.

The nominal system would be that below. The EPICS archiver protocol stack is given at left. The existing SLC history system is show at right; SLC history data can now be acquired by new applications or by matlab through Aida.

Anchor
appframework
appframework

...

Proposal: develop new applications assuming JFC/Swing. If the first couple are not performing adequately, convert to SWT/Jface. Use Eclipse as a launching platform.

Anchor
apps
apps

APPLICATIONS

This section points out likely implementations of each of the applications as they are listed in Requirements for High level Software Applications.

...

Package

Implementation

"Steering"

Exists in SLC control System. An "Orbit Correction" package exists in XAL, but looks like it's more oriented towards global slow orbit correction than steering per se. Propose 1: use SLC steering and power steering for injection. 2. Develop in XAL, possibly based on XAL Orbit Correction. 3 Although PRDspecifies "...using a choice of algorithms...", propose that only SVD based orbit correction is implemented, possibly also Micado. Needs functional and systematic requirements, and evaluation of whether a full "power steering" is required, per the PRD.

Lattice Diagnostics

Presently not done brilliantly in SCP, but offline tools used like LOCO, MIA. Needs functional and systematic requirements, and comparison against existing tools in XAL, LOCO etc

...

Package

Implementation

Fast Feedback

Dealt with elsewhere

Configuration Control

Data Archiver

Exists in SLC for SLC devices ("History"). Data archiver for EPICS in LCLS is under discussion. Paul Chu reports that EPICS archiver itself considered too slow, so ; SNS experimenters use PVLogger . AIDA can presently acquire both when they can, but PVlogger is not an alternative archiver. AIDA can presently acquire both SLC and EPICS Archiver data. Propose: when LCLS EPICS archiver is decided, write AIDA server, and use EPICS Kasemir Channel Archive; improve Archive Browser performance; implement additions to browser so both sources can be accessed via AIDA. See Questions

Error Logging

See Error Handling, Logging and Viewing below

Watchdog

TOOL SUMMARY

This section summarises utilities that will be used to develop LCLS applications.

Tool

Function

x86 Linux RH, KDE/GTK-2 window system

(Native) Desktop O/S for applications. Note, Windows is NOT listed. As described in the architecture Windows clients will go through X11 See X11. x86 and GTK-2 specification is important so performance can be tuned.

Matlab

Ad-hoc analysis: acquiring data through aida, jca and XAL, performing computation and implementing results. Acquire hist data through Aida.
Physics Applications: apps may be implemented directly in Matlab using above tools, plus Accelerator Toolkit (AT) #inv_AT.

XAL

1) Modelling components (tracking); 2) OO device control, 3) Application framework, 4) Existing XAL applications.

Eclipse RPC

Integrated application launching. Rich Client Platform (RPC) for integrated applications shared with "EPICS Office" and gumtree.

Eclipse SWT/Jface

High performance Interactive Applications

XAL (JCA), AIDA (CORBA), JCA/CAJ

Data Interoperability. Getting and setting device data. Aida can also get history and model data to unix apps from the SLC control system.

Jcmlog, cmlog, Err

Error handling, logging and browsing. See error handling.

Cvs, make

Source repository and building. Distribution by simple "install" to an AFS or mounted NFS directory. See Filesystem. Note not ANT (question)

Oracle

Enterprise RDB. Stores the XAL geometry, and in architecture described here also the optics. Applications acquire optics from the db rather by tracking an XAL lattice at runtime.

OC4J or Jboss or Apache jakarta

Choose an Application Server. We're making heavy use of Oracle and XML, so displays based on contents of those datasources will go through an App server (AS). Pick one.

Java

Programming Language

Linux, Solaris

Server Hosts O/S

NFS

Production Host Filesystem? See Filesystem

AFS

Development Host Filesystem

Integrated Development Environments

Not a good idea to prescribe these for everyone. Three good open source choices for our technology stack are emacs+jdee, Netbeans (including matisse) and the Eclipse IDE. All three include CVS integration.

RED FLAGS

Some important choices or questions.

SLC CAMAC Magnet control and SLC BPM data acquisition by XAL Applications. The SLC CA server does not presently support "set" operations, so there is not presently a way for XAL applications, which use EPICS Ca through JCA, to change the value of CAMAC magents. Possible solutions are to add set to SLC CA, or to change XAL applications to use AIDA, or to accept that XAL applications can not control SLC CAMAC magnets - how bad is that (question). SLC BPM acquisition through JCA should also be verified, since the SLC BPM acqusition is oriented toward acquisitions of whole beamines.

...

Anchor
matlab
matlab

MATLAB

Matlab will provide a significant programming base for LCLS physics applications. We forsee that production level software may well be implemented in Matlab. Therefore we need data and control APIs to help users code applications in matlab, and support for error handling and message logging from Matlab m-file code.

Interfaces

The XAL, EPICS and AIDA java APIs can be used from inside matlab. That is, all the APIs listed in the Application Data Flows.

Infrastructure

Windows, and unix variants of Matlab will inevitably be used. However, Matlab is still ironing out the links in its Java support, so for production we have to control which versions of Matlab are officially "supported" for controls. Suggest starting with Matlab r14 SP2 - which is known to avoid problems with Orbacus assertions.

A "java.opts" file is required to parameterize Matlab's understanding of java, and this must be in the working directory of the user. So, if we permit Windows Matlab users, there must be a Windows filesystem home for java.opts.

Error handling and logging from Matlab

The Err package (see Error handling, viewing and Logging below)provides a very simple java based API for message logging suitable for Matlab. After making the appropriate entry in the JAVACLASSPATH so as to find the err.jar file, the following would issue a message to cmlog:

Code Block
titleError logging in matlab

err=Err.getInstance();
err.log("I got an error");

 

 

 

Anchor
eh
eh

ERROR HANDLING, LOGGING AND VIEWING

A programmer spends half their time handling errors, so making that as easy as possible is a productivity priority. For LCLS we will use the following technology stack:

Err package (see http://www.slac.stanford.edu/grp/cd/soft/err/) makes the process of rigorously handling errors easy. It allows a programmer to define an error code in a structured, recorded global way; and to use that code to issue errors and associated diagnostics from or linux, solaris, windows platforms in either java or C/C++, and issue them directly to CMLOG (or some other message logger). It includes support for exception chaining ("caused-by") and exception translation, so the end user can see what systematic thing caused their functional problem (E.g. of a error logged by Err in cmlog might be "UnableToTrackBeamlineException: LCLS ; caused by FileNotFoundException: LCLS.XML when attempting to steer LCLS".

Cmlog. cmlog is a message logger that can be used for error messages. It includes components for receiving messages to log from programs running on the network (either in hosts or IOCs), logging those errors in a database, and a viewer for browsing the logged messages.

jcmlog. jcmlog is a sophisticated error log viewer for CMLOG developed at SLAC recently for LCLS. It is in general much faster and smother than the nominal CMLOG viewer from Jlab and includes facilities for handling the particular requirements of Err (above) such as horizontal scroll for long messages.

Anchor
tools
tools

TOOL SUMMARY

This section summarises utilities that will be used to develop LCLS applications.

Tool

Function

x86 Linux RH, KDE/GTK-2 window system

(Native) Desktop O/S for applications. Note, Windows is NOT listed. As described in the architecture Windows clients will go through X11 See X11. x86 and GTK-2 specification is important so performance can be tuned.

Matlab

Ad-hoc analysis: acquiring data through aida, jca and XAL, performing computation and implementing results. Acquire hist data through Aida.
Physics Applications: apps may be implemented directly in Matlab using above tools, plus Accelerator Toolkit (AT) inv_AT.

XAL

1) Modelling components (tracking); 2) OO device control, 3) Application framework, 4) Existing XAL applications.

Eclipse RPC

Integrated application launching. Rich Client Platform (RPC) for integrated applications shared with "EPICS Office" and gumtree.

Eclipse SWT/Jface

High performance Interactive Applications

XAL (JCA), AIDA (CORBA), JCA/CAJ

Data Interoperability. Getting and setting device data. Aida can also get history and model data to unix apps from the SLC control system.

Jcmlog, cmlog, Err

Error handling, logging and browsing. See error handling.

Cvs, make

Source repository and building. Distribution by simple "install" to an AFS or mounted NFS directory. See Filesystem. Note not ANT (question)

Oracle

Enterprise RDB. Stores the XAL geometry, and in architecture described here also the optics. Applications acquire optics from the db rather by tracking an XAL lattice at runtime.

OC4J or Jboss or Apache jakarta

Choose an Application Server. We're making heavy use of Oracle and XML, so displays based on contents of those datasources will go through an App server (AS). Pick one.

Java

Programming Language

Linux, Solaris

Server Hosts O/S

NFS

Production Host Filesystem? See Filesystem

AFS

Development Host Filesystem

Integrated Development Environments

Not a good idea to prescribe these for everyone. Three good open source choices for our technology stack are emacs+jdee, Netbeans (including matisse) and the Eclipse IDE. All three include CVS integration.

Anchor
rfs
rfs

RED FLAGS

Some important choices or questions.

  1. *SLC CAMAC Magnet control and SLC BPM data acquisition by XAL Applications.*The SLC CA server does not presently support "set" operations, so there is not presently a way for XAL applications, which use EPICS Ca through JCA, to change the value of CAMAC magents. Possible solutions are to add set to SLC CA, or to change XAL applications to use AIDA, or to accept that XAL applications can not control SLC CAMAC magnets - that would be bad for orbit correction for instance, since most magnets in the linac will be SLC control system. Similarly, the SLC-aware-IOC and EPICS BPM acquisition API will allow both an XAL based application, or the SCP, to acquire IOC hosted BPMs, but are there "classical" SLC BPMs that must be acquirable by XAL applications.
  2. *XAL uses JFC/Swing - will that be too slow?*Have to evaluate the user interface GUI performance of XAL apps in different platform and network configs. In particular we propose to host apps only on Linux, which means many users will be displaying over ssh tunneled X11 to their PC using xwin32.
    Anchor
    WindowsFilesystem
    WindowsFilesystem
  3. Windows filesystem.
    If we do require native execution on Windows that decision should be made clearly and early, and resources assigned to implement the common executable and configuration file distribution so that Unix and Windows running applications are in sync and see the same configuration files. Java Web Start and Eclipse update site technology may be places to find solutions. Use of Matlab from Windows for instance requires some well known Windows filesystem home for the matlab support files.
    Anchor
    XAL_nocoupling
    XAL_nocoupling
  4. XAL Plane Coupled modeling.
    The existing XAL probes for calculating R-matrices, run on either the X-plane or Y-plane and returns only a 2x2 matrix for each element. That is, it's uncoupled. This is reflected in the fact that only the Twiss parameters can be stored into an XAL file - it only contains uncoupled optics. It may be that XAL is in fact tracking a plane coupled system, but only returning the X or Y plane block-matrices - need to verify. So, if plane coupled orbit correction is important for us, we need to verify what XAL is doing, add at least 4x4 probe API, also probably also 6x6 tracking.
  5. XAL Modelled acceleration and solenoid. XAL does not model acceleration completely, nor solenoid field see Questions
  6. Archiver. Which one?
  7. XAL file generation directly from Oracle. Is there a mechanism to flag items in the oracle db for inclusion in the lattice? Danger is people will edit the Oracle db to say move an item to a new z location or include a dummy bpm, and the lattice will change.
  8. Scripting. It may be that the requirement for user-level scripting of complex operator procedures is a requirement. Scripting user level procedures, for instance button-pushes on GUI applications, as opposed to control-system PVs, will be hard.
  9. Matlab. It's expensive and we may be highly reliant on it especially at first (see Questions).

Anchor
additions
additions

REQUIRED ADDITIONS TO SLC CONTROL SYSTEM

An LCLS model beamline, associated sectors and db additions in support of it, must be added.

SCP runtime problems on Linux fixed. At time of writing this includes a problem with dialog inputs, data has to be entered twice.

Pulse-id acquisition by Correlation Plots. Presently broken needs to be fixed.

Anchor
solutions
solutions

REQUIRED SOLUTIONS

This section lists functional components of the LCLS modeling applications architecture which for which we need to decide on a vendor:

  1. Numerical Analysis package, for matrix manipulation and linear algebra. Some classes of XAL extend JAMA 4, this may be sufficient.
  2. J2EE compliant Application Server. Application Servers include technology for accessing databases (eg oracle) and displaying information to the web. This will be useful for displaying static control data, model information and other slow control configs etc, to the web and to the Integrated Control Program. Suggest Apache Jakarta, plus PHP, Xerces, Xalan, etc.

Anchor
jl
jl

JOB LIST

Lists some jobs that might otherwise be forgotten.

  1. SQL script and other munging to get from Oracle db description of geometry and devices to a lattice description in an XAL input file.
  2. The XAL tracker. An XAL application which tracks the lattice and produces a 2nd XAL file containing the twiss parameters for each device, plus other per-element parameters.
  3. Add acceleration and solenoid elements to XAL.
  4. Check XAL's linear algebra support. Done: it uses JAMA -see ref.
  5. Create a Skills Matrix for applications, eg, XML and associated technologies (DOM, XSL etc), Oracle and associated technologies (SQL, PHP, persistence).

Anchor
qs
qs

QUESTIONS

This section lists outstanding questions. Questions that have been answered are listed below in Answered Questions.

Questions about requirements

  1. Anchor
    q_dbgeoonly
    q_dbgeoonly
    How complex is the conversion of Oracle DB to XAL lattice? Does the db contain enough to emit a lattice? Mark Woodley warns that there are probably many things necessary in the XAL lattice which need not be in the DB (marker points), and many things in the DB which should not be in the lattice. This latter class includes things like dummy BPMs, so not simply the case that everything of a given class should be in the lattice. People change the z of things in the DB. May be a good idea to have a "Skeleton" XAL file (maybe processed by xsl/php).
  2. Anchor
    kmodtobdes
    kmodtobdes
    Verify there is no "KMOD to BDES" requirement?
    1. That is, is there a Lattice Diagnostics requirement for online applications, and a need to keep magnet "fudge factors"?
    2. Which XAL applications allow one to update the EPICs magnet k-values after a successful model run?
  3. Does XAL really not model acceleration? If not how is it useful for SNS?
  4. Verify that XAL does not model a plane coupled system.
  5. How long does XAL take to parse an XAL beamline? It has to build a DOM tree, which can't be negligible. Since that is a requirement of every XAL application at initialization its an important performance bottleneck.
  6. Anchor
    q_xalacc
    q_xalacc
    Is XAL's modeling of acceleration adequate? We (greg and Diane) have decided to answer this by writing an XAL beamline description, tracking it, and comparing to MAD output.
  7. Is XAL's existing treatment of solenoids adequate? I think (greg) there are 2 solenoids in the beamline, both in the injector so they're needed early in commissioning, but both set to zero in MAD deck so far!
  8. Anchor
    q_numbeamlines
    q_numbeamlines
    How many beamline descriptions should there be?
  9. What is the canonical list of XAL physics apps?
  10. Is there are requirement for the Wolski parameters? Since longitudinal phase advance is important to LCLS do we need to add a Wolski parameter probe to XAL? Should Wolski params be pre-computed and put in the db as we shall for Twiss and R-mats?
  11. Does LCLS need SVD based orbit minimization? Is there an orbit minimization in XAL?
  12. Are we going to offer user-level scripting for automating complex procedures such as "turning on the Injector" (per Galayda)? see R&D scripting.
  13. Anchor
    q_slchist
    q_slchist
    Will SLC history data be streamed to the EPICS archiver and then turned off? This depends on whether there is an adequate viewer.

Questions about "Systems"

  1. Anchor
    verifyAFSclient
    verifyAFSclient
    Verify AFS client for Windows is not workable. If an AFS client for
  2. Anchor
    bestWindowsX11
    bestWindowsX11
    Find best performing Windows X11 server for JFC/Swing clients.
  3. Anchor
    q_matlab
    q_matlab
    (Steph) How many matlab licenses will be needed? Shoudl we use a Group license. Who will pay? What matlab features will be needed? Who will be responsibe for administration of Matlab?

Anchor
rnd
rnd

R&D

This section outlines some constrained R&D we should do to check architecture decisions.

Matlab

Anchor
inv_at
inv_at

Accelerator Toolkit (AT)

See what applications are available in Accelerator Toolkit (AT). Use of matlab for applications depends on desirability of the functionality offered, responsiveness of the application in the context of a large accelerator's operations, and importantly, ability to secure licensing with manageable cost/benefit.

Specifically: Do AT applications appear to offer support for configurations necessary in a large machine (e.g. choosing from available bpms and correctors in an orbit correction package). How does it handle errors? Are bpm statuses communicated to the user interface and graphics?

Matlab Plotting

Can Matlab be used as a general purpose charting engine? This would be very much more desirable than XAL's charting if having charted the data for a plot one could easily "drop into matlab" to further analyse the data just plotted.

Anchor
inv_fs
inv_fs

Filesystem and distributing software releases

Should the production executables (XAL java jar files etc) and configuration files be on AFS or NFS? Operative points in the question are that both XAL and Eclipse require that the user specify a "workspace" at startup, which defines their particular configuration. This workspace must always be writable, so AFS token expiry after 25 hrs use, can be problematic. Simplest solution is makefile "install" to a mounted NFS directory - but that directory has to be accessible by all head nodes (that is, all linux desktops running the applications).

Eclipse includes two software distribution mechanisms: first requires "pull" (the user initiates the update), 2nd is Java Web Start, which checks for updates at predefined intervals.

Anchor
scripting
scripting

Scripting

Are we going to attempt to provide a scripting interface to the applications themselves? Clearly one can "script" EPICS and AIDA data exchanges, from say matlab, but this kind of scripting does not include canned user-level procedures as offered through the applications' APIs because the applications themselves include a lot of code which will not be available through the EPICS/AIDA interfaces. User level GUI scripting may be possible by direct interface to X11.

Anchor
details
details

DETAILS

This section gives details behind architectural statements made above.

Anchor
dh
dh

Why so definite about x86 Linux RH with KDE/GTK-2?

To create a high performance user interface we should lock down the desktop hardware. We can support more than one such configuration, such as x86 Windows and x86 Linux with GTK, but for high performance UIs we need to build for specific desktops, so we have to know what they will be a-priori. Eg, when building SWT/Jface apps, one has to target a gives set of desktops so the appropriate libraries can be included in the build.

NAMES

Light relief - what are we going to call this system?

LIPS LCLS integrated physics system
SIPS SLAC integrated/interactive physics system
iSCP Integrated SLAC Control System
SOMA SLAC online modeling applications.

Anchor
glossary
glossary

TECHNOLOGY GLOSSARY

  1. Oracle: The enterprise db contains static data on devices and their beamline geometry.
  2. XAL: Existing software which contains a lattice tracker, java bean classes for programs to deal with accelerator devices in an object oriented way, and code for building GUI applications based on Swing.
  3. XML (see references): A computer language for writing files containing structured data. XML is used by XAL as the language of its input model files. Data in XML is trivially transformed via XSL into other forms, such as HTML for easy display on the web, or other XML files suitable for other programs or putting into a db.
  4. AIDA (Accelerator Independent Data Access), a Java API to EPICS Channel Access, SLC database device data, BPM and magnet data and control, EPICS and SLC history data, SLC modeling data.
  5. Err - a platform and language independent (java & c++) error handling framework for creating and logging error messages.
  6. global message: error or warning text message typically going to some log like cmlog, and viewed by a user through a browser like cmlog browser. A global message is on generated by a front-end computer or an application that thinks it's worth telling the world about. compare to local message
  7. local message: a message generated by an application that is intended only for viewing by the application's user at that time. Eg "0 is not a permitted number of iterations to average bpm readings".

Anchor
refs
refs

REFERENCES

  1. XAL http://www.sns.gov/APGroup/appProg/xal/xal.htm
  2. XML entry in Wikipedia http://en.wikipedia.org/wiki/XML
  3. Anchor
    ref_latticefiles
    ref_latticefiles
    LCLS lattice files http://www-ssrl.slac.stanford.edu/lcls/linac/optics/
  4. JAMA http://math.nist.gov/javanumerics/jama/
  5. Anchor
    ref_XAL_applications
    ref_XAL_applications
    http://www.diamond.ac.uk/CMSWeb/Downloads/diamond/Events/EPICS/XAL_Applications_Correlator_Framework.pdf

Anchor
answers
answers

ANSWERED QUESTIONS

This section lists questions that have been answered since the birth of this document.

  1. Acquisition through JCA should also be verified, since the SLC BPM acqusition is oriented toward acquisitions of whole beamines and is highly parameterized.
    ANS: Diane (posted by Greg): the EPICS BPM API will largely mirror the SLC BPM API in that it will be oriented toward acquisitions of beamlines and allows specification of timing parameters. Greg: That's ok then as long as the setup required in an application is invariant whether it's talking to an SLC BPM through the SLCCAS (and if there is any requirement in LCLS apps to talk to SLC BPMs(question)) or a new IOC hosted BPM.
  2. Does XAL offer matrix manipulation, linear algebra and fitting adequate for the LCLS? Ans: yes, uses JAMA.

To add to this document

Anchor
td_GW
td_GW

Add gold lattice to optics flowchart diagram
More on History/archiving
More on correlation plots

Basic Architecture FAQ

Desktop

x86 Linux RH, KDE/GTK window system. Apps will run on the desktop host (not over X11). Control room heads will simply be an example of this, ie locally on a kiosk or sunray (running linux/GTK). Windows later; Mac later. Apps can be run over X11 onto Windows and Mac in offices (with some performance degradation).

Frameworks

Eclipse Rich Client Platform (RPC) and XAL applications. Therefore mixing Eclipse (SWT/Jface) and XAL (AWT/Swing). Control System Studio Eclipse plugins will be used as they mature.

Modelling

4 phases: 1) for BC-1 use SLC model system, data retrieved over AIDA; 2) MAD twiss/R-mats persisted to Oracle db, applications and ad-hoc physicists apps in Matlab use AIDA to retrieve optics; 3) XAL, twiss/R-mats persisted to Oracle, existing XAL apps use XAL files, new XAL apps we write use Oracle; 4) As 3, but XAL input file is generated from Oracle device list.

Databases

Oracle, SLACPROD for "prod", SLACDEV FOR "dev". Program access by jdbc, AIDA, hibernate.

Applications Servers (for web based applcations)

3 Application servers: 1) Oracle APEX (aka Application Express, aka ORAWEB) for items managed by the LCLS Database team; 2) tomcat, for physics elog, and other web applications.

Display and Plot generation.

Textual displays defined by xml data + css (Casscading Style Sheet) producing xhtml rendered by browser in Eclipse.

Plotting by GnuPlot v4, or possibly JAS. The last data plotted will be immediately available in an octave window.

Help

By Eclipse help system.

Error handling

err.stanford.slac java package. errors issued to cmlog db. Default browser will be jcmlog.

XAL Modelled acceleration and solenoid. XAL does not model acceleration nor solenoid field

Archiver. Which one?

XAL file generation directly from Oracle. Is there a mechanism to flag items in the oracle db for inclusion in the lattice? Danger is people will edit the Oracle db to say move an item to a new z location or include a dummy bpm, and the lattice will change.

REQUIRED ADDITIONS TO SLC CONTROL SYSTEM

An LCLS model beamline, associated sectors and db additions in support of it, must be added.

SCP runtime problems on Linux fixed. At time of writing this includes a problem with dialog inputs, data has to be entered twice.

Pulse-id acquisition by Correlation Plots. Presently broken needs to be fixed.

REQUIRED SOLUTIONS

This section lists functional components of the LCLS modeling applications architecture which for which we need to decide on a vendor:

  1. Numerical Analysis package, for matrix manipulation and linear algebra. Some classes of XAL extend JAMA 4, this may be sufficient.
  2. J2EE compliant Application Server. Application Servers include technology for accessing databases (eg oracle) and displaying information to the web. This will be useful for displaying static control data, model information and other slow control configs etc, to the web and to the Integrated Control Program. Suggest Apache Jakarta, plus PHP, Xerces, Xalan, etc.

JOB LIST

Lists some jobs that might otherwise be forgotten.

  1. SQL script and other munging to get from Oracle db description of geometry and devices to a lattice description in an XAL input file.
  2. The XAL tracker. An XAL application which tracks the lattice and produces a 2nd XAL file containing the twiss parameters for each device, plus other per-element parameters.
  3. Add acceleration and solenoid elements to XAL.
  4. Check XAL's linear algebra support. Done: it uses JAMA -see ref.
  5. Create a Skills Matrix for applications, eg, XML and associated technologies (DOM, XSL etc), Oracle and associated technologies (SQL, PHP, persistence).

QUESTIONS

...

  1. That is, is there a Lattice Diagnostics requirement for online applications, and a need to keep magnet "fudge factors"?
  2. Which XAL applications allow one to update the EPICs magnet k-values after a successful model run?

...

R&D

This section outlines some constrained R&D we should do to check architecture decisions.

Matlab

...

Accelerator Toolkit (AT)

See what applications are available in Accelerator Toolkit (AT). Use of matlab for applications depends on desirability of the functionality offered, responsiveness of the application in the context of a large accelerator's operations, and importantly, ability to secure licensing with manageable cost/benefit.

Specifically: Do AT applications appear to offer support for configurations necessary in a large machine (e.g. choosing from available bpms and correctors in an orbit correction package). How does it handle errors? Are bpm statuses communicated to the user interface and graphics?

Matlab Plotting

Can Matlab be used as a general purpose charting engine? This would be very much more desirable than XAL's charting if having charted the data for a plot one could easily "drop into matlab" to further analyse the data just plotted.

...

Filesystem and distributing software releases

Should the production executables (XAL java jar files etc) and configuration files be on AFS or NFS? Operative points in the question are that both XAL and Eclipse require that the user specify a "workspace" at startup, which defines their particular configuration. This workspace must always be writable, so AFS token expiry after 25 hrs use, can be problematic. Simplest solution is makefile "install" to a mounted NFS directory - but that directory has to be accessible by all head nodes (that is, all linux desktops running the applications).

Eclipse includes two software distribution mechanisms: first requires "pull" (the user initiates the update), 2nd is Java Web Start, which checks for updates at predefined intervals.

DETAILS

This section gives details behind architectural statements made above.

...

Why so definite about x86 Linux RH with KDE/GTK-2?

To create a high performance user interface we should lock down the desktop hardware. We can support more than one such configuration, such as x86 Windows and x86 Linux with GTK, but for high performance UIs we need to build for specific desktops, so we have to know what they will be a-priori. Eg, when building SWT/Jface apps, one has to target a gives set of desktops so the appropriate libraries can be included in the build.

...

ERROR HANDLING, LOGGING AND VIEWING

A programmer spends half their time handling errors, so making that as easy as possible is a productivity priority. For LCLS we will use the following technology stack:

Err package (see http://www.slac.stanford.edu/grp/cd/soft/err/Image Removed) makes the process of rigorously handling errors easy. It allows a programmer to define an error code in a structured, recorded global way; and to use that code to issue errors and associated diagnostics from or linux, solaris, windows platforms in either java or C/C++, and issue them directly to CMLOG (or some other message logger). It includes support for exception chaining ("caused-by") and exception translation, so the end user can see what systematic thing caused their functional problem (E.g. of a error logged by Err in cmlog might be "UnableToTrackBeamlineException: LCLS ; caused by FileNotFoundException: LCLS.XML when attempting to steer LCLS".

Cmlog. cmlog is a message logger that can be used for error messages. It includes components for receiving messages to log from programs running on the network (either in hosts or IOCs), logging those errors in a database, and a viewer for browsing the logged messages.

jcmlog. jcmlog is a sophisticated error log viewer for CMLOG developed at SLAC recently for LCLS. It is in general much faster and smother than the nominal CMLOG viewer from Jlab and includes facilities for handling the particular requirements of Err (above) such as horizontal scroll for long messages.

NAMES

Light relief - what are we going to call this system?

LIPS LCLS integrated physics system
SIPS SLAC integrated/interactive physics system
iSCP Integrated SLAC Control System
SOMA SLAC online modeling applications.

TECHNOLOGY GLOSSARY

  1. Oracle: The enterprise db contains static data on devices and their beamline geometry.
  2. XAL: Existing software which contains a lattice tracker, java bean classes for programs to deal with accelerator devices in an object oriented way, and code for building GUI applications based on Swing.
  3. XML (see references): A computer language for writing files containing structured data. XML is used by XAL as the language of its input model files. Data in XML is trivially transformed via XSL into other forms, such as HTML for easy display on the web, or other XML files suitable for other programs or putting into a db.
  4. AIDA (Accelerator Independent Data Access), a Java API to EPICS Channel Access, SLC database device data, BPM and magnet data and control, EPICS and SLC history data, SLC modeling data.
  5. Err - a platform and language independent (java & c++) error handling framework for creating and logging error messages.
  6. global message: error or warning text message typically going to some log like cmlog, and viewed by a user through a browser like cmlog browser. A global message is on generated by a front-end computer or an application that thinks it's worth telling the world about. compare to local message
  7. local message: a message generated by an application that is intended only for viewing by the application's user at that time. Eg "0 is not a permitted number of iterations to average bpm readings".

REFERENCES

...

To add to this document
Anchortd_GWtd_GW Add gold lattice to optics flowchart diagram
More on History/archiving
More on correlation plots