Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tentatively rename allow_oversubscribe, document #665

Merged
merged 3 commits into from
Sep 22, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/FAQ.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Make sure that the ``EVAL_GEN_TAG`` is specified and not just ``persistent=True`
**I keep getting: "Not enough processors per worker to honor arguments." when
using the Executor. Can I submit tasks to allocated processors anyway?**

It is possible that you have set `allow_oversubscribe` to False when setting
It is possible that you have set `enforce_worker_core_bounds` to True when setting
up the Executor. Also, the resource manager can be completely disabled
with::

Expand Down
4 changes: 2 additions & 2 deletions docs/data_structures/libE_specs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Specifications for libEnsemble::
The total number of resource sets. Resources will be divided into this number.
Default: None. If None, resources will be divided by workers (excluding
zero_resource_workers).
'allow_oversubscribe' [boolean]:
If true, the Executor will permit submission of tasks with a
'enforce_worker_core_bounds' [boolean]:
If false, the Executor will permit submission of tasks with a
higher processor count than the CPUs available to the worker as
detected by auto_resources. Larger node counts are not allowed.
When auto_resources is off, this argument is ignored.
Expand Down
4 changes: 0 additions & 4 deletions libensemble/executors/mpi_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ class MPIExecutor(Executor):
"""The MPI executor can create, poll and kill runnable MPI tasks
"""

# SH TODO: Whether to still be custom_info or separate variables as now quite limited.
# only reason not to is prob that it may make people use them unnecesarily.
# I think allow_oversubscribe should stay as MPIExecutor variable
# __init__(self, allow_oversubscribe=True, custom_info={}):
def __init__(self, custom_info={}):
"""Instantiate a new MPIExecutor instance.

Expand Down
2 changes: 1 addition & 1 deletion libensemble/resources/mpi_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def get_resources(resources, num_procs=None, num_nodes=None,
"Requested {}. Only {} available".
format(num_nodes, local_node_count))

if not gresources.allow_oversubscribe:
if gresources.enforce_worker_core_bounds:
rassert(ranks_per_node <= cores_avail_per_node,
"Not enough processors on a node to honor arguments. "
"Requested {}. Only {} available".
Expand Down
8 changes: 7 additions & 1 deletion libensemble/resources/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ def __init__(self, libE_specs, top_level_dir=None):
If supplied gives (physical cores, logical cores) for the nodes. If not supplied,
this will be auto-detected.

enforce_worker_core_bounds: boolean, optional
If True, then libEnsemble's executor will raise an exception on detecting that
the worker has been instructed to launch tasks with the number of requested processes
being excessive to the number of cores allocated to that worker, or not enough
processes were requested to satisfy allocated cores.

node_file: String, optional
If supplied, give the name of a file in the run directory to use as a node-list
for use by libEnsemble. Defaults to a file named 'node_list'. If the file does
Expand Down Expand Up @@ -162,7 +168,7 @@ def __init__(self, libE_specs, top_level_dir=None):
self.num_resource_sets = libE_specs.get('num_resource_sets', None)

# SH TODO: Where to set this - put back here for now as easier than passing via executor.
self.allow_oversubscribe = libE_specs.get('allow_oversubscribe', True)
self.enforce_worker_core_bounds = libE_specs.get('enforce_worker_core_bounds', True)

if self.central_mode:
logger.debug('Running in central mode')
Expand Down
2 changes: 1 addition & 1 deletion libensemble/tests/regression_tests/test_mpi_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
comms = libE_specs['comms']

libE_specs['central_mode'] = True
libE_specs['allow_oversubscribe'] = False
libE_specs['enforce_worker_core_bounds'] = False

# To allow visual checking - log file not used in test
log_file = 'ensemble_mpi_runners_comms_' + str(comms) + '_wrks_' + str(nworkers) + '.log'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
comms = libE_specs['comms']

libE_specs['central_mode'] = True
libE_specs['allow_oversubscribe'] = False
libE_specs['enforce_worker_core_bounds'] = False

# To allow visual checking - log file not used in test
log_file = 'ensemble_mpi_runners_subnode_comms_' + str(comms) + '_wrks_' + str(nworkers) + '.log'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
'node_file': node_file} # Name of file containing a node-list

libE_specs['central_mode'] = True
libE_specs['allow_oversubscribe'] = False
libE_specs['enforce_worker_core_bounds'] = False
libE_specs['resource_info'] = custom_resources

# Create executor and register sim to it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
comms = libE_specs['comms']

libE_specs['central_mode'] = True
libE_specs['allow_oversubscribe'] = False
libE_specs['enforce_worker_core_bounds'] = False

# To allow visual checking - log file not used in test
log_file = 'ensemble_mpi_runners_supernode_uneven_comms_' + str(comms) + '_wrks_' + str(nworkers) + '.log'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

libE_specs['zero_resource_workers'] = [1]
libE_specs['central_mode'] = True
libE_specs['allow_oversubscribe'] = False
libE_specs['enforce_worker_core_bounds'] = False

# To allow visual checking - log file not used in test
log_file = 'ensemble_mpi_runners_zrw_subnode_uneven_comms_' + str(comms) + '_wrks_' + str(nworkers) + '.log'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

libE_specs['zero_resource_workers'] = [1]
libE_specs['central_mode'] = True
libE_specs['allow_oversubscribe'] = False
libE_specs['enforce_worker_core_bounds'] = False

# To allow visual checking - log file not used in test
log_file = 'ensemble_mpi_runners_zrw_supernode_uneven_comms_' + str(comms) + '_wrks_' + str(nworkers) + '.log'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

libE_specs['zero_resource_workers'] = [1]
libE_specs['central_mode'] = True
libE_specs['allow_oversubscribe'] = False
libE_specs['enforce_worker_core_bounds'] = False

# To allow visual checking - log file not used in test
log_file = 'ensemble_zrw_comms_' + str(comms) + '_wrks_' + str(nworkers) + '.log'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

libE_specs['zero_resource_workers'] = [1]
libE_specs['central_mode'] = True
libE_specs['allow_oversubscribe'] = False
libE_specs['enforce_worker_core_bounds'] = False

# To allow visual checking - log file not used in test
log_file = 'ensemble_zrw_subnode_comms_' + str(comms) + '_wrks_' + str(nworkers) + '.log'
Expand Down
4 changes: 2 additions & 2 deletions libensemble/tests/scaling_tests/forces/run_libe_forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
# Create executor and register sim to it.
if USE_BALSAM:
from libensemble.executors.balsam_executor import BalsamMPIExecutor
exctr = BalsamMPIExecutor() # Use allow_oversubscribe=False to prevent oversubscription
exctr = BalsamMPIExecutor()
else:
from libensemble.executors.mpi_executor import MPIExecutor
exctr = MPIExecutor() # Use allow_oversubscribe=False to prevent oversubscription
exctr = MPIExecutor()
exctr.register_calc(full_path=sim_app, calc_type='sim')

# Note: Attributes such as kill_rate are to control forces tests, this would not be a typical parameter.
Expand Down
2 changes: 1 addition & 1 deletion libensemble/tools/fields_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
libE_spec_gen_dir_keys

allowed_libE_spec_keys = ['abort_on_exception', #
'allow_oversubscribe', #
'enforce_worker_core_bounds', #
'authkey', #
'disable_resource_manager', #
'central_mode', #
Expand Down