transport8a.py File Reference

This is a variation of the transport8.py example and it uses the multiprocessing module instead of threads in order to achieve parallel execution. More...

Go to the source code of this file.

Functions

def transport8a.get_model_text ()
 
def transport8a.scen_solve (cp_file, bmult_queue, queue_lock, io_lock)
 

Variables

 transport8a.ws = GamsWorkspace(system_directory = sys.argv[1])
 
 transport8a.cp = ws.add_checkpoint()
 
 transport8a.t8 = ws.add_job_from_string(get_model_text())
 
 transport8a.checkpoint
 
string transport8a.cp_file = os.path.join(ws.working_directory, cp.name) + ".g00"
 
 transport8a.bmult_queue = Queue()
 
list transport8a.bmult_data = [ 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3 ]
 
 transport8a.io_lock = Lock()
 
 transport8a.queue_lock = Lock()
 
int transport8a.nr_workers = 4
 
dictionary 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 module instead of threads 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.