I’m encountering an issue with my MATLAB R2019b GUI project. I’m trying to display two sets of 4DCT (Four-Dimensional Computed Tomography) images simultaneously. Each set contains 10 CT volumes. While displaying the first case(two sets), I want to asynchronously load additional sets in the background. My approach involves using parfeval(@select_data, x, data{idx}) for each 4DCT, where select_data is a function utilizing parfor to read the 10 DICOM volumes.
When I run select_data independently, it performs well, utilizing all available workers efficiently (e.g., 12 workers). However, when I use parfeval, only one additional worker is utilized, leading to slower loading times (about 30-40 seconds per 4DCT). Also it causes lag in the main thread, even though I expect multiple workers to be employed for the loading process and the rest available for my main.
Here are the server specs I have access to:
CPU(s): 24
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 2
Memory: 70GB
I’ve attempted to limit the number of workers to 8 in the parpool, leaving 4 cores free to handle the main GUI thread, but the lag persists.
It’s possible that the issue lies with the usage of parfor within parfeval, which might not be leveraging all available workers as expected?
Any insights or suggestions on how to optimize this process would be greatly appreciated.
Thank you!
max_hid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.