Project

General

Profile

Feature #718

Insert calls to CheckForInterrupt

Added by John Abbott almost 9 years ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Category:
Improving
Target version:
Start date:
21 May 2015
Due date:
% Done:

90%

Estimated time:
Spent time:

Description

So that interrupts are acted upon we must insert calls to CheckForInterrupt in various places -- principally in loops which may take a long time, I believe.


Related issues

Related to CoCoALib - Feature #714: Interrupt mechanismClosed2015-05-19

Related to CoCoALib - Feature #721: CheckForInterrupt: string arg to specify where it was called?Closed2015-05-29

Related to CoCoALib - Feature #638: Time limit: let user specify time limit for a computationClosed2014-10-27

Related to CoCoA-5 - Feature #744: Handle interrupts more helpfullyClosed2015-07-01

Related to CoCoA-5 - Support #1023: CoCoAManual for verbosity: how to find which levels? how to find which functions?Closed2017-03-06

Related to CoCoALib - Feature #1457: Make SmoothFactor interruptibleClosed2020-05-10

Related to CoCoALib - Feature #1633: Make polynomial multiplication interruptible?Closed2021-11-16

Related to CoCoALib - Feature #127: Convert DUPFF code to C++In Progress2012-04-05

History

#1 Updated by John Abbott almost 9 years ago

I suggest we keep a log here of the files we have looked at with a view to inserting calls to CheckForInterrupt.

#2 Updated by Anna Maria Bigatti almost 9 years ago

  • Status changed from New to In Progress
  • Assignee set to Anna Maria Bigatti
  • % Done changed from 0 to 10

Nice! I added it into TmpGReductor.C (I was actually doing something else with very slow GB ;-) )

  void GReductor::myReduceCurrentSPoly()
  {
    try { CheckForInterrupt(); } // C-c for long computations
    catch (const InterruptReceived&)
    { CoCoA_ERROR("InterruptReceived", "GReductor::myReduceCurrentSPoly"); }
.....

I'm not quite sure it is what intended, but it works.

#3 Updated by John Abbott almost 9 years ago

Mario asked about the possible run-time cost of calling CheckForInterrupt.

Currently it may be needlessly expensive because the function InterruptFlag() defined in GlobalManager.H does several checks:
  1. check that GlobalManager has been created
  2. check that a flag has been specified (i.e. if a pointer is non-NULL)
  3. get the value of the pointed to flag.

It may be simpler to define a global flag belonging to CoCoALib (but which is simply left as "false"). I think we could also skip checking whether GlobalManager has been created -- in the worst case you'll get a SEGV when calling CheckForInterrupt -- but I'd be amazed if that was the first time GlobalManager was needed. Perhaps I'll do a quick overhead check for the current implementation.

#4 Updated by John Abbott about 8 years ago

  • Target version changed from CoCoALib-0.99540 Feb 2016 to CoCoALib-1.0

#5 Updated by John Abbott about 8 years ago

  • Related to Feature #744: Handle interrupts more helpfully added

#6 Updated by John Abbott over 7 years ago

I tried interrupting a long gbasis computation (as part of one of Mario's long radical examples). The computation had been running for about 50 hours (probably not all the time in that gbasis computation), but the interrupt took over 15 minutes to be recognized. That is a bit slow!

It is quite possible that CoCoALib was doing a reduction of a "hideously large" polynomial; I'm not sure whether it is really worth trying to interrupt inside a reduction... :-/

#7 Updated by Anna Maria Bigatti almost 7 years ago

  • Related to Support #1023: CoCoAManual for verbosity: how to find which levels? how to find which functions? added

#8 Updated by John Abbott almost 4 years ago

  • Related to Feature #1457: Make SmoothFactor interruptible added

#9 Updated by John Abbott over 2 years ago

  • Target version changed from CoCoALib-1.0 to CoCoALib-0.99850
  • % Done changed from 10 to 60

#10 Updated by John Abbott over 2 years ago

  • Related to Feature #1633: Make polynomial multiplication interruptible? added

#11 Updated by John Abbott over 1 year ago

Nico Mexis asked whether there could be a check for interrupts inside the factorizer.
This will much easier to achieve when the factorizer is modernized... if ever (sigh).

#12 Updated by John Abbott over 1 year ago

#13 Updated by John Abbott about 1 year ago

  • Status changed from In Progress to Resolved
  • Target version changed from CoCoALib-0.99850 to CoCoALib-0.99880
  • % Done changed from 60 to 90

I do this whenever I encounter a case which is not yet covered.
I think most cases are now covered. Hence 90%. But postponing as well.

#14 Updated by John Abbott 5 months ago

Make matrix inverse interruptible (at least for matrices over ZZ).
Example: inverse(RandomUnimodularMat(ZZ,500))

#15 Updated by John Abbott 5 months ago

I have made inverse interruptible (DetByGauss). I suppose we should also make a DetByCRT at some point?

Also available in: Atom PDF