transport8.py File Reference

This is the 8th model in a series of tutorial examples. More...

Go to the source code of this file.

Functions

def transport8.get_model_text ()
 
def transport8.scen_solve (workspace, checkpoint, bmult_list, list_lock, io_lock)
 

Variables

 transport8.ws = GamsWorkspace(system_directory = sys.argv[1])
 
 transport8.cp = ws.add_checkpoint()
 
 transport8.t8 = ws.add_job_from_string(get_model_text())
 
 transport8.checkpoint
 
list transport8.bmult_list = [ 1.3, 1.2, 1.1, 1.0, 0.9, 0.8, 0.7, 0.6 ]
 
 transport8.list_lock = threading.Lock()
 
 transport8.io_lock = threading.Lock()
 
int transport8.nr_workers = 2
 
dictionary transport8.threads = {}
 
 transport8.target
 
 transport8.scen_solve
 
 transport8.args
 

Detailed Description

This is the 8th model in a series of tutorial examples.

Here we show:

  • How to use a queue to solve multiple GamsModelInstances in parallel
  • Note that the CPython implementation will not run threads in parallel due to its Global Interpreter Lock. See the transport8a example that uses the multiprocessing module for parallel computation.

Definition in file transport8.py.