Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/examples/calling_scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ paired with a gest-api ``simulator`` callable.
:language: python
:caption: tests/regression_tests/test_aposmm_nlopt.py
:linenos:
:end-before: # Perform the run
:end-at: H, _, _ = workflow.run(sim_max=3000, wallclock_max=600)

.. _regression tests: https://github.com/Libensemble/libensemble/tree/develop/libensemble/tests/regression_tests
22 changes: 11 additions & 11 deletions docs/function_guides/allocator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,20 @@ Deprecated Allocation Functions

- Functions that managed non-persistent generators (``fast_alloc``, ``fast_alloc_and_pausing``,
``only_one_gen_alloc``) should be replaced with
:func:`~libensemble.alloc_funcs.give_sim_work_first.give_sim_work_first` or the default
:func:`~libensemble.alloc_funcs.start_only_persistent.only_persistent_gens` with a
:func:`~give_sim_work_first.give_sim_work_first` or the default
:func:`~start_only_persistent.only_persistent_gens` with a
persistent generator.
- APOSMM-adjacent functions (``start_persistent_local_opt_gens``, ``start_fd_persistent``)
should migrate to
:func:`~libensemble.alloc_funcs.persistent_aposmm_alloc.persistent_aposmm_alloc`.
:func:`~persistent_aposmm_alloc.persistent_aposmm_alloc`.
- ``inverse_bayes_allocf`` should be replaced with the default ``only_persistent_gens``
combined with a persistent generator that implements the required batch/subbatch logic.

fast_alloc
----------
.. deprecated:: 2.0
Use :func:`~libensemble.alloc_funcs.give_sim_work_first.give_sim_work_first` or the default
:func:`~libensemble.alloc_funcs.start_only_persistent.only_persistent_gens` instead.
Use :func:`~give_sim_work_first.give_sim_work_first` or the default
:func:`~start_only_persistent.only_persistent_gens` instead.
Will be removed in libEnsemble 2.1.

.. automodule:: fast_alloc
Expand All @@ -234,7 +234,7 @@ fast_alloc
fast_alloc_and_pausing
----------------------
.. deprecated:: 2.0
Use the default :func:`~libensemble.alloc_funcs.start_only_persistent.only_persistent_gens`
Use the default :func:`~start_only_persistent.only_persistent_gens`
with a persistent generator instead. Will be removed in libEnsemble 2.1.

.. automodule:: fast_alloc_and_pausing
Expand All @@ -244,9 +244,9 @@ fast_alloc_and_pausing
only_one_gen_alloc
------------------
.. deprecated:: 2.0
Use :func:`~libensemble.alloc_funcs.give_sim_work_first.give_sim_work_first` with
Use :func:`~give_sim_work_first.give_sim_work_first` with
``num_active_gens=1``, or the default
:func:`~libensemble.alloc_funcs.start_only_persistent.only_persistent_gens` instead.
:func:`~start_only_persistent.only_persistent_gens` instead.
Will be removed in libEnsemble 2.1.

.. automodule:: only_one_gen_alloc
Expand All @@ -256,7 +256,7 @@ only_one_gen_alloc
start_fd_persistent
-------------------
.. deprecated:: 2.0
Use the default :func:`~libensemble.alloc_funcs.start_only_persistent.only_persistent_gens`
Use the default :func:`~start_only_persistent.only_persistent_gens`
with a persistent generator instead. Will be removed in libEnsemble 2.1.

.. automodule:: start_fd_persistent
Expand All @@ -266,7 +266,7 @@ start_fd_persistent
start_persistent_local_opt_gens
-------------------------------
.. deprecated:: 2.0
Use :func:`~libensemble.alloc_funcs.persistent_aposmm_alloc.persistent_aposmm_alloc`
Use :func:`~persistent_aposmm_alloc.persistent_aposmm_alloc`
instead. Will be removed in libEnsemble 2.1.

.. automodule:: start_persistent_local_opt_gens
Expand All @@ -276,7 +276,7 @@ start_persistent_local_opt_gens
inverse_bayes_allocf
--------------------
.. deprecated:: 2.0
Use the default :func:`~libensemble.alloc_funcs.start_only_persistent.only_persistent_gens`
Use the default :func:`~start_only_persistent.only_persistent_gens`
with a persistent generator instead. Will be removed in libEnsemble 2.1.

.. automodule:: inverse_bayes_allocf
Expand Down
2 changes: 1 addition & 1 deletion docs/libe_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Running an Ensemble
===================

.. autoclass:: libensemble.ensemble.Ensemble()
.. autoclass:: libensemble.ensemble.Ensemble
:members:
:no-undoc-members:
2 changes: 2 additions & 0 deletions docs/nitpicky
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ py:class comm
py:class communicator

