|
|
Critical section in parallel computing
Hello,
Does anybody know how to create a critical section (a section of code that only a single processor can execute at a time) using the parallel computing toolbox?
Thanks,
-Fayyaz
|
|
0
|
|
|
|
Reply
|
Fayyaz
|
12/2/2010 10:25:05 PM |
|
On 10-12-02 04:25 PM, Fayyaz-ul-Amir Minhas wrote:
> Does anybody know how to create a critical section (a section of code
> that only a single processor can execute at a time) using the parallel
> computing toolbox?
labbarrier() may perhaps be acceptable.
http://www.mathworks.com/help/toolbox/distcomp/labbarrier.html
|
|
0
|
|
|
|
Reply
|
Walter
|
12/2/2010 11:05:26 PM
|
|
"Fayyaz-ul-Amir Minhas" <fayyazafsar@gmail.com> writes:
> Does anybody know how to create a critical section (a section of code
> that only a single processor can execute at a time) using the parallel
> computing toolbox?
As well as the suggestion to use labBarrier, you could also use other
message passing stuff. If, for example, you wanted to compute a value on
only one lab, you could do:
spmd
if labindex == 1
val = someCriticalCalculation;
labBroadcast( 1, val );
else
val = labBroadcast( 1 );
end
... do stuff with 'val' ...
end
Or else you can use the SPMD construct itself, like so:
val = someCriticalCalculation; % only executed at the client
spmd
... do stuff with 'val' ... % all workers get the same value
end
Cheers,
Edric.
|
|
0
|
|
|
|
Reply
|
Edric
|
12/3/2010 8:16:26 AM
|
|
Thanks Edric!
Edric M Ellis <eellis@mathworks.com> wrote in message <ytwvd3bi84l.fsf@uk-eellis-deb5-64.dhcp.mathworks.com>...
> "Fayyaz-ul-Amir Minhas" <fayyazafsar@gmail.com> writes:
>
> > Does anybody know how to create a critical section (a section of code
> > that only a single processor can execute at a time) using the parallel
> > computing toolbox?
>
> As well as the suggestion to use labBarrier, you could also use other
> message passing stuff. If, for example, you wanted to compute a value on
> only one lab, you could do:
>
> spmd
> if labindex == 1
> val = someCriticalCalculation;
> labBroadcast( 1, val );
> else
> val = labBroadcast( 1 );
> end
> ... do stuff with 'val' ...
> end
>
> Or else you can use the SPMD construct itself, like so:
>
> val = someCriticalCalculation; % only executed at the client
> spmd
> ... do stuff with 'val' ... % all workers get the same value
> end
>
> Cheers,
>
> Edric.
|
|
0
|
|
|
|
Reply
|
Fayyaz
|
1/12/2011 10:03:04 AM
|
|
Thanks.
Walter Roberson <roberson@hushmail.com> wrote in message <id98no$5n3$1@canopus.cc.umanitoba.ca>...
> On 10-12-02 04:25 PM, Fayyaz-ul-Amir Minhas wrote:
> > Does anybody know how to create a critical section (a section of code
> > that only a single processor can execute at a time) using the parallel
> > computing toolbox?
>
> labbarrier() may perhaps be acceptable.
>
> http://www.mathworks.com/help/toolbox/distcomp/labbarrier.html
|
|
0
|
|
|
|
Reply
|
Fayyaz
|
1/12/2011 10:04:04 AM
|
|
|
4 Replies
377 Views
(page loaded in 0.042 seconds)
Similiar Articles: Critical section in parallel computing - comp.soft-sys.matlab ...Hello, Does anybody know how to create a critical section (a section of code that only a single processor can execute at a time) using the parallel computing toolbox? 'Java-like' synchronization for pthreads with C++. - comp.unix ...Compiling : examples_logging - comp.parallel.mpi... fast=O3 --enable-debuginfo ... using pthreads and would like to have 'java-like'synchronization for critical sections of... calculating PI with a parallel algorithm Follow - Computer GroupWould that be another computer? If yes, how can I access this ... This problem is explained and solved in Section 3.8 of the book _Using MPI. Portable parallel programming ... Open 16 workers by matlabpool on a local machine? - comp.soft-sys ...... also to open more than 8 workers, so could you please point out to what section ... edition, and the Matlab > > > > > Distributed Computing Server and the Parallel Computing ... Critcal path in XILINX ISE (XST) - comp.arch.fpgaThat should be in the "Timing Report" section of the XST ... Hi, > Can you please tell me where I can see the critical ... path in XILINX ISE (XST) - comp.arch.fpga | Computer ... Protect a semaphore of crash in the critical area - comp.unix ...Critical section in parallel computing - comp.soft-sys.matlab ... Protect a semaphore of crash in the critical area - comp.unix ... The semaphore becames "red" for ever ... Transition for patch downloads ("wget interface") from SunSolve to ...... are no plans to support both interfaces in parallel ... Watch the "News" section on the PCA website for ... -- SysAdmin | Institute of Scientific Computing, University ... Extract Program change number formula - comp.music.midiAs explained already, this sub MidiIn_Proc is time critical section because it is called ... Extract Program change number formula - comp.music.midi | Computer ... Hi. Plotting feasible region of a linear programme - comp.soft-sys ...... p1 - p0, p2 - p0, p3 - p0}]]; > And @@ Thread[invHad.m >= 0 /. section ... I've put comparison in parallel stackoverflow thread -- http://stackoverflow.com ... Remote Execution of Local Code - comp.soft-sys.matlabI've read that perhaps the Parallel Computing toolbox will allow me to do this, however, I ... Microsoft Security Bulletin MS10-063 - Critical : Vulnerability in ... The ... Critical section in parallel computing - comp.soft-sys.matlab ...Hello, Does anybody know how to create a critical section (a section of code that only a single processor can execute at a time) using the parallel computing toolbox? OpenMP - High Performance Computing: High Performance ComputingThe CRITICAL and SECTIONS directives occur outside an enclosing parallel region ... At LC, the list of supported computing tools can be ... 7/23/2012 10:04:39 PM
|
|
|
|
|
|
|
|
|