From: Steve Amphlett on
"Zafer Çoban" <zcoban(a)aselsan.com.tr> wrote in message <i20pj9$3gp$1(a)fred.mathworks.com>...
> Hi,
> I ran a for loop with 1000 iterations in an .m file. It has been running for 3 days. I wonder if there is a way to learn the iteration number without stopping the run? Thanks...

Take the hit. Kill it. Query your counter variable. If your code is linear with iteration number, you can estimate the mean execution speed and expected total time. If it is not linear with iteration number (more likely), you can at least get a lower estimate for the total time. If the estimate is too big (mega-years), think again about your algorithm. If your estimate is reasonable (you decide what reasonable is), have your loop spit out its counter.

If (and this is common with experimental data), your iterations need not be done in any specific order, consider randomising the order. Or running sweeps with ever increasing resolution across the domain. Save the result periodically so that you can l and view it with another Matlab instance (licensing scheme permitting) or some other application.
From: Bruno Luong on
"Steve Amphlett" <Firstname.Lastname(a)Where-I-Work.com> wrote in message <i21cu4$6m6$1(a)fred.mathworks.com>...
> "Zafer Çoban" <zcoban(a)aselsan.com.tr> wrote in message <i20pj9$3gp$1(a)fred.mathworks.com>...
> > Hi,
> > I ran a for loop with 1000 iterations in an .m file. It has been running for 3 days. I wonder if there is a way to learn the iteration number without stopping the run? Thanks...
>
> Take the hit. Kill it. Query your counter variable.

May be OP could run a second instance of the program to estimate the run time (I bet he'll kill it anyway, discovering that the program needs 389100 years to finish).

Bruno
From: Jan Simon on
Dear Zafer,

> Then, is it possible to access a variable that is defined in an .m file (but not defined as global variable) while the .m file is on run?

Two times "no".
At first you cannot access variables from outside the currently running function.
At second, you cannot do *anything at all* in a Matlab session as long as your program runs.

Kind regards, Jan
From: Andy on
"Zafer Çoban" <zcoban(a)aselsan.com.tr> wrote in message <i20pj9$3gp$1(a)fred.mathworks.com>...
> Hi,
> I ran a for loop with 1000 iterations in an .m file. It has been running for 3 days. I wonder if there is a way to learn the iteration number without stopping the run? Thanks...

Perhaps you could post your system specs and some code, and we can help you find ways to speed up this run time. Then it won't hurt so much to kill the process.
From: dpb on
Zafer Çoban wrote:
> Hi,
> I ran a for loop with 1000 iterations in an .m file. It has been running
> for 3 days. I wonder if there is a way to learn the iteration number
> without stopping the run? Thanks...

Besides the other suggestions I'd wonder what's in those iterations? Is
it reasonable to think sotoo of several minutes per iteration? I would
presume you ran one or two iterations during development; did they take
that long? While possible it is that compute-intensive, I'd wonder if
you actually built an infinite loop by mistake?

--
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: slow fscanf - serial port
Next: help needed