def start(config): _config = run.startup_sequence(config) # SingleSampler hardcodes nworkers to 1 and ignores user input nworkers = 1 runner = run.single_sampler(_config) H, persis_info, _ = runner.run() if _config.is_manager: filename = os.path.splitext(config)[0] history_file_name = "H_sample_" + filename + ".npy" save_libE_output(H, persis_info, history_file_name, nworkers, mess='Ran start point')
def configuration(config): _config = run.startup_sequence(config) sampler_type = _config.options.NAME try: nworkers = _config.options.nworkers except AttributeError: # Sampler defaults to 1 worker if not set nworkers = 1 runner = run.sample_modes[sampler_type](_config) H, persis_info, _ = runner.run() if _config.is_manager: filename = os.path.splitext(config)[0] history_file_name = "H_sample_" + filename + ".npy" save_libE_output(H, persis_info, history_file_name, nworkers, mess='Sampler completed')
def configuration(config): _config = run.startup_sequence(config) software = _config.options.NAME try: nworkers = _config.options.nworkers except AttributeError: # Any method that doesn't allow user specification must use 2 workers nworkers = 2 runner = run.run_modes[software](_config) H, persis_info, _ = runner.run() if _config.is_manager: filename = os.path.splitext(config)[0] history_file_name = "H_" + filename + ".npy" save_libE_output(H, persis_info, history_file_name, nworkers, mess='Run completed') if software in _final_result: _final_result[software](H)
'stop_partial_fvec_eval': True } # Should alloc preempt evals } # end_alloc_specs_rst_tag persis_info = add_unique_random_streams(persis_info, nworkers + 1) persis_info_safe = deepcopy(persis_info) exit_criteria = {'sim_max': budget, 'elapsed_wallclock_time': 300} # Perform the run H, persis_info, flag = libE(sim_specs, gen_specs, exit_criteria, persis_info, alloc_specs, libE_specs) if is_master: assert flag == 0 save_libE_output(H, persis_info, __file__, nworkers) # Perform the run but not stopping on NaNs alloc_specs['user'].pop('stop_on_NaNs') persis_info = deepcopy(persis_info_safe) H, persis_info, flag = libE(sim_specs, gen_specs, exit_criteria, persis_info, alloc_specs, libE_specs) if is_master: assert flag == 0 # Perform the run also not stopping on partial fvec evals alloc_specs['user'].pop('stop_partial_fvec_eval') persis_info = deepcopy(persis_info_safe) H, persis_info, flag = libE(sim_specs, gen_specs, exit_criteria, persis_info, alloc_specs, libE_specs) if is_master:
gen_specs['user'].update({ 'grtol': 1e-4, 'gatol': 1e-4, 'frtol': 1e-15, 'fatol': 1e-15 }) persis_info = add_unique_random_streams(persis_info, nworkers + 1) exit_criteria = {'sim_max': budget} # Perform the run H, persis_info, flag = libE(sim_specs, gen_specs, exit_criteria, persis_info, libE_specs=libE_specs) if is_master: assert flag == 0 assert len(H) >= budget # Calculating the Jacobian at the best point (though this information was not used by pounders) from libensemble.sim_funcs.chwirut1 import EvaluateJacobian J = EvaluateJacobian(H['x'][np.argmin(H['f'])]) assert np.linalg.norm(J) < 2000 outname = os.path.splitext(__file__)[0] + '_sub_comm' + str( sub_comm_number) save_libE_output(H, persis_info, outname, nworkers)