# Path: ciao_contrib/logger_wrapper.py
# def initialize_module_logger(name):
#     """Create a logger for the module with an id of name.
# 
#     Returns the logger. Unlike initialize_logger, no handler
#     is set up.
# 
#     """
# 
#     return get_module_logger(name)


import time
import signal
import multiprocessing
from queue import Empty
from .logger_wrapper import initialize_module_logger
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License along
#  with this program; if not, write to the Free Software Foundation, Inc.,
#  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

"""
Test routines for taking advantage of multiple processors.
This is a slightly different approach to that provided by
sherpa.utils.parallel_map and is provided for testing. Please
be aware that at present this code has seen limited testing and
has no guarantee of stability.

Sherpa's parallel_map splits up the work load at creation time and
farms off a set of tasks to each processor. Here we use a pool of jobs,
with each worker extracting the next job when it is free.

See, amongt others:

http://docs.python.org/library/multiprocessing.html

http://www.bryceboe.com/2010/08/26/python-multiprocessing-and-keyboardinterrupt/

"""



__all__ = ("parallel_pool", )


# Path: ciao_contrib/logger_wrapper.py
# def initialize_module_logger(name):
#     """Create a logger for the module with an id of name.
# 
#     Returns the logger. Unlike initialize_logger, no handler
#     is set up.
# 
#     """
# 
#     return get_module_logger(name)


# Path: ciao_contrib/parallel_wrapper.py
import time
import signal
import multiprocessing
from queue import Empty
from .logger_wrapper import initialize_module_logger

#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License along
#  with this program; if not, write to the Free Software Foundation, Inc.,
#  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

"""
Test routines for taking advantage of multiple processors.
This is a slightly different approach to that provided by
sherpa.utils.parallel_map and is provided for testing. Please
be aware that at present this code has seen limited testing and
has no guarantee of stability.

Sherpa's parallel_map splits up the work load at creation time and
farms off a set of tasks to each processor. Here we use a pool of jobs,
with each worker extracting the next job when it is free.

See, amongt others:

http://docs.python.org/library/multiprocessing.html

http://www.bryceboe.com/2010/08/26/python-multiprocessing-and-keyboardinterrupt/

"""



__all__ = ("parallel_pool", )


logger = initialize_module_logger("parallel_wrapper")