This is a variation of the transport8.py example and it uses the multiprocessing Python package instead of threading in order to achieve parallel execution. More...
Go to the source code of this file.
Functions | |
def | transport8a.scen_solve (cp_file, bmult_queue, queue_lock, io_lock) |
Variables | |
str | transport8a.GAMS_MODEL |
sys | transport8a.sys_dir = sys.argv[1] if len(sys.argv) > 1 else None |
GamsWorkspace | transport8a.ws = GamsWorkspace(system_directory=sys_dir) |
GamsWorkspace | transport8a.cp = ws.add_checkpoint() |
GamsWorkspace | transport8a.job = ws.add_job_from_string(GAMS_MODEL) |
transport8a.checkpoint | |
os | transport8a.cp_file = os.path.join(ws.working_directory, cp.name) + ".g00" |
Queue | transport8a.bmult_queue = Queue() |
list | transport8a.bmult = [0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3] |
Lock | transport8a.io_lock = Lock() |
Lock | transport8a.queue_lock = Lock() |
int | transport8a.nr_workers = 4 |
dict | transport8a.processes = {} |
transport8a.target | |
transport8a.scen_solve | |
transport8a.args | |
Detailed Description
This is a variation of the transport8.py example and it uses the multiprocessing Python package instead of threading in order to achieve parallel execution.
Threads in the CPython implementation are not executed in parallel due to the Global Interpreter Lock.
Definition in file transport8a.py.