Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#14150 closed defect (fixed)

Fix wait() in @parallel

Reported by: Jeroen Demeyer Owned by: Jason Grout
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:

Status badges

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 Jeroen Demeyer 10 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 10 years ago by Jeroen Demeyer

Status: newneeds_review

comment:2 Changed 10 years ago by David Roe

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 10 years ago by Jeroen Demeyer

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 Changed 10 years ago by David Roe

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 10 years ago by Jeroen Demeyer

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 10 years ago by Jeroen Demeyer

Added doctest which always shows the OSError without this patch.

comment:7 Changed 10 years ago by David Roe

Reviewers: David Roe
Status: needs_reviewneeds_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 10 years ago by Jeroen Demeyer

Good point :-)

Changed 10 years ago by Jeroen Demeyer

Attachment: 14150_use_fork.patch added

comment:9 Changed 10 years ago by Jeroen Demeyer

Status: needs_workneeds_review

comment:10 Changed 10 years ago by David Roe

Status: needs_reviewpositive_review

Great.

comment:11 Changed 10 years ago by Jeroen Demeyer

Merged in: sage-5.8.beta2
Resolution: fixed
Status: positive_reviewclosed

comment:12 Changed 9 years ago by Volker Braun

Possibly related: #15585

Note: See TracTickets for help on using tickets.