Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  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

...

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. Anchoreheh

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:

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 belowprovides 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
title"Error 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 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".

...

  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.
    Anchor
    WindowsFilesystem
    WindowsFilesystem
  2. 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
  3. 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.
  4. XAL Modelled acceleration and solenoid. XAL does not model acceleration completely, nor solenoid field (see Questions|#q_xalacc]
  5. Archiver. Which one?
  6. 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.
  7. Scripting. It may be that the requirement for user-level scripting of complex operator procedures is a requirement that should not be minimized.
  8. Matlab. It's expensive and we may be highly reliant on it especially at first.

...

  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.Does XAL offer matrix manipulation, linear algebra and fitting adequate for the LCLS? Ans: yes, uses JAMA.
  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-matsWhat is the canonical list of XAL physics apps?
  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.

...

  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.

...

  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