Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#14150 closed defect (fixed)

Fix wait() in @parallel

Reported by: jdemeyer Owned by: jason
Priority: major Milestone: sage-5.8
Component: misc Keywords:
Cc: Merged in: sage-5.8.beta2
Authors: Jeroen Demeyer Reviewers: David Roe
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

The new doctesting framework sometimes gets:

sage -t --long devel/sage/sage/homology/simplicial_complex.py
**********************************************************************
File "devel/sage/sage/homology/simplicial_complex.py", line 2188, in sage.homology.simplicial_complex.SimplicialComplex.is_cohen_macaulay
Failed example:
    S.is_cohen_macaulay(ncpus=3)
Expected:
    False
Got:
    Exception OSError: (10, 'No child processes') in <generator object __call__ at 0x646f1e0> ignored
    False
**********************************************************************

Fix this.

Attachments (1)

14150_use_fork.patch (8.1 KB) - added by jdemeyer 7 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 7 years ago by jdemeyer

  • Status changed from new to needs_review

comment:2 follow-up: Changed 7 years ago by roed

Looks good. You didn't add a doctest: is there one that consistently fails in the new framework?

comment:3 in reply to: ↑ 2 Changed 7 years ago by jdemeyer

Replying to roed:

is there one that consistently fails in the new framework?

To be honest, I cannot say for sure why the problem occurs.

I'm fairly certain the problem is the big gap between

pid = os.wait()[0]

and

del workers[pid]

If some exception would occur in between, then workers[pid] would still be in the list of workers, even though we saw it exit. However, I cannot really explain where the exception could come from (can yield raise exceptions?)

comment:4 follow-up: Changed 7 years ago by roed

How consistently is this error occurring in the new framework? Every time? Do the fixes here make the problem disappear? If so, I'm willing to give this a positive review, since there is a doctest failing that will no longer fail.

comment:5 in reply to: ↑ 4 Changed 7 years ago by jdemeyer

Replying to roed:

How consistently is this error occurring in the new framework? Every time?

Not every time, but it's still reasonably common that I have seen it multiple times.

comment:6 Changed 7 years ago by jdemeyer

Added doctest which always shows the OSError without this patch.

comment:7 Changed 7 years ago by roed

  • Reviewers set to David Roe
  • Status changed from needs_review to needs_work

You should fix the unpickling after breaking it. Add

sage: from sage.structure.sage_object import unpickle_override
sage: del unpickle_override[('sage.rings.polynomial.polynomial_rational_flint', 'Polynomial_rational_flint')]

after the end of the TESTS block. Otherwise it looks good.

comment:8 Changed 7 years ago by jdemeyer

Good point :-)

Changed 7 years ago by jdemeyer

comment:9 Changed 7 years ago by jdemeyer

  • Status changed from needs_work to needs_review

comment:10 Changed 7 years ago by roed

  • Status changed from needs_review to positive_review

Great.

comment:11 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.8.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:12 Changed 6 years ago by vbraun

Possibly related: #15585

Note: See TracTickets for help on using tickets.