# Additional nitpicky targets from recent Sphinx warnings
py:class ..
py:class libensemble._deprecation.LibEnsembleDeprecationWarning
py:class libensemble.resources.platforms.Lumi
py:class libensemble.resources.platforms.LumiGPU
py:class numpy._typing._array_like._ScalarT
Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/aurora.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ simulations for each worker:

.. code-block:: python

# Instruct libEnsemble to exit after this many simulations
ensemble.exit_criteria = ExitCriteria(sim_max=nsim_workers * 2)
# Run ensemble; exit after this many simulations
ensemble.run(sim_max=nsim_workers * 2)

Now grab an interactive session on two nodes (or use the batch script at
``../submission_scripts/submit_pbs_aurora.sh``)::
Expand Down
5 changes: 2 additions & 3 deletions docs/tutorials/aposmm_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ libEnsemble classes, APOSMM, and our simulator callable:
from libensemble import Ensemble
from libensemble.gen_classes import APOSMM
from gest_api.vocs import VOCS
from libensemble.specs import SimSpecs, GenSpecs, ExitCriteria
from libensemble.specs import SimSpecs, GenSpecs

APOSMM supports a wide variety of external optimizers. The ``rc.aposmm_optimizers``
statement above indicates to APOSMM which optimization method package to use,
Expand Down Expand Up @@ -156,9 +156,8 @@ Finally, we configure the simulation function, exit criteria, and run the workfl
:linenos:

workflow.sim_specs = SimSpecs(simulator=six_hump_camel_func, vocs=vocs)
workflow.exit_criteria = ExitCriteria(sim_max=2000)

H, _, _ = workflow.run()
H, _, _ = workflow.run(sim_max=2000)

if workflow.is_manager:
# We can map our variables back to an array for easy printing
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/executor_forces_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ exit after running eight simulations, and finally we :doc:`run<../libe_module>`
.. literalinclude:: ../../libensemble/tests/functionality_tests/test_executor_forces_tutorial.py
:language: python
:linenos:
:start-at: Instruct libEnsemble
:end-at: ensemble.run()
:start-at: # Run ensemble; exit after this many simulations
:end-at: ensemble.run(sim_max=8)
:lineno-start: 55

Exercise
Expand Down
11 changes: 4 additions & 7 deletions docs/tutorials/gpcam_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ If you wish to make your own functions based on the above, those can be imported
from pprint import pprint

from libensemble import Ensemble
from libensemble.specs import LibeSpecs, GenSpecs, SimSpecs, AllocSpecs, ExitCriteria
from libensemble.specs import LibeSpecs, GenSpecs, SimSpecs, AllocSpecs

# If importing from libensemble
from libensemble.gen_funcs.persistent_gpCAM import persistent_gpCAM
Expand Down Expand Up @@ -256,15 +256,12 @@ If you wish to make your own functions based on the above, those can be imported
user={"async_return": False}, # False = batch returns
)

exit_criteria = ExitCriteria(sim_max=num_batches * batch_size)

# Initialize and run the ensemble.
# Initialize the ensemble.
ensemble = Ensemble(
libE_specs=libE_specs,
sim_specs=sim_specs,
gen_specs=gen_specs,
alloc_specs=alloc_specs,
exit_criteria=exit_criteria,
)

At the end of our calling script we run the ensemble.
Expand All @@ -275,7 +272,7 @@ At the end of our calling script we run the ensemble.
cleanup()
ensemble.persis_info = {}

H, persis_info, flag = ensemble.run() # Start the ensemble. Blocks until completion.
H, persis_info, flag = ensemble.run(sim_max=num_batches * batch_size) # Start the ensemble. Blocks until completion.
ensemble.save_output("H_array", append_attrs=False) # Save H (history of all evaluated points) to file
pprint(H[["sim_id", "x", "f"]][:16]) # See first 16 results

Expand All @@ -293,7 +290,7 @@ To see how the accuracy of the surrogate model improves, we can use previously e
cleanup()
ensemble.persis_info = {}

H, persis_info, flag = ensemble.run()
H, persis_info, flag = ensemble.run(sim_max=num_batches * batch_size)
print(persis_info)

