Home | Trees | Indices | Help |
|
---|
|
Scheduler that distributes the task to multiple processes. The subprocess module is used to start the requested number of processes. The execution of each task is internally managed by dedicated thread. This scheduler should work on all platforms (at least on Linux, Windows XP and Vista).
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|||
Inherited from Scheduler | |||
---|---|---|---|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
Inherited from |
|||
Inherited from Scheduler | |||
---|---|---|---|
n_open_tasks This property counts of submitted but unfinished tasks. |
|||
task_counter This property counts the number of submitted tasks. |
|
Initialize the scheduler and start the slave processes. result_container -- ResultContainer used to store the results. verbose -- Set to True to get progress reports from the scheduler (default value is False). n_processes -- Number of processes used in parallel. If None (default) then the number of detected CPU cores is used. source_paths -- List of paths that are added to sys.path in the processes to make the task unpickling work. A single path instead of a list is also accepted. If None (default value) then source_paths is set to sys.path. To prevent this you can specify an empty list. python_executable -- Python executable that is used for the processes. The default value is None, in which case sys.executable will be used. cache_callable -- Cache the task objects in the processes (default is True). Disabling caching can reduce the memory usage, but will generally be less efficient since the task_callable has to be pickled each time.
|
Add a task, if possible without blocking. It blocks when the system is not able to start a new thread or when the processes are all in use.
|
Shut down the slave processes. If a process is still running a task then an exception is raised.
|
Thread function which cares for a single task. The task is pushed to the process via stdin, then we wait for the result on stdout, pass the result to the result container, free the process and exit. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1-MDP on Mon Apr 27 21:56:25 2020 | http://epydoc.sourceforge.net |