You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Current »

Because critical experimental decisions must be made while an LCLS experiment is in progress, it is important to be able to analyze your data while it is being taken.  The DAQ supports an online GUI that can handle common tasks that is called AMI.  However, often this is not specialized enough for particular experiments.  To handle this case, psana-python allows you to run your analysis code while data is being taken in two different ways, using MPI-parallelization for performance.

Real-Time Analysis Using "DAQ Small Data"

This approach (supported for data after October 2015) is simplest, but has the disadvantage that it is not guaranteed to be able to keep up with the data (but in most cases it does when using MPI as shown in the example here).  It requires using 3 extra keywords when constructing your DataSource:

ds = DataSource('exp=xpptut15:run=54:smd:dir=/reg/d/ffb/xpp/xpptut15/xtc:live')
  • "smd" means use the DAQ small data, as used in many of the psana-python examples (in particular the MPI example here)
  • the "dir=" argument tells the analysis code to use a special set of disks (fast-feedback, or "FFB") reserved for the running experiment
  • the "live" argument tells the analysis code to wait for additional data in case the analysis "catches up" to the DAQ

This analysis can be submitted to the batch system as usual, but should use either psnehhiprioq/psfehhiprioq batch queue (only when your experiment is actively running) as described here .

Real-Time Analysis Using "Shared Memory"

This approach is somewhat more complex, but is guaranteed to analyze only "recent" events coming from the DAQ network (no disks involved, so it's fast!).  It has the disadvantage that it is not guaranteed to analyze every event in a run.  This approach is best when you need guaranteed real-time feedback, e.g. for tuning experiment/accelerator settings based on real-time plots.  To use this mode, create a DataSource object this like:

ds = DataSource('shmem=psana.0:stop=no')

Jobs in the shared memory doesn't know what the experiment is, so calibration directory needs to be specified like this (where "exp" is an experiment name like "xpptut15"):

calibDir = '/reg/d/psdm/cxi/%s/calib' % exp
setOption('psana.calib-dir', calibDir)

There are other complications starting the code and gathering results from the MPI processes.  You must use the data gathering pattern here.  It is important not to use MPI collective operations like reduce/gather/bcast etc. during the event loop,  this can cause software hangs.  Contact the analysis group or your hutch Point Of Contact if you wish to use this mode.  

  • No labels