@@ -50,9 +50,10 @@ class Ensemble:
5050 from libensemble import Ensemble
5151 from libensemble.gen_funcs.sampling import latin_hypercube_sample
5252 from libensemble.sim_funcs.simple_sim import norm_eval
53- from libensemble.specs import ExitCriteria, GenSpecs, SimSpecs
53+ from libensemble.specs import ExitCriteria, GenSpecs, LibeSpecs, SimSpecs
5454
55- sampling = Ensemble(parse_args=True)
55+ libE_specs = LibeSpecs(nworkers=4)
56+ sampling = Ensemble(libE_specs=libE_specs)
5657 sampling.sim_specs = SimSpecs(
5758 sim_f=norm_eval,
5859 inputs=["x"],
@@ -69,13 +70,17 @@ class Ensemble:
6970 )
7071
7172 sampling.add_random_streams()
72- sampling.exit_criteria = ExitCriteria(sim_max=101 )
73+ sampling.exit_criteria = ExitCriteria(sim_max=100 )
7374
7475 if __name__ == "__main__":
7576 sampling.run()
7677 sampling.save_output(__file__)
7778
78- Run the above example via ``python this_file.py -n 4`` (4 workers). The ``parse_args=True`` parameter
79+
80+ Run the above example via ``python this_file.py``.
81+
82+ Instead of using the libE_specs line, you can also use ``sampling = Ensemble(parse_args=True)``
83+ and run via ``python this_file.py -n 4`` (4 workers). The ``parse_args=True`` parameter
7984 instructs the Ensemble class to read command-line arguments.
8085
8186 Configure by:
0 commit comments