Changeset 9500


Ignore:
Timestamp:
Dec 18, 2014 3:42:03 PM (4 years ago)
Author:
jwatson
Message:

Adding Pyomo 4.0-related migration updates.

Location:
pyomo/trunk/pyomo/pysp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pyomo/trunk/pyomo/pysp/lagrangeParam.py

    r9381 r9500  
    3838      Result.status = 'LagrangeParam begins '+ datetime_string() + '...running new ph'
    3939      ph = None
    40       def new_ph():
    41          if ph is not None:
    42             # Release Pyro workers among other things
    43             ph.release_components()
    44          ph = PHAlgorithmBuilder(options)
    45          return
     40## 12/18/14...DO NOT USE
     41#      def new_ph():
     42#         if ph is not None:
     43#            # Release Pyro workers among other things
     44#            ph.release_components()
     45#         ph = PHAlgorithmBuilder(options)
     46#         return
    4647
    4748      blanks = "                          "  # used for formatting print statements
     
    7172                % (str(getattr(Result,'status')), str(STARTTIME)))
    7273
    73       ph = new_ph()
     74      #ph = new_ph()
     75      ph = PHFromScratch(options)
    7476      Result.ph = ph
    7577      rootnode = ph._scenario_tree._stages[0]._tree_nodes[0]   # use rootnode to loop over scenarios
     
    553555   if options.verbosity > 0:
    554556        print("Loading reference model and scenario tree")
    555    scenario_instance_factory, full_scenario_tree = load_models(options)
    556 
     557# Dec 18
     558#   scenario_instance_factory, full_scenario_tree = load_models(options)
     559   scenario_instance_factory = \
     560        ScenarioTreeInstanceFactory(options.model_directory,
     561                                    options.instance_directory,
     562                                    options.verbose)
     563
     564   full_scenario_tree = \
     565            GenerateScenarioTreeForPH(options,
     566                                      scenario_instance_factory)
     567
     568####
    557569   try:
    558570      if (scenario_instance_factory is None) or (full_scenario_tree is None):
     
    690702         sz = putcommas(z)
    691703         sz = blanks[2:20-len(sz)] + sz
    692          #print sl+" "+sb+" "+sz
     704         print sl+" "+sb+" "+sz
    693705      print("==================================================================\n")
    694706   return
  • pyomo/trunk/pyomo/pysp/lagrangeutils.py

    r9369 r9500  
    167167         ef_solve_start_time = time.time()
    168168         if (options.disable_ef_warmstart) or (ef_solver.warm_start_capable() is False):       
    169             ef_action_handle = ef_solver_manager.queue(binding_instance, opt=ef_solver, tee=options.output_ef_solver_log)
     169            ef_action_handle = ef_solver_manager.queue(binding_instance, opt=ef_solver, tee=options.ef_output_solver_log)
    170170         else:
    171             ef_action_handle = ef_solver_manager.queue(binding_instance, opt=ef_solver, tee=options.output_ef_solver_log, warmstart=True)           
     171            ef_action_handle = ef_solver_manager.queue(binding_instance, opt=ef_solver, tee=options.ef_output_solver_log, warmstart=True)           
    172172         print("Waiting for extensive form solve")
    173173         ef_results = ef_solver_manager.wait_for(ef_action_handle)
     
    366366      print("Solving extensive form.")
    367367   if ef_solver.warm_start_capable():
    368       ef_action_handle = ef_solver_manager.queue(master_instance, opt=ef_solver, warmstart=False, tee=options.output_ef_solver_log, symbolic_solver_labels=options.symbolic_solver_labels)
     368      ef_action_handle = ef_solver_manager.queue(master_instance, opt=ef_solver, warmstart=False, tee=options.ef_output_solver_log, symbolic_solver_labels=options.symbolic_solver_labels)
    369369   else:
    370       ef_action_handle = ef_solver_manager.queue(master_instance, opt=ef_solver, tee=options.output_ef_solver_log, symbolic_solver_labels=options.symbolic_solver_labels)     
     370      ef_action_handle = ef_solver_manager.queue(master_instance, opt=ef_solver, tee=options.ef_output_solver_log, symbolic_solver_labels=options.symbolic_solver_labels)     
    371371   ef_results = ef_solver_manager.wait_for(ef_action_handle)
    372372
Note: See TracChangeset for help on using the changeset viewer.