Multi threading

View: New views
8 Messages — Rating Filter:   Alert me  

Multi threading

by Michael Gogins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I thought there was a problem running multiple threads in Csound when there are odd numbers of instrument instances, but I don't see it.

Could somebody remind me what the problem was, or email an orchestra/score that reproduce it?

If there isn't a problem, we're good to go after I protect tables and channels.

Regards,
Mike



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Re: Multi threading

by Steven Yi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't know about the odd number instances, but we definitely need to
redo goto's as well as the opcodes are linked in a single-linked list
and only can find labels by using the global CURREVT (I think that's
the name) for the currently processed note, which won't work.  (Just
wanted to remind of that.)

On Tue, Aug 12, 2008 at 6:31 PM, Michael Gogins <gogins@...> wrote:

> I thought there was a problem running multiple threads in Csound when there are odd numbers of instrument instances, but I don't see it.
>
> Could somebody remind me what the problem was, or email an orchestra/score that reproduce it?
>
> If there isn't a problem, we're good to go after I protect tables and channels.
>
> Regards,
> Mike
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@...
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Re: Multi threading

by Felipe Sateler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

El 12/08/08 21:31 Michael Gogins escribió:
> I thought there was a problem running multiple threads in Csound when there
> are odd numbers of instrument instances, but I don't see it.
>
> Could somebody remind me what the problem was, or email an orchestra/score
> that reproduce it?
>
> If there isn't a problem, we're good to go after I protect tables and
> channels.

It doesn't work on my linux box, as I've already said a few times. I still
haven't found what the problem is.

Saludos,
Felipe Sateler


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

signature.asc (204 bytes) Download Attachment

Parent Message unknown Re: Multi threading

by Michael Gogins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Would it work to have one list, but each instance has a thread number? Each thread can just skip the instances that don't belong to it. That might save time in allocating instances to threads too.

Does this make any sense?

Regards,
Mike

-----Original Message-----

>From: Steven Yi <stevenyi@...>
>Sent: Aug 12, 2008 9:34 PM
>To: Michael Gogins <gogins@...>, Developer discussions <csound-devel@...>
>Cc: Csound <csound@...>
>Subject: Re: [Cs-dev] Multi threading
>
>I don't know about the odd number instances, but we definitely need to
>redo goto's as well as the opcodes are linked in a single-linked list
>and only can find labels by using the global CURREVT (I think that's
>the name) for the currently processed note, which won't work.  (Just
>wanted to remind of that.)
>
>On Tue, Aug 12, 2008 at 6:31 PM, Michael Gogins <gogins@...> wrote:
>> I thought there was a problem running multiple threads in Csound when there are odd numbers of instrument instances, but I don't see it.
>>
>> Could somebody remind me what the problem was, or email an orchestra/score that reproduce it?
>>
>> If there isn't a problem, we're good to go after I protect tables and channels.
>>
>> Regards,
>> Mike
>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@...
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
>-------------------------------------------------------------------------
>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>Build the coolest Linux based applications with Moblin SDK & win great prizes
>Grand prize is a trip for two to an Open Source event anywhere in the world
>http://moblin-contest.org/redirect.php?banner_id=100&url=/
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@...
>https://lists.sourceforge.net/lists/listinfo/csound-devel




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Parent Message unknown Re: Multi threading

by Michael Gogins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could you please post your orc/sco or csd?

Regards,
Mike

-----Original Message-----

>From: Felipe Sateler <fsateler@...>
>Sent: Aug 12, 2008 9:41 PM
>To: Developer discussions <csound-devel@...>
>Subject: Re: [Cs-dev] Multi threading
>
>El 12/08/08 21:31 Michael Gogins escribió:
>> I thought there was a problem running multiple threads in Csound when there
>> are odd numbers of instrument instances, but I don't see it.
>>
>> Could somebody remind me what the problem was, or email an orchestra/score
>> that reproduce it?
>>
>> If there isn't a problem, we're good to go after I protect tables and
>> channels.
>
>It doesn't work on my linux box, as I've already said a few times. I still
>haven't found what the problem is.
>
>Saludos,
>Felipe Sateler




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Re: Multi threading

by Felipe Sateler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

El 12/08/08 21:50 Michael Gogins escribió:
> Could you please post your orc/sco or csd?

I've been trying one you supplied me before for debugging, mt.csd. I'm
attaching it in case you deleted it.
Note that I haven't been able to use multithreading with any csd I've tried.

In case you don't remember, I get a deadlock after this:

% ./csound --num-threads=2 mt.csd
time resolution is 1000.000 ns
PortAudio real-time audio module for Csound
0dBFS level = 32768.0
Csound version 5.08.91 beta (float samples) Aug 12 2008
libsndfile-1.0.17
Reading options from $HOME/.csoundrc
UnifiedCSD:  mt.csd
STARTING FILE
Creating options
Creating orchestra
Creating score
orchname:  /tmp/fileTS9hgD.orc
scorename: /tmp/filebXVwiI.sco
rtaudio: PortAudio module enabled ... using blocking interface
orch compiler:
32 lines read
        instr   1
        instr   2
Elapsed time at end of orchestra compile: real: 0.043s, CPU: 0.000s
sorting score ...
        ... done
Elapsed time at end of score sort: real: 0.043s, CPU: 0.000s
Multithread performance: insno:  -1  thread -1 of 2 starting.
Multithread performance: insno:  -1  thread -1 of 2 starting.
Csound version 5.08.91 beta (float samples) Aug 10 2008
displays suppressed
0dBFS level = 100000.0
orch now loaded
audio buffered in 256 sample-frame blocks
writing 1024-byte blks of floats to mt.wav (WAV)
SECTION 1:
ftable 1:
new alloc for instr 1:
new alloc for instr 1:
new alloc for instr 1:
new alloc for instr 1:
>>> I have to kill csound here



Saludos,
Felipe Sateler

<CsoundSynthesizer>
<CsOptions>
--num-threads=2 -m135 -RWfo mt.wav
</CsOptions>
<CsInstruments>
sr              =           44100
ksmps           =           1000
nchnls          =           1
0dbfs           =           100000

; Instrument #1 - a basic FM waveform.
instr 1
  kamp = 10000
  kcps = 80
  kcar = 2.01
  kmod = 2
  kndx = 20
  ifn = 1

  a1 foscil kamp, kcps, kcar, kmod, kndx, ifn
  out a1
endin

; Instrument #2 - the basic FM waveform with extra interpolation.
instr 2
  iamp = 10000
  icps = 80
  icar = 2.01
  imod = 2
  indx = 20
  ifn = 1

  a1 foscili iamp, icps, icar, imod, indx, ifn
  out a1
endin


</CsInstruments>
<CsScore>

; Table #1, a sine wave table with a small amount of data.
f 1 0 65536 10 1

i 1 0 200
i 1 0 200
i 1 0 200
i 1 0 200

i 2 3 200
i 2 3 200
i 2 3 200
i 2 3 200
i 2 3 200
e
</CsScore>
</CsoundSynthesizer>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

signature.asc (204 bytes) Download Attachment

Re: Multi threading

by Steven Yi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm not sure that would work.  It has to do not with the chain of note
instances so much as the chain of opcodes, which labels are inserted
into....

Hmm... actually, I might very well be all wrong about this!  I just
looked at OOps/goto_ops.c and there is no use of currevt.  currevt
however is used in OOps/schedule.c and OOps/str_ops.c, and that will
need to be redone so as not to require that.  (also found in
Opcodes/nlfit.c, Opcodes/pitch0.c, Opcodes/scansynx.c, and some files
in Engine).



On Tue, Aug 12, 2008 at 6:49 PM, Michael Gogins <gogins@...> wrote:

> Would it work to have one list, but each instance has a thread number? Each thread can just skip the instances that don't belong to it. That might save time in allocating instances to threads too.
>
> Does this make any sense?
>
> Regards,
> Mike
>
> -----Original Message-----
>>From: Steven Yi <stevenyi@...>
>>Sent: Aug 12, 2008 9:34 PM
>>To: Michael Gogins <gogins@...>, Developer discussions <csound-devel@...>
>>Cc: Csound <csound@...>
>>Subject: Re: [Cs-dev] Multi threading
>>
>>I don't know about the odd number instances, but we definitely need to
>>redo goto's as well as the opcodes are linked in a single-linked list
>>and only can find labels by using the global CURREVT (I think that's
>>the name) for the currently processed note, which won't work.  (Just
>>wanted to remind of that.)
>>
>>On Tue, Aug 12, 2008 at 6:31 PM, Michael Gogins <gogins@...> wrote:
>>> I thought there was a problem running multiple threads in Csound when there are odd numbers of instrument instances, but I don't see it.
>>>
>>> Could somebody remind me what the problem was, or email an orchestra/score that reproduce it?
>>>
>>> If there isn't a problem, we're good to go after I protect tables and channels.
>>>
>>> Regards,
>>> Mike
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@...
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>
>>-------------------------------------------------------------------------
>>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>Build the coolest Linux based applications with Moblin SDK & win great prizes
>>Grand prize is a trip for two to an Open Source event anywhere in the world
>>http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>_______________________________________________
>>Csound-devel mailing list
>>Csound-devel@...
>>https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@...
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Parent Message unknown Re: Multi threading

by Michael Gogins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When I run your csd on my Windows XP MinGW/MSys build, it works fine.

When I get a chance, I will try it on Ubuntu.

Regards,
Mike

----- Original Message -----
From: "Felipe Sateler" <fsateler@...>
To: "Developer discussions" <csound-devel@...>
Sent: Tuesday, August 12, 2008 9:59 PM
Subject: Re: [Cs-dev] Multi threading


El 12/08/08 21:50 Michael Gogins escribió:
> Could you please post your orc/sco or csd?

I've been trying one you supplied me before for debugging, mt.csd. I'm
attaching it in case you deleted it.
Note that I haven't been able to use multithreading with any csd I've tried.

In case you don't remember, I get a deadlock after this:

% ./csound --num-threads=2 mt.csd
time resolution is 1000.000 ns
PortAudio real-time audio module for Csound
0dBFS level = 32768.0
Csound version 5.08.91 beta (float samples) Aug 12 2008
libsndfile-1.0.17
Reading options from $HOME/.csoundrc
UnifiedCSD:  mt.csd
STARTING FILE
Creating options
Creating orchestra
Creating score
orchname:  /tmp/fileTS9hgD.orc
scorename: /tmp/filebXVwiI.sco
rtaudio: PortAudio module enabled ... using blocking interface
orch compiler:
32 lines read
        instr   1
        instr   2
Elapsed time at end of orchestra compile: real: 0.043s, CPU: 0.000s
sorting score ...
        ... done
Elapsed time at end of score sort: real: 0.043s, CPU: 0.000s
Multithread performance: insno:  -1  thread -1 of 2 starting.
Multithread performance: insno:  -1  thread -1 of 2 starting.
Csound version 5.08.91 beta (float samples) Aug 10 2008
displays suppressed
0dBFS level = 100000.0
orch now loaded
audio buffered in 256 sample-frame blocks
writing 1024-byte blks of floats to mt.wav (WAV)
SECTION 1:
ftable 1:
new alloc for instr 1:
new alloc for instr 1:
new alloc for instr 1:
new alloc for instr 1:
>>> I have to kill csound here



Saludos,
Felipe Sateler



--------------------------------------------------------------------------------


> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/


--------------------------------------------------------------------------------


> _______________________________________________
> Csound-devel mailing list
> Csound-devel@...
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel
LightInTheBox - Buy quality products at wholesale price!