File Reference

Go to the source code of this file.


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

Variables = GamsWorkspace(system_directory = sys.argv[1])
 transport8.cp = ws.add_checkpoint()
 transport8.t8 = ws.add_job_from_string(get_model_text())
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 = {}

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