A little success story...
Hi,
I just wanted to report on a little success story.
In the recent few months, I have been working on a new project that concerns itself with parallel programming. For that purpose, I experimented with variations of a home-grown work-stealing scheduler. (See http://en.wikipedia.org/wiki/Cilk#Work-stealing for a description of what work stealing is.) The development platform is LispWorks 6.0, which comes with an excellent library for SMP. (I would say it's the best of any dynamic language I am currently aware of, not just those of Lisp dialects.)
Performance matters in parallel programming. The benchmark application was a structured grid computation, like is for example used for computing heat equations, for running game of life, or for similar applications. This is easy to parallelize, because each processor can perform part of the computation on a sub-grid independently of all the other processors.
The hardware that I ran the experiments on is a 4x 6-core Intel Xeon "Dunnington" 2.67 GHz running Ubuntu.
For 200 iterations on a 4096x4096 matrix of single float values, I got the following runtimes:
- with 8 cores ca. 19-20 secs.
- with 16 cores ca. 9-10 secs.
- with 24 cores ca. 8 secs.
The same experiment was also implemented by others in our group in the following languages: Unified Parallel C, Cilk++, C with MPI, OpenMP, and C++ with Threading Building Blocks. They all have slight variations in runtime, but all roughly in the same ballpark. The runtimes were:
- with 8 cores ca. 10-11 secs.
- with 16 cores ca. 8-10 secs.
- with 24 cores ca. 8-10 secs.
The advantage of using Common Lisp is that I could still use higher-order constructs (closures) and have a pretty decent separation of concerns in the software architecture, while still getting very good efficiency. Of course, this required some pretty low-level tricks with type and optimization declarations in several places, but the nice thing about Common Lisp is that you don't have to be low-level right from the start, and only at the places that you identify as bottlenecks.
Unfortunately, I cannot present a lot more details at this stage, because most of this is covered by an NDA. I hope, though, that I can make the work-stealing scheduler available as an open source library at some later stage.
Pascal
--
Pascal Costanza, mailto:pc-99OXBJU6cIpeoWH0uzbU5w@public.gmane.org, http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium
Re: A little success story...
On 24 Jan 2011, at 09:37, Yakov Zaytsev wrote:
> Pascal, could you please also try your code with open-source free Lisp
> implementations and give the numbers? :-)
I'm currently focusing on making everything work well on LispWorks before considering porting to other CL implementations. That's in general a good approach: First make things work well in one CL implementation, and worry about portability later. Portability is quite easy to achieve at a late stage with Lisp, but may distract you too much from the important concepts initially.
Pascal
> On Mon, Jan 24, 2011 at 1:04 AM, Juan Jose Garcia-Ripoll
> <juanjose.garciaripoll-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
>> On Fri, Jan 21, 2011 at 9:07 PM, Pascal Costanza <pc-99OXBJU6cIpeoWH0uzbU5w@public.gmane.org> wrote:
>>>
>>> The development platform is LispWorks 6.0, which comes with an excellent
>>> library for SMP. (I would say it's the best of any dynamic language I am
>>> currently aware of, not just those of Lisp dialects.)
>>
>> I would be interested on learning what aspects of LispWorks make it
>> interesting for SMP, specially if some of those ideas can be adapted to ECL.
>> Does their library provide a better granularity when controlling threads
>> than C? Is it the inter-process communication?
>> Juanjo
>>
>> --
>> Instituto de Física Fundamental, CSIC
>> c/ Serrano, 113b, Madrid 28006 (Spain)
>> http://juanjose.garciaripoll.googlepages.com
>>
>> _______________________________________________
>> pro mailing list
>> pro-F1HGIaG5STRyXAeb93iumQ@public.gmane.org
>> http://common-lisp.net/cgi-bin/mailman/listinfo/pro
>>
>>
--
Pascal Costanza, mailto:pc-99OXBJU6cIpeoWH0uzbU5w@public.gmane.org, http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium