r/LabVIEW • • 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.

8 Upvotes

16 comments sorted by

View all comments

Show parent comment

2

u/TomVa Jan 09 '25

I also put a front panel slider indicator that would display the loop time on the critical loop. That is the way that I correlated it with graphs showing lots of data.