Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: waitbar for parfor loops
Date: Fri, 21 Mar 2008 19:12:01 +0000 (UTC)
Organization: Drexel University
Lines: 56
Message-ID: <fs11a1$9nh$1@fred.mathworks.com>
References: <fs0m5p$nkd$1@fred.mathworks.com> <fs0tg5$qdq$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1206126721 9969 172.30.248.37 (21 Mar 2008 19:12:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Mar 2008 19:12:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1084889
Xref: news.mathworks.com comp.soft-sys.matlab:458530



You don't necessarily need something that communicates when
an iteration is done ... you just need something that can
tell a waitbar to update.

I've tried something along these lines so far, maybe it will
inspire someone with more knowledge of the callback systems.

N=100;
BEEN_DONE_VEC=false(N,1)
wait_handle=waitbar(0);
parfor (IND=1:N)
BEEN_DONE_VEC(IND)=true;
waitbar(wait_handle,mean(BEEN_DONE_VEC))
...do something
end

In this case it doesn't matter that the operations are not
done in order, since it just updates it with the fraction of
instances that are completed.  The only problem I have is
figuring out how to pass an 'update' type call to waitbar.




"Narfi " <narfi.stefansson@mathworks.com> wrote in message
<fs0tg5$qdq$1@fred.mathworks.com>...
> William,
> 
> Currently, there is unfortunately no way of receiving
> notification in the MATLAB client when an iteration is
> completed on a worker.
> 
> Best,
> 
> Narfi
> "William Dampier" <walldo2@gmail.com> wrote in message
> <fs0m5p$nkd$1@fred.mathworks.com>...
> > I was wondering if anyone has found a way to do progressbars
> > for the new parfor loops in R2007b and 2008a.
> > 
> > For normal for-loops the simple waitbar command works well.
> > waitbar(0)
> > for i=1:N
> > waitbar(i/N)
> > ...do something
> > end
> > 
> > however it doesn't work with the parfor loops, since things
> > aren't done in order.
> > 
> > Has anybody made a function or found a work-around?
> > 
> > Thanks
> > Will
>