Project

General

Profile

Bug #1705

ProgressReporter: prepare for new loop?

Added by John Abbott over 1 year ago. Updated 1 day ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
Improving
Target version:
Start date:
24 Oct 2022
Due date:
% Done:

80%

Estimated time:
Spent time:

Description

I have a program with 3 loops, and would like to have progress info about each loop.
The 1st loop is very fast; the 2nd loop is quite a bit slower; and the 3rd loop is slower still.
All 3 loops do the same number of iterations.

My idea was to use a single ProgressReporter object for all 3 loops,
but it does not report anything for the slower loops.

Fix this!

History

#1 Updated by John Abbott over 1 year ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

A likely cause is that the frequency of proper time checks is too low (because of the very fast iters of the 1st loop).

Two obvious possible fixes:
  • (A) impose a lower upper bound on the frequency between proper checks
  • (B) offer a PrepareForNewLoop function (similar to CpuTimeLimit)

At the moment I prefer (B) but its does require cooperation from the user.
Maybe I should do both?

Or is the cause other than what I believe?

#2 Updated by Anna Maria Bigatti over 1 year ago

John Abbott wrote:

A likely cause is that the frequency of proper time checks is too low (because of the very fast iters of the 1st loop).

Two obvious possible fixes:
  • (A) impose a lower upper bound on the frequency between proper checks
  • (B) offer a PrepareForNewLoop function (similar to CpuTimeLimit)

At the moment I prefer (B) but its does require cooperation from the user.
Maybe I should do both?

Or is the cause other than what I believe?

I also prefer (B). Maybe ResetForNewLoop?

#3 Updated by John Abbott over 1 year ago

  • Assignee set to John Abbott
  • % Done changed from 10 to 50

I have revised the impl -- it now works better.

Much of this code is quite similar to CpuTimeLimit.

The common part should be abstracted.

#4 Updated by John Abbott about 1 year ago

  • Target version changed from CoCoALib-0.99850 to CoCoALib-0.99880
  • % Done changed from 50 to 80

#5 Updated by John Abbott about 1 year ago

I am not so happy with the name myPrepareForLoop.
Is there a better name?

#6 Updated by John Abbott 1 day ago

Maybe just myReset? Or is that too vague? It is short, which I like.
So far we have been using myPrepareForNewLoop for over a year... well, maybe it has not been used much?

Also available in: Atom PDF