Viewing model progression
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/local_sine_tutorial/local_sine_tutorial_4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ libEnsemble should stop execution in :ref:`ExitCriteria<datastruct-exit-criteria
:language: python
:linenos:
:lineno-start: 26
:start-at: exit_criteria = ExitCriteria
:end-at: exit_criteria = ExitCriteria
:start-at: ensemble = Ensemble
:end-at: ensemble.run

Now we're ready to write our libEnsemble :doc:`libE<../../programming_libE>`
function call. :ref:`ensemble.H<funcguides-history>` is the final version of
Expand Down
9 changes: 3 additions & 6 deletions docs/tutorials/xopt_bayesian_gen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Imports

from libensemble import Ensemble
from libensemble.alloc_funcs.start_only_persistent import only_persistent_gens as alloc_f
from libensemble.specs import AllocSpecs, ExitCriteria, GenSpecs, LibeSpecs, SimSpecs
from libensemble.specs import AllocSpecs, GenSpecs, LibeSpecs, SimSpecs

Simulator Function
------------------
Expand Down Expand Up @@ -93,17 +93,15 @@ The simulator is a simple callable function that takes a dictionary of inputs an
)

alloc_specs = AllocSpecs(alloc_f=alloc_f)
exit_criteria = ExitCriteria(sim_max=12)

workflow = Ensemble(
libE_specs=libE_specs,
sim_specs=sim_specs,
alloc_specs=alloc_specs,
gen_specs=gen_specs,
exit_criteria=exit_criteria,
)

H, _, _ = workflow.run()
H, _, _ = workflow.run(sim_max=12)

if workflow.is_manager:
print(f"Completed {len(H)} simulations")
Expand Down Expand Up @@ -158,10 +156,9 @@ Reset generator and change to libEnsemble-style simulator:
sim_specs=sim_specs,
alloc_specs=alloc_specs,
gen_specs=gen_specs,
exit_criteria=exit_criteria,
)

H, _, _ = workflow.run()
H, _, _ = workflow.run(sim_max=12)

if workflow.is_manager:
print(f"Completed {len(H)} simulations")
Expand Down
24 changes: 21 additions & 3 deletions install/install_minq.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
#!/usr/bin/env bash

set -euo pipefail

# IBCDFO pins the exact MINQ commit it supports, and refuses to run (via
# sys.exit) if the MINQ clone is at any other commit. Read the required SHA
# from the installed ibcdfo package rather than hardcoding it here, so that
# bumping ibcdfo in pixi.lock can never silently desynchronize the two.
MINQ_COMMIT=$(python -c "
import pathlib, ibcdfo
print((pathlib.Path(ibcdfo.__file__).parent / 'PkgData' / 'REQUIRED_MINQ_COMMIT').read_text().strip())
")

if [ -z "$MINQ_COMMIT" ]; then
echo "ERROR: could not determine required MINQ commit from installed ibcdfo" >&2
exit 1
fi

echo "Installing MINQ at ibcdfo-required commit ${MINQ_COMMIT}"

git clone https://github.com/POptUS/MINQ
git -C MINQ checkout 7749b83645ea21e303a94e1200542f7028499bb8
git -C MINQ checkout "$MINQ_COMMIT"
pushd MINQ/py/minq5/
export PYTHONPATH="$PYTHONPATH:$(pwd)"
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
export PYTHONPATH="${PYTHONPATH:-}:$(pwd)"
echo "PYTHONPATH=$PYTHONPATH" >> "${GITHUB_ENV:-/dev/null}"
popd
2 changes: 1 addition & 1 deletion libensemble/alloc_funcs/fast_alloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info, li
"""
.. deprecated:: 2.0
``fast_alloc.give_sim_work_first`` is deprecated and will be removed in libEnsemble 2.1.
Use :func:`libensemble.alloc_funcs.give_sim_work_first.give_sim_work_first` or the
Use :func:`give_sim_work_first.give_sim_work_first` or the
default ``only_persistent_gens`` (with a persistent generator) instead.

This allocation function gives (in order) entries in ``H`` to idle workers
Expand Down
2 changes: 1 addition & 1 deletion libensemble/alloc_funcs/only_one_gen_alloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def ensure_one_active_gen(W, H, sim_specs, gen_specs, alloc_specs, persis_info,
"""
.. deprecated:: 2.0
``only_one_gen_alloc.ensure_one_active_gen`` is deprecated and will be removed in
libEnsemble 2.1. Use :func:`libensemble.alloc_funcs.give_sim_work_first.give_sim_work_first`
libEnsemble 2.1. Use :func:`give_sim_work_first.give_sim_work_first`
with ``num_active_gens=1``, or the default ``only_persistent_gens`` instead.

This allocation function gives (in order) entries in ``H`` to idle workers
Expand Down
2 changes: 1 addition & 1 deletion libensemble/alloc_funcs/start_persistent_local_opt_gens.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def start_persistent_local_opt_gens(W, H, sim_specs, gen_specs, alloc_specs, per
.. deprecated:: 2.0
``start_persistent_local_opt_gens.start_persistent_local_opt_gens`` is deprecated and
will be removed in libEnsemble 2.1. Use
:func:`libensemble.alloc_funcs.persistent_aposmm_alloc.persistent_aposmm_alloc` instead.
:func:`persistent_aposmm_alloc.persistent_aposmm_alloc` instead.

This allocation function will do the following:

Expand Down
Loading
Loading