To help users run simulations with Pelegant more efficiently, we would like to introduce our parallelization approach briefly. We parallelize elegant using a master/slaves (manager/workers) model. The time-intensive tracking parts of elegant are being parallelized gradually. The other parts are done (redundantly) by all the processors, which is acceptable since those processors have already been allocated to a particular Pelegant run. We divide the beamline elements into four classes:
A flag was added to elegant's dictionary for each beamline element to identify its classification. The master is responsible for gathering and scattering particles as needed according to this classification. Communications are minimized to achieve the best efficiency of parallelization. For example, it is not necessary to communicate the coordinates of particles between master and slaves when tracking through two continuous parallel elements. Similarly, we only need to gather particle coordinates from slaves to master (without subsequent scattering) when the particles go through a diagnostic element, such as a WATCH point with coordinate output.