Versions Compared

Key

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

...

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 clients can send to the master when something "interesting" happensdesired).  To see this example, copy the following four files from /reg/g/psdm/tutorials/examplePython/: client.py, master.py, hitdatampidata.py (code that defines data to be shared), mpi_driver.py (parses arguments and decides to run master/client, as appropriate).

...

Code Block
mpirun -n 2 python mpi_driver.py exp=xpptut15:run=54 cspad -n 10

The user should only modify client.py/master.py.  The information to be transmitted from client to master is defined by these two lines in client.py:

Code Block
md.addarray('img',img)
md.small.intensity = intensity

The first line adds an array to be transmitted to the master, the second line adds "small data", which can be any simple python object (if the data is large, you should convert it to a numpy array and use "addarray" instead).  You can add as many lines like this as you like.