PyWolf is an open-source software with a graphical user interface that performs numerical simulations of the cross-spectral density function propagation of planar sources using parallel computation through PyOpenCL. In the previous versions of PyWolf, the user could select the OpenCL devices and platforms to perform the parallel computations on several tasks, except for that related to the two-dimensional (2D) fast Fourier transform (FFT) algorithm. The latter task can have a large computation time since one has to perform a large amount of 2D FFTs over 2D slices of a four-dimensional array. The option of using multithread-based computation on these loops and other tasks can be an advantage for multi-core CPUs and can significantly decrease the computation time. Here, I present version 3.0.0 of PyWolf, which adds a multithreading option to be used for the 2D FFT computations. This multithreading option can also be easily implemented in other time-consuming tasks. New version program summaryProgram Title: PyWolfCPC Library link to program files:https://doi.org/10.17632/frjscxypkd.3Developer's repository link:https://github.com/tiagoecmagalhaes/PyWolfLicensing provisions: GPLv3Programming language: PythonSupplementary material: Overview of the main changes with performance results.Journal reference of previous version: Comput. Phys. Commun. 294 (2024) 108899.Reasons for the new version: In the original paper of PyWolf [1] and in the previous version [2], parallel computation was performed only using PyOpenCL. However, in some cases where multiple cores are available in the CPU, multithreading [3] can significantly decrease the computation time of some tasks, for instance, the loops of 2D fast Fourier transforms (FFTs). This new version includes a built-in option for multithreading, enabling users to select the number of threads to be used in the numerical simulation.Summary of revisions: Multithreading support was added to PyWolf and users can now select this feature in PyWolf's graphical user interface and choose the number of available threads to be used in the simulation. In the current version, multithreading is only used for the loops of 2D FFTs but can be easily extended to other tasks. Other small features have been added and some issues have been corrected, namely: (i) a requirements file has been added listing all the libraries used; (ii) some errors associated with file paths have been corrected.Nature of problem: Propagation of partially coherent light from planar sources in the Fresnel or far field approximations using four-dimensional arrays [4,5] demands large memory and computation time. PyWolf uses PyOpenCL to perform parallel computation to reduce time-consuming calculations in the propagation of the cross-spectral density function [4], restricting the memory capacity as the main limitation.Solution method: The open-source toolkit PyOpenCL along with multithreading is used to decrease the computation time. Users can modify and add more features to PyWolf, such as source, propagation, and geometrical models. Custom-made optical components can also be added (e.g., lenses and apertures). The PyQt5-based graphical user interface enables users to easily set the input parameters to simulate their optical setup, plot and export the simulated results, and save or load the simulation session.
Read full abstract