Algorithms: cgels vs. manual implementation

Algorithms: cgels vs. manual implementation

I'm currently working on a project that uses a linear least squares approach to calculate weights for 'n' packets of data. After embedding and testing both the manual and cgels routines I found the manual version to calculate the answer ~57% more quickly for 'n' packets.

The manual version involves many inverses, conjugations, and normlization (all done with the MKL libraries) so I assumed it wouldn't be as quick as the cgels routine. What could be causing this loss in efficiency? My first ideas were constant reallocation memory and error checking, but I'd rather get a second opinion before I finalize the project.

Example:

Applying weights to 750 packets of data in real time (20 seconds). When using the manual routine, the time elapsed is ~11.026 seconds. When using the cgels routine the time is ~17.312 seconds, putting the computation time (+~5 seconds) over the 20 second time interval.

Thank you for your time. Any feedback is appreciated.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

>>...After embedding and testing both the manual and cgels routines I found the manual version to calculate
>>the answer ~57% more quickly for 'n' packets.

Thanks for the report ( really interesting ) and I think many of us will be glad to verify your results. Even if MKL functions are very optimized and universal ( support many instruction sets ) there is a possibility that a smarter solution was implemented in some project in some algorithm. Please provide additional technical details.

Leave a Comment

Please sign in to add a comment. Not a member? Join today