forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 11:20 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Multithreaded support not available?
PostPosted: Tue Jul 03, 2012 5:38 pm 
Offline

Joined: Tue Jul 03, 2012 5:30 pm
Posts: 3
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?


Top
 Profile  
 
 Post subject: Re: Multithreaded support not available?
PostPosted: Wed Jul 04, 2012 1:16 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
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.


Top
 Profile  
 
 Post subject: Re: Multithreaded support not available?
PostPosted: Thu Jul 05, 2012 12:55 pm 
Offline

Joined: Tue Jul 03, 2012 5:30 pm
Posts: 3
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.


Top
 Profile  
 
 Post subject: Re: Multithreaded support not available?
PostPosted: Thu Jul 05, 2012 1:48 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
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.


Top
 Profile  
 
 Post subject: Re: Multithreaded support not available?
PostPosted: Thu Jul 05, 2012 3:43 pm 
Offline

Joined: Tue Jul 03, 2012 5:30 pm
Posts: 3
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 35 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group