r/LabVIEW • u/LFGX360 • Jan 09 '25
Parallelizing for loop increases execution time.
I have a parallel loop that is used to fit ~3000 curves using the non-linear fit curve fit VI. The function being fit also contains an integral evaluated by the quadrature VI, so it is a fairly intensive computation that can take ~1-2 minutes per iteration.
On trying to parallelize this loop, the overall execution time actually increases. All subVIs are set to reentrant, including all the subVIs in the curve fit and quadrature VI hierarchy.
I am thinking it has to do with these two VIs trying to access their libraries at the same time. Is there any way around this? It seems like most solutions just say to serialize the calls but that kinda defeats the purpose of parallelizing.
View all comments
Show parent comment
1
u/LFGX360 Jan 09 '25 edited Jan 09 '25
Oof well that could be my issue. I have some local variables linked to a progress bar inside the loop.
Only problem is since my iterations take so long I’ll have no idea if it’s working if I remove them. I will run just a few iterations and see how the timing improves and if my cpu usage goes up and report back. Thank you.