Opened 12 years ago

Closed 11 years ago

#8410 closed defect (fixed)

Improve robustness of @parallel

Reported by: boothby Owned by: tbd
Priority: major Milestone: sage-4.5.2
Component: performance Keywords:
Cc: wstein Merged in: sage-4.5.2.alpha0
Authors: William Stein Reviewers: Tom Boothby
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Run the following:

@parallel(4)
def sleeper(x):
    sleep(x)

for _ in sleeper([10]*100):
    pass

and interrupt it with ctrl-c (or esc in the notebook). We get

Killing any remaining workers...
[Errno 3] No such process
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)

/home/boothby/<ipython console> in <module>()

/usr/local/sage/local/lib/python2.6/site-packages/sage/parallel/use_fork.pyc in __call__(self, f, inputs)
     98                         signal.alarm(int(walltime() - oldest)+1)
     99                     try:
--> 100                         pid = os.wait()[0]
    101                         signal.signal(signal.SIGALRM, signal.SIG_IGN)
    102                     except RuntimeError:

/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/get_sigs.pyc in my_sigint(x, n)
      7 
      8 def my_sigint(x, n):
----> 9     raise KeyboardInterrupt
     10 
     11 def my_sigfpe(x, n):

KeyboardInterrupt: 

and then, let's restart the computation:

sage: for _ in sleeper([10]*100):
    print "hello"
    pass
....: 
15775
[Errno 39] Directory not empty: '/home/boothby/.sage/temp/sage.math.washington.edu/15401/dir_0'
Killing any remaining workers...

All I can do here is restart Sage.

Attachments (1)

trac_8410.patch (2.7 KB) - added by was 11 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 11 years ago by was

  • Milestone set to sage-4.5

First remark: This fails *exactly* the same on the command line. Also the error is now:

sage: for _ in sleeper([10]*100):
....:         pass
....: 
91260
Killing any remaining workers...

Changed 11 years ago by was

comment:2 Changed 11 years ago by was

  • Status changed from new to needs_review

comment:3 Changed 11 years ago by boothby

  • Status changed from needs_review to positive_review

works for me

comment:4 Changed 11 years ago by mpatel

  • Authors set to William Stein
  • Merged in set to sage-4.5.2.alpha0
  • Resolution set to fixed
  • Reviewers set to Tom Boothby
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.