| Why not? I do not advocate porting all of Csound to C++, certainly not
the working opcodes. I am talking about the "engine."
At any rate, even if we choose not to port the "engine" to C++, it
would still be possible to compile it with the C++ compiler, and use
the TBB where that makes sense.
Regards,
Mike
On 5/28/09, victor wrote:
> I am not in favour of moving the code to C++.
>
> Victor
> ----- Original Message -----
> From: "Michael Gogins"
> To: "Developer discussions"
> Sent: Thursday, May 28, 2009 4:22 PM
> Subject: Re: [Cs-dev] parallel processing panel at ICMC
>
>
>>I should add, the main difference between OpenMP and TBB is that
>> OpenMP tries to sneak itself into the C++ language, but TBB assumes
>> you are writing in standard C++ and that you will parallelize your
>> work by writing classes that encapsulate logically independent tasks
>> and the data they require.
>>
>> Quite frankly, in my considered judgment the best way to get Csound up
>> to speed (literally) is to rewrite it in C++, use the TBB collections
>> for tables and lists, parallelize the kperf loop and perhaps some
>> selected opcodes (oscillator banks etc.), and put spinlocks on all the
>> API calls that opcodes use. We would then be done and light years
>> ahead of other synthesizers -- especially on 4 or more cores. I
>> estimate this is a few man-months of work.
>>
>> As I have suggested in the past, rewriting Csound in C++ is not so
>> hard; we would turn the CSOUND struct into a class and the existing
>> low-level API calls and "engine" functions that take a CSOUND pointer
>> into member functions of this class, then replace existing arrays and
>> lists with TBB collections.
>>
>> Later, once OpenMP is supported by all compilers, it would make sense
>> to use OpenMP to parallelize important opcodes.
>>
>> People ended up mostly following my advice on the Csound API... though
>> it took long enough.
>>
>> Please, listen to what I am saying. I don't like to toot my own horn,
>> but I also hate to see wasted effort. This advice is pure gold.
>>
>> It would work, it would make Csound parallel, it would not be too much
>> work, and it would have a side effect of making Csound actually
>> simpler and easier to maintain.
>>
>> I don't know if my advice would work with the parser code, or with
>> John ffitch's prototype for parallelizing Csound.
>>
>> Regards,
>> Mike
>>
>>
>> On 5/28/09, Michael Gogins wrote:
>>> It is different, not better. In theory, I would prefer OpenMP because
>>> it becomes part of the language, part of the compiler, and the loop
>>> pragmas can of course be used for higher level loops as well as for
>>> inner loops.
>>>
>>> However, TBB offers thread-safe collections and global synchronization
>>> primitives and functions. I feel that this stuff is very valuable. It
>>> is hard to get right if you have to do it yourself. So in practice, I
>>> might end up preferring TBB. But I do not have experience with both so
>>> cannot yet say.
>>>
>>> Regarding pthreads, TBB uses and wraps pthreads or Windows threads.
>>>
>>> Regards,
>>> Mike
>>>
>>> On 5/28/09, victor wrote:
>>>> Is it better than OpenMP or a pthread approach?
>>>> ----- Original Message -----
>>>> From: "Michael Gogins"
>>>> To: "Developer discussions"
>>>> Sent: Thursday, May 28, 2009 3:55 PM
>>>> Subject: Re: [Cs-dev] parallel processing panel at ICMC
>>>>
>>>>
>>>>> Point taken.
>>>>>
>>>>> BTW, it now seems that Intel Threading Building Blocks (TBB) is
>>>>> supported to some extent on MinGW, so it can be considered available
>>>>> for Csound, at least on Windows and Linux. So TBB would be appropriate
>>>>> for parallelizing the kperf loop, and for supplying thread-safe
>>>>> collections and function locks.
>>>>>
>>>>> TBB can do function locks both with pthreads and with spinlocks.
>>>>>
>>>>> Regards,
>>>>> Mike
>>>>>
>>>>> On 5/28/09, victor wrote:
>>>>>> Not really, some of their results demonstrated that even some
>>>>>> typically parallel algorithms were slower in parallel than
>>>>>> single-thread
>>>>>> implementations, which I can only attribute to grain size.
>>>>>>
>>>>>> Victor
>>>>>> ----- Original Message -----
>>>>>> From: "Michael Gogins"
>>>>>> To: "Developer discussions"
>>>>>> Sent: Thursday, May 28, 2009 1:40 PM
>>>>>> Subject: Re: [Cs-dev] parallel processing panel at ICMC
>>>>>>
>>>>>>
>>>>>>>I would only assume that the Faust level of parallelization is too
>>>>>>> fine-grained if experiments demonstrated that coarser grained
>>>>>>> parallelization of the same algorithms run faster.
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>>>>>> is a gathering of tech-side developers & brand creativity
>>>>>> professionals.
>>>>>> Meet
>>>>>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>>>>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>>>>> Barbarian
>>>>>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Michael Gogins
>>>>> Irreducible Productions
>>>>> http://www.michael-gogins.com
>>>>> Michael dot Gogins at gmail dot com
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>>>>> is a gathering of tech-side developers & brand creativity
>>>>> professionals.
>>>>> Meet
>>>>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>>>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>>>> Barbarian
>>>>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>>>> is a gathering of tech-side developers & brand creativity professionals.
>>>> Meet
>>>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>>> Barbarian
>>>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>
>>>
>>> --
>>> Michael Gogins
>>> Irreducible Productions
>>> http://www.michael-gogins.com
>>> Michael dot Gogins at gmail dot com
>>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>> ------------------------------------------------------------------------------
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>> is a gathering of tech-side developers & brand creativity professionals.
>> Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>> iPhoneDevCamp as they present alongside digital heavyweights like
>> Barbarian
>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals.
> Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |