Changeset 2930


Ignore:
Timestamp:
Aug 14, 2010 5:20:11 PM (9 years ago)
Author:
wehart
Message:

Rework of mechanism to disable the generation of
canonical representations for ASL solvers. The earlier
mechanism disabled the plugin, which impacted future
solves.

NOTE: ticket #4112 concerns a better fix for this mechanism.

Location:
coopr.pyomo/trunk/coopr/pyomo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/preprocess/compute_canonical_repn.py

    r2648 r2930  
    2222    """
    2323    This plugin computes the canonical representation for
    24     all objectives and constraints
    25     linear terms.
     24    all objectives and constraints linear terms.
    2625    """
    2726
     
    3938        The main routine to perform the preprocess
    4039        """
     40        if getattr(model,'skip_canonical_repn',False):
     41            return model
    4142        #
    4243        # Objectives
  • coopr.pyomo/trunk/coopr/pyomo/scripting/util.py

    r2883 r2930  
    9696            raise ValueError, msg % options.tempdir
    9797        TempfileManager.tempdir = options.tempdir
    98     #
    99     # Disable canonical repn for ASL solvers
    100     #
    101     if hasattr(options, 'solver') and options.solver == "asl":
    102         options.skip_canonical_repn = True
    10398
    10499    #
     
    253248        ep.apply( options=options, model=model )
    254249       
    255     # ToDo: CDL This may not be the right place for this
     250    #
     251    # Disable canonical repn for ASL solvers
     252    #
    256253    # Likely we need to change the framework so that canonical repn
    257254    # is not assumed to be required by all solvers?
    258     # For now...
    259     if hasattr(options, 'skip_canonical_repn') and options.skip_canonical_repn == True:
    260         if 'simple_preprocessor' in model._preprocessors:
    261             model.preprocessor_ep.service('simple_preprocessor').deactivate_action('compute_canonical_repn')
     255    #
     256    if hasattr(options, 'solver') and options.solver == "asl":
     257        model.skip_canonical_repn = True
    262258   
    263259    #
Note: See TracChangeset for help on using the changeset viewer.