In the previous parallelization examples, all the cores have been analyzing data identically. Another useful but somewhat more complex pattern is to have MPI clients intermittently sending updates to one master process that manages data visualization and storage.
The idea here is to have two different pieces of code (client/master) that exchange data via MPI send/recv calls (used in such a way that any client can send to the master). To see this example, copy the following four files from /reg/g/psdm/tutorials/examplePython/: client.py, master.py, hitdata.py (code that defines data to be shared), mpi_driver.py (parses arguments and decides to run master/client, as appropriate).
This code can be run with the following command, analyzing our usual tutorial data experiment with the detector named "cspad":
mpirun -n 2 python mpi_driver.py exp=xpptut15:run=54 cspad -n 10