Issue 8 in ecspy: pools should be closed properly in parallel_evaluation_mp

4 views
Skip to first unread message

ec...@googlecode.com

unread,
Nov 20, 2011, 11:45:39 AM11/20/11
to ec...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 8 by niko.son...@gmail.com: pools should be closed properly in
parallel_evaluation_mp
http://code.google.com/p/ecspy/issues/detail?id=8

What steps will reproduce the problem?
Running PSO with the parallel_evaluation_mp evaluator.

What is the expected output? What do you see instead?
The PSO stops with an OS error, complaining about to many open files.

Fix:

Closing the worker pool after its work is done fixes the problem.
...
try:
pool = multiprocessing.Pool(processes=nprocs)
results = [pool.apply_async(evaluator, ([c], {})) for c in candidates]
return [r.get()[0] for r in results]

-->

try:
pool = multiprocessing.Pool(processes=nprocs)
results = [pool.apply_async(evaluator, ([c], {})) for c in candidates]
* pool.close()
return [r.get()[0] for r in results]

What version of the product are you using? On what operating system?

OS X Lion 10.7.2
Enthough Python Distribution
Python 2.7.1 |EPD 7.0-2 (64-bit)| (r271:86832, Dec 3 2010, 15:56:20)

Please provide any additional information below.


ec...@googlecode.com

unread,
Nov 20, 2011, 5:01:37 PM11/20/11
to ec...@googlegroups.com

Comment #1 on issue 8 by jellefer...@gmail.com: pools should be closed
properly in parallel_evaluation_mp
http://code.google.com/p/ecspy/issues/detail?id=8

Thanks for the detailed report Niko!
Added the closing statement in the latest commit...

Aaron Garrett

unread,
Nov 20, 2011, 5:41:59 PM11/20/11
to ec...@googlegroups.com

Thank you for the bug report, Niko, and thanks Jelle for such a quick response.

Aaron Garrett
(Sent from my Droid)

--
You received this message because you are subscribed to the Google Groups "Evolutionary Computations in Python" group.
To post to this group, send email to ec...@googlegroups.com.
To unsubscribe from this group, send email to ecspy+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ecspy?hl=en.

ec...@googlecode.com

unread,
Nov 30, 2011, 9:18:34 PM11/30/11
to ec...@googlegroups.com
Updates:
Status: Verified

Comment #2 on issue 8 by aaron.lee.garrett: pools should be closed properly
in parallel_evaluation_mp
http://code.google.com/p/ecspy/issues/detail?id=8

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages