I have a long series of equations that looks something like this except with about 113 t's:
t1 = L1;
t2 = L2 + 5;
t3 = t2 + t1;
t4 = L3
...
t113 = t3 + t4
return t113;
Where L
's are input arguments.
It takes a really long time to calculate t113
. So I'm trying to split this up into several different threads in an attempt to make this quicker. Problem is I'm not sure how to do this. I tried drawing out the t's in the form of a tree by hand on paper so I could analyse it better, but it grew too large and unwieldy midway.
Are there other ways to make the calculations faster? Thanks.
EDIT: I'm using an 8 core DSP with SYS/BIOS. According to my predecessor, these inverse and forward kinematic equations will take the most time to process. My predecessor also knowingly chose this 8 core DSP as the hardware for implementation. So I'm assuming I should write the code in a way that takes advantage of all 8 cores.
With values that are dependent on other values, you're going to have a very tough time allocating the work to different threads. Then it's also likely that you'll have one thread waiting on another. And to fire off new threads is likely more expensive than calculating only 113 values.
Are you sure it's taking a long time to calculate t113? or is it something else that takes a long time.