Versions Compared

Key

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

...

psana2 scripts can be run in real-time on shared memory.  Look at the DAQ .cnf file to see what the name of the node is running the shared memory server.  You can find the name of the shared memory (hutch name is typically used) either by looking on the .cnf file (the "-P" option to monReqServer executable) or doing a command like this:

...

For this output, you would use "DataSource(shmem='tmo')".

Note that one can develop the shared memory scripts (including real-time plots) using offline data, then change the DataSource line to run them in real-time.

Typically psmon is used for publishing results to realtime plots in the callback, publishing updates every "N" events.  See this link for psmon examples: Visualization Tools.

It is straightforward to write a script that runs on one core.  When running multi-core with mpi one has to use the small data "callbacks" kwarg to receive the data When running with mpi there are some complexities propagating the environment to remote nodes: the way to address that is described in this link.  The same parallelization model is used as for the production of the small hdf5 files described here.  The typical pattern would be to use the small data callback to receive all the data in a dictionary gathered from all nodes, as shown in this line from the example here.:  

Code Block
smd = ds.smalldata(batch_size=5, callbacks=[my_smalldata])

It is also necessary to have one core reserved to do the gathering, so have you need a line like this this:

Code Block
os.environ['PS_SRV_NODES']='1'

Typically psmon is used for publishing results to realtime plots in the callback: Visualization Tools.When running multi-node mpi there are also some complexities propagating the environment to remote nodes: the way to address that is described in this link.  

Running in LIVE mode

Here's a sample python script, how you can config datasource to run in live mode:

...