Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from datetime import datetime
from opentuner import tuningrunmain
class TuningRunManager(tuningrunmain.TuningRunMain):
"""
This class manages a tuning run in a "slave" configuration, where main()
is controlled by an another program.
"""
def __init__(self, measurement_interface, args, **kwargs):
super(TuningRunManager, self).__init__(measurement_interface, args, **kwargs)
self.init()
self.tuning_run.state = 'RUNNING'
self.commit(force=True)
self.search_driver.external_main_begin()
def get_next_desired_result(self):
"""
Returns a opentuner.resultsdb.DesiredResult that should be tested next.
"""
dr = self.measurement_driver.query_pending_desired_results().first()
def main(args, cfg, ss):
logging.basicConfig(level=logging.INFO)
manipulator = ConfigurationManipulator()
params = cfg.getAllParameters()
print "\nFeature variables...."
for key in params.keys():
print "\t", key
manipulator.add_parameter(cfg.getParameter(key))
mi = StreamJitMI(args, ss, manipulator, FixedInputManager(),
MinimizeTime())
m = TuningRunMain(mi, args)
m.main()
def main(args, cfg, ss):
logging.basicConfig(level=logging.INFO)
manipulator = ConfigurationManipulator()
params = cfg.getAllParameters()
#print "\nFeature variables...."
for key in params.keys():
#print "\t", key
manipulator.add_parameter(cfg.getParameter(key))
mi = StreamJitMI(args, ss, manipulator, FixedInputManager(),
MinimizeTime())
m = TuningRunMain(mi, args)
m.main()
def main(interface, args, *pargs, **kwargs):
if inspect.isclass(interface):
interface = interface(args=args, *pargs, **kwargs)
return TuningRunMain(interface, args).main()
def main(args, cfg, jvmOptions):
logging.basicConfig(level=logging.INFO)
manipulator = ConfigurationManipulator()
params = dict(cfg.items() + jvmOptions.items())
#print "\nFeature variables...."
for key in params.keys():
#print "\t", key
manipulator.add_parameter(params.get(key))
mi = StreamJitMI(args,jvmOptions, manipulator, FixedInputManager(),
MinimizeTime())
m = TuningRunMain(mi, args)
m.main()
def main(cls, args, *pargs, **kwargs):
from opentuner.tuningrunmain import TuningRunMain
return TuningRunMain(cls(args, *pargs, **kwargs), args).main()
from opentuner.search import technique, bandittechniques, differentialevolution, evolutionarytechniques, simplextechniques
technique.register(bandittechniques.AUCBanditMetaTechnique([
sjtechniques.FixedTechnique(seed_configs),
differentialevolution.DifferentialEvolutionAlt(),
evolutionarytechniques.UniformGreedyMutation(),
evolutionarytechniques.NormalGreedyMutation(mutation_rate=0.3),
simplextechniques.RandomNelderMead(),
sjtechniques.ForceRemove(),
sjtechniques.ForceFuse(),
sjtechniques.ForceUnbox(),
sjtechniques.ForceEqualDivision(),
sjtechniques.CrossSocketBeforeHyperthreadingAffinity(),
], name = "StreamJITBandit"))
mi = StreamJITMI(args, cfg, jvm_options, manipulator, FixedInputManager(), MinimizeTime())
m = TuningRunMain(mi, args)
m.main()