Csound Csound-dev Csound-tekno Search About

[Cs-dev] What remains in ParCS

Date2010-08-22 23:09
FromMichael Gogins
Subject[Cs-dev] What remains in ParCS
The ParCS branch is now yielding useful performance gains for Csound
on multicore computers. On a 4 core Intel machine, I obtain speedups
of 2 times over a single thread at 1000 ksmps, and of about 1.5 times
at 100 ksmps.

I found that the pthreads spinlocks that I introduced, in addition to
speeding up Csound a bit more, also introduced clicks into the output
soundfile. This means the pthreads spinlocks are not really working,
as they are in exactly the same places as the previous locks. I have
left the pthreads spinlock code in place but modified SConstruct so
that it will not be built. The previous locks, either pthreads mutexes
or interlocked exchange spinlocks, are used instead.

It has become clear that the ParCS implementation of multithreading is
preferable to the head branch implementation because (a) it protects
global variables and (b) it is faster at smaller values of ksmps.

What remains to be done before this branch -- which also includes and
requires the new parser -- is merged back into the head branch and
becomes the default for Csound?

One thing is that all opcodes and API calls that risk read/write
operations from multiple threads to shared data need to be protected
using locks. What else needs to be done?

Does the ParCS code need reset or cleanup code to be finished?

Does the parser itself really work now? What things are missing or
buggy? ParCS has been rendering xanadu.csd and CloudStrata.csd but
failing wth trapped.csd.

My next step is to debug the failure with trapped.csd

-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-08-25 12:32
Fromjohn ffitch
SubjectRe: [Cs-dev] What remains in ParCS
> What remains to be done before this branch -- which also includes and
> requires the new parser -- is merged back into the head branch and
> becomes the default for Csound?
> 
> One thing is that all opcodes and API calls that risk read/write
> operations from multiple threads to shared data need to be protected
> using locks. What else needs to be done?

there need to be locks in the ZAK and table writing code.  I am not
sure that the analysis deals with these cases either.
> 
> Does the ParCS code need reset or cleanup code to be finished?
> 

Most of that is there.  There a few statics that need encapsulation.
I have been simplifying the code a bit for easier maintenence.

> Does the parser itself really work now? What things are missing or
> buggy? ParCS has been rendering xanadu.csd and CloudStrata.csd but
> failing wth trapped.csd.

The parser is missing (a?b:c) and i think that is all, but Steven may
have other things.

The trapped thing is, I think, a case that was not considered when all
remaining work depends on one instr that is not yet finished when a
thread seeks work, and finds that there is work but i cannot be found
as there is no root yet.  I changed to code to treat that case a "try
again" and the crashes ceased but there is a better way -- just not
found it.

==John ffitch

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-08-25 13:20
FromVictor Lazzarini
SubjectRe: [Cs-dev] What remains in ParCS
I noticed that

if .... then
endif

does not work either.

Victor
On 25 Aug 2010, at 12:32, john ffitch wrote:

>>
>> Does the parser itself really work now? What things are missing or
>> buggy? ParCS has been rendering xanadu.csd and CloudStrata.csd but
>> failing wth trapped.csd.
>
> The parser is missing (a?b:c) and i think that is all, but Steven may
> have other things.


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-08-25 13:26
FromMichael Gogins
SubjectRe: [Cs-dev] What remains in ParCS
Maybe (?:) doesn't work because if..then..endif doesn't work?

Mike

On Wed, Aug 25, 2010 at 8:20 AM, Victor Lazzarini
 wrote:
> I noticed that
>
> if .... then
> endif
>
> does not work either.
>
> Victor
> On 25 Aug 2010, at 12:32, john ffitch wrote:
>
>>>
>>> Does the parser itself really work now? What things are missing or
>>> buggy? ParCS has been rendering xanadu.csd and CloudStrata.csd but
>>> failing wth trapped.csd.
>>
>> The parser is missing (a?b:c) and i think that is all, but Steven may
>> have other things.
>
>
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users
> worldwide. Take advantage of special opportunities to increase revenue and
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
> _______________________________________________
> 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

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-08-25 13:27
FromMichael Gogins
SubjectRe: [Cs-dev] What remains in ParCS
For that matter, are we sure that (?:) doesn't work in the current code?

Regards,
Mike

On Wed, Aug 25, 2010 at 8:26 AM, Michael Gogins
 wrote:
> Maybe (?:) doesn't work because if..then..endif doesn't work?
>
> Mike
>
> On Wed, Aug 25, 2010 at 8:20 AM, Victor Lazzarini
>  wrote:
>> I noticed that
>>
>> if .... then
>> endif
>>
>> does not work either.
>>
>> Victor
>> On 25 Aug 2010, at 12:32, john ffitch wrote:
>>
>>>>
>>>> Does the parser itself really work now? What things are missing or
>>>> buggy? ParCS has been rendering xanadu.csd and CloudStrata.csd but
>>>> failing wth trapped.csd.
>>>
>>> The parser is missing (a?b:c) and i think that is all, but Steven may
>>> have other things.
>>
>>
>> ------------------------------------------------------------------------------
>> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
>> Be part of this innovative community and reach millions of netbook users
>> worldwide. Take advantage of special opportunities to increase revenue and
>> speed time-to-market. Join now, and jumpstart your future.
>> http://p.sf.net/sfu/intel-atom-d2d
>> _______________________________________________
>> 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

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-08-25 13:29
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] What remains in ParCS
Sure; there is no attempot to expand.  Only recently parsed correctly.  Do
not think it is related to if..then..endif

I have concentrated on ParCS rather than th eparse -- hoped that Steven
might have time....

Only 10 days left this summer

> For that matter, are we sure that (?:) doesn't work in the current code?
>
> Regards,
> Mike
>
> On Wed, Aug 25, 2010 at 8:26 AM, Michael Gogins
>  wrote:
>> Maybe (?:) doesn't work because if..then..endif doesn't work?
>>
>> Mike
>>
>> On Wed, Aug 25, 2010 at 8:20 AM, Victor Lazzarini
>>  wrote:
>>> I noticed that
>>>
>>> if .... then
>>> endif
>>>
>>> does not work either.
>>>
>>> Victor
>>> On 25 Aug 2010, at 12:32, john ffitch wrote:
>>>
>>>>>
>>>>> Does the parser itself really work now? What things are missing or
>>>>> buggy? ParCS has been rendering xanadu.csd and CloudStrata.csd but
>>>>> failing wth trapped.csd.
>>>>
>>>> The parser is missing (a?b:c) and i think that is all, but Steven may
>>>> have other things.
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
>>> Be part of this innovative community and reach millions of netbook
>>> users
>>> worldwide. Take advantage of special opportunities to increase revenue
>>> and
>>> speed time-to-market. Join now, and jumpstart your future.
>>> http://p.sf.net/sfu/intel-atom-d2d
>>> _______________________________________________
>>> 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
>
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users
> worldwide. Take advantage of special opportunities to increase revenue and
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>



------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-08-25 16:20
FromSteven Yi
SubjectRe: [Cs-dev] What remains in ParCS
Apologies, I really do wish I had time to work on this.  I've been a
bit unfocused with a lot of work responsibilities as of late, and my
free time has been going into the CMake build (which then makes it a
lot easier for me to spend time programming on Csound).  Even that I
haven't been able to put in as much time as I'd like, though luckily
Felipe has done fantastic work there.

I have to dig out my notes on what I remembered from the parser, but
the one key one was what Victor pointed out in that no optimization is
currently done. The old parser does some constant in-lining I believe.
 That makes me think that we'll actually have even better speedup with
ParCS once that is complete.

On Wed, Aug 25, 2010 at 8:29 AM,   wrote:
> Sure; there is no attempot to expand.  Only recently parsed correctly.  Do
> not think it is related to if..then..endif
>
> I have concentrated on ParCS rather than th eparse -- hoped that Steven
> might have time....
>
> Only 10 days left this summer
>
>> For that matter, are we sure that (?:) doesn't work in the current code?
>>
>> Regards,
>> Mike
>>
>> On Wed, Aug 25, 2010 at 8:26 AM, Michael Gogins
>>  wrote:
>>> Maybe (?:) doesn't work because if..then..endif doesn't work?
>>>
>>> Mike
>>>
>>> On Wed, Aug 25, 2010 at 8:20 AM, Victor Lazzarini
>>>  wrote:
>>>> I noticed that
>>>>
>>>> if .... then
>>>> endif
>>>>
>>>> does not work either.
>>>>
>>>> Victor
>>>> On 25 Aug 2010, at 12:32, john ffitch wrote:
>>>>
>>>>>>
>>>>>> Does the parser itself really work now? What things are missing or
>>>>>> buggy? ParCS has been rendering xanadu.csd and CloudStrata.csd but
>>>>>> failing wth trapped.csd.
>>>>>
>>>>> The parser is missing (a?b:c) and i think that is all, but Steven may
>>>>> have other things.
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
>>>> Be part of this innovative community and reach millions of netbook
>>>> users
>>>> worldwide. Take advantage of special opportunities to increase revenue
>>>> and
>>>> speed time-to-market. Join now, and jumpstart your future.
>>>> http://p.sf.net/sfu/intel-atom-d2d
>>>> _______________________________________________
>>>> 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
>>
>> ------------------------------------------------------------------------------
>> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
>> Be part of this innovative community and reach millions of netbook users
>> worldwide. Take advantage of special opportunities to increase revenue and
>> speed time-to-market. Join now, and jumpstart your future.
>> http://p.sf.net/sfu/intel-atom-d2d
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>
>
>
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users
> worldwide. Take advantage of special opportunities to increase revenue and
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-08-25 17:36
FromVictor Lazzarini
SubjectRe: [Cs-dev] What remains in ParCS
But recently I don't see much difference in timings old-parser vs. new- 
parser. Just checked with trapped now and
the difference is very small (3.6s vs 3.8s).

Victor
On 25 Aug 2010, at 16:20, Steven Yi wrote:

> Apologies, I really do wish I had time to work on this.  I've been a
> bit unfocused with a lot of work responsibilities as of late, and my
> free time has been going into the CMake build (which then makes it a
> lot easier for me to spend time programming on Csound).  Even that I
> haven't been able to put in as much time as I'd like, though luckily
> Felipe has done fantastic work there.
>
> I have to dig out my notes on what I remembered from the parser, but
> the one key one was what Victor pointed out in that no optimization is
> currently done. The old parser does some constant in-lining I believe.
> That makes me think that we'll actually have even better speedup with
> ParCS once that is complete.
>
> On Wed, Aug 25, 2010 at 8:29 AM,   wrote:
>> Sure; there is no attempot to expand.  Only recently parsed  
>> correctly.  Do
>> not think it is related to if..then..endif
>>
>> I have concentrated on ParCS rather than th eparse -- hoped that  
>> Steven
>> might have time....
>>
>> Only 10 days left this summer
>>
>>> For that matter, are we sure that (?:) doesn't work in the current  
>>> code?
>>>
>>> Regards,
>>> Mike
>>>
>>> On Wed, Aug 25, 2010 at 8:26 AM, Michael Gogins
>>>  wrote:
>>>> Maybe (?:) doesn't work because if..then..endif doesn't work?
>>>>
>>>> Mike
>>>>
>>>> On Wed, Aug 25, 2010 at 8:20 AM, Victor Lazzarini
>>>>  wrote:
>>>>> I noticed that
>>>>>
>>>>> if .... then
>>>>> endif
>>>>>
>>>>> does not work either.
>>>>>
>>>>> Victor
>>>>> On 25 Aug 2010, at 12:32, john ffitch wrote:
>>>>>
>>>>>>>
>>>>>>> Does the parser itself really work now? What things are  
>>>>>>> missing or
>>>>>>> buggy? ParCS has been rendering xanadu.csd and CloudStrata.csd  
>>>>>>> but
>>>>>>> failing wth trapped.csd.
>>>>>>
>>>>>> The parser is missing (a?b:c) and i think that is all, but  
>>>>>> Steven may
>>>>>> have other things.
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Sell apps to millions through the Intel(R) Atom(Tm) Developer  
>>>>> Program
>>>>> Be part of this innovative community and reach millions of netbook
>>>>> users
>>>>> worldwide. Take advantage of special opportunities to increase  
>>>>> revenue
>>>>> and
>>>>> speed time-to-market. Join now, and jumpstart your future.
>>>>> http://p.sf.net/sfu/intel-atom-d2d
>>>>> _______________________________________________
>>>>> 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
>>>
>>> ------------------------------------------------------------------------------
>>> Sell apps to millions through the Intel(R) Atom(Tm) Developer  
>>> Program
>>> Be part of this innovative community and reach millions of netbook  
>>> users
>>> worldwide. Take advantage of special opportunities to increase  
>>> revenue and
>>> speed time-to-market. Join now, and jumpstart your future.
>>> http://p.sf.net/sfu/intel-atom-d2d
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>>
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
>> Be part of this innovative community and reach millions of netbook  
>> users
>> worldwide. Take advantage of special opportunities to increase  
>> revenue and
>> speed time-to-market. Join now, and jumpstart your future.
>> http://p.sf.net/sfu/intel-atom-d2d
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook  
> users
> worldwide. Take advantage of special opportunities to increase  
> revenue and
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-08-31 16:28
Fromjohn ffitch
SubjectRe: [Cs-dev] What remains in ParCS
I have had a rework and addition in the area of if..then..endif and I
think some cases work in the new parser now, but I still have oddities
I do not understand.  In particular the implied goto statements should
sometimes be igoto, sometime kgoto and sometimes goto.  How does one
decide?

I do not ever use this construction so I am not sure exactly what it
should do in all cases.  I would appreciate some testing of the code
in CVS at present, and reports on what works and what does not.

ie elseif constructions, missing else clauses etc etc

==John ffitch

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-08-31 16:43
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] What remains in ParCS
Firts odd example; I do not understand the results from



-n



sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
  ; Get the note value from the fourth p-field.
  knote = p4
kcps = 440

  ; Does the user want a low note?
  if (knote == 0) then
    kcps = 220
  endif

  ; Create the note.
  kamp init 25000
printk 1.5, kcps,
  ifn = 1
  a1 oscili kamp, kcps, ifn

  out a1
endin





; Table #1, a sine wave.
f 1 0 16384 10 1

; p4: 0=low note, 1=middle note, 2=high note.
; Play Instrument #1 for one second, low note.
i 1 0 1 0
; Play Instrument #1 for one second, middle note.
i 1 1 1 1
; Play Instrument #1 for one second, high note.
i 1 2 1 2
e



------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net