Versions Compared

Key

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

...

Before describing how to accumulate events in AMI, it is important to understand the architecture of AMI, which consists of workers, local collectors, a global collector, a manager, and a client processes that run on different compute nodes.

NOTE: Any node which follows a global operation will only run on the global collector and so does not currently scale to multiple cores.  To avoid performance issues try to keep these operations lightweight.

The client assembles a graph which is pushed to the manager that then distributes it to the workers and collectors for execution. Nodes in the graph are "colored" worker, localCollector, and globalCollector. Each type of process is responsible for executing a subgraph of nodes of the appropriate color (ie workers execute nodes with the color worker, and similarly for the local collector and global collector). Events in AMI are distributed to workers by Psana. AMI provides different types of graph nodes for accumulating events across this distributed architecture. Nodes which accumulate events are called global operations and GUI graph nodes are expanded into 3 underlying graph nodes of the same type but with different colors.

Gliffy Diagram
size1200
displayNameAMI processes
nameAMI processes
pagePin2

...

Global Operations

...

Commonly Used By Users

Average0D, Average1D, Average2D

...

...

These global operations are typically used internally by AMI:

  • Accumulator, Pick1, PickN, ReduceByKey, RollingBuffer

Any node which follows a global operation will only run on the global collector.

Average0D, Average1D, Average2D

Will average event data either over an infinite time ("infinite" checked in configuration) or a settable finite number of events (generated internally using the SumN pattern).  For the finite case be careful not to set N too large as it can consume a lot of memory.  The PickN produces an array of numbers/1D-arrays/2D-arrays which are, respectively, 1D/2D/3D arrays (with "time" being the added dimension).  AMI allows you to average over any of those axes, but users will typically want to average over axis=0 ("time"), unless you want to see an average projection (axis=1 or 2) vs. time.

...

MeanVsScan, MeanWaveformVsScan

...

Global Operations Used Internally By AMI

PickN

Use-case summary: Use PickN when you need to gather a precise number of events from multiple workers.  It is unusual for users to directly use this pattern: it is typically only used internally by AMI.  The ami graph output will update only when N events have been collected.  Note that there is some arithmetic rounding depending on the number of events requested and the number of workers running parallel.  This pattern (and RollingBuffer, below) are similar.

...