forum.alglib.net
http://forum.alglib.net/

Multithreaded support not available?
http://forum.alglib.net/viewtopic.php?f=2&t=595
Page 1 of 1

Author:  optiongeek [ Tue Jul 03, 2012 5:38 pm ]
Post subject:  Multithreaded support not available?

I would like to spread a computationally large problem that is relying on the cholesky decomposition method, as well as some matrix multiplications across multiple cores, but within a single process. However, I noticed that what runs pretty fast on a two-core box seemingly has no performance boost when run on a 48-core box. I read something on Wikipedia that alglib doesn't provide support for multithreaded applications. Is this what I'm running into here? Do I need to spin up a new process for each core (ick!) if I want this to scale with the number of cores?

Author:  Sergey.Bochkanov [ Wed Jul 04, 2012 1:16 pm ]
Post subject:  Re: Multithreaded support not available?

Unfortunately, current version of ALGLIB does not support multicore features. We've planned to introduce such support in upcoming 3.6.0 (will be released within 1-2 days), but looks like it should wait for the second half of 2012.

Author:  optiongeek [ Thu Jul 05, 2012 12:55 pm ]
Post subject:  Re: Multithreaded support not available?

I'm not sure I understand exactly what you mean. Specifically, I'm using the Parallel class in C# to split up a matrix computation across multiple cores. The Parallel class iterates through a list of work items, spinning off separate threads, one per available core, to perform the target code on that work item.

I would expect my computation to scale almost linearly since I've been careful to eliminate sources of potential thread blocking.
Is there something in the alglib library that will prevent this design from scaling as I would expect? I don't really need to take advantage of any "multiple core support" - I just want to make sure that matrix operations occuring on separate, independent objects in separate threads are going to be truly independent.

Author:  Sergey.Bochkanov [ Thu Jul 05, 2012 1:48 pm ]
Post subject:  Re: Multithreaded support not available?

Now I understand you. I've told about built-in support for parallel computations, i.e. ability to split Cholesky decomposition of single large matrix to several cores. Such ability is not present in ALGLIB yet.

You talk about ability to run independent tasks in parallel, with tasks manually spawned by you. ALGLIB is 100% compatible with such usage pattern, so theoretically you should have x24 speed up (when compared with 2-core system). I do not know why it is not the case.

Maybe, .NET framework is incapable to efficiently spread computations between so many cores? Or you have very small problems (say, Cholesky of 10x10 matrix) so parallelization overhead is comparable with problem solution cost?

Can you test your parallelization framework with some dummy code (say, empty loop with 10^9 iterations)? Do you have x24 speedup in this case? I want to understand whether it is connected with the fact that your parallel code calls ALGLIB, or this issue is present with any code, ALGLIB-dependent or not.

Author:  optiongeek [ Thu Jul 05, 2012 3:43 pm ]
Post subject:  Re: Multithreaded support not available?

Thanks - I found the problem - I had failed to resolve a dependency on a normal inverse calculation that was being shared by all the tasks. I'm now watching 48 cores hum away and blazing through my computation. Thanks for confirming that my design is compatible with alglib.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/