Smd0 sends and receives data to/from EventBuilder cores. We can overlap these communications with two computation tasks (chunk building and message repacking.
Test setup
We used 16 smd files artificially generated for this test.
Test data: /cds/data/drpsrcf/users/monarin/xtcdata/10M16n/
Test code:
https://github.com/monarin/psana-nersc/blob/master/psana2/test_psana2_perf.py
https://github.com/monarin/psana-nersc/blob/master/psana2/run_slac.sh
Running the test (below shows 3 cores):
`which mpirun` -n 3 --hostfile openmpi_hosts --mca btl_openib_allow_ib 1 ./run_slac.sh
(ps-4.3.2) monarin@drp-srcf-eb003 (master *) psana2 $ cat openmpi_hosts
drp-srcf-eb003 slots=1
drp-srcf-eb011 slots=50
You'll need to update no. of eventbuilder cores in run_slac.sh to use more eventbuilder cores.
Blocking Performance
Below is the blocking MPI performance for a comparison with improvements seen in the following sections:
eb=1 | eb=2 | eb=4 | eb=8 | eb=16 | ||||||
TASK | total(ms) | #occurs | total(ms) | #occurs | total(ms) | #occurs | total(ms) | #occurs | total(ms) | #occurs |
SMD0GOTCHUNK | 2028.15 | 1086 | 2009.68 | 1086 | 1981.5 | 1086 | 1992.47 | 1086 | 1995.75 | 1086 |
SMD0GOTEB | 575.47 | 1087 | 45.39 | 1087 | 45.85 | 1087 | 45.11 | 1087 | 46.17 | 1087 |
SMD0GOTREPACK | 264.1 | 1087 | 298.13 | 1087 | 272.72 | 1087 | 298.47 | 1087 | 279.94 | 1087 |
SMD0DONEWITHEB | 3535.77 | 1087 | 5023.36 | 1087 | 4849.88 | 1087 | 4972.46 | 1087 | 4895.14 | 1087 |
SMD0GOTSTEPHIST | 64.02 | 1087 | 60.18 | 1087 | 63.05 | 1087 | 64.49 | 1087 | 69.19 | 1087 |
SMD0GOTSTEP | 85.66 | 1087 | 84.72 | 1087 | 86.01 | 1087 | 83.84 | 1087 | 86.55 | 1087 |
total: | 6553.16 | 6553.16 | 7521.47 | 7521.47 | 7299.01 | 7299.01 | 7456.84 | 7456.84 | 7372.74 | 7372.74 |
rate (MHz) | 1.53 | 1.33 | 1.37 | 1.34 | 1.36 |
Overlapping with Send
By replacing Send with Isend. We allow Smd0 to move on after initiating send command to an eventbuilder core. With this overlap, we see that the total wall time improves from 7.4 to 4.4 seconds with 16 eventbuilder cores.
eb=1 | eb=2 | eb=4 | eb=8 | eb=16 | ||||||
TASK | total(ms) | #occurs | total(ms) | #occurs | total(ms) | #occurs | total(ms) | #occurs | total(ms) | #occurs |
SMD0GOTCHUNK | 1995.07 | 1086 | 1993.69 | 1086 | 1975.4 | 1086 | 1964.6 | 1086 | 1983.13 | 1086 |
SMD0GOTEB | 5841.78 | 1087 | 2779.48 | 1087 | 1964.36 | 1087 | 1916.66 | 1087 | 1832.13 | 1087 |
SMD0GOTREPACK | 297.86 | 1087 | 258.33 | 1087 | 295.82 | 1087 | 306.37 | 1087 | 345.58 | 1087 |
SMD0DONEWITHEB | 57.76 | 1087 | 61.78 | 1087 | 62.37 | 1087 | 61.95 | 1087 | 60.76 | 1087 |
SMD0GOTSTEPHIST | 78.34 | 1087 | 85.66 | 1087 | 87.96 | 1087 | 80.87 | 1087 | 81.09 | 1087 |
SMD0GOTSTEP | 86.38 | 1087 | 89.5 | 1087 | 91.87 | 1087 | 89.96 | 1087 | 88.43 | 1087 |
total: | 8357.18 | 8357.18 | 5268.44 | 5268.44 | 4477.77 | 4477.77 | 4420.42 | 4420.42 | 4391.13 | 4391.13 |
rate (MHz) | 1.20 | 1.90 | 2.23 | 2.26 | 2.28 |
Conclusions/ Known Issues
We gain some performance by overlapping Send with other computation tasks.
In additional to overlapping send, we can also perform computational tasks while Smd0 wait for an eventbuilder core to come back (Irecv).