Skip to content
Open
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
8 changes: 7 additions & 1 deletion rsopt/configuration/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ def create_executor_arguments(setup: Setup, is_parallel: bool) -> dict:
# Really creates Executor.submit() arguments
if is_parallel:
args = {
'num_procs': setup.setup.get('cores', 1),
'num_procs': None if setup.setup.get('gpu', False) else setup.setup.get('cores', 1),
'num_nodes': None, # No user interface right now
'procs_per_node': None, # No user interface right now
'machinefile': None, # Add in setup.machinefile if user wants to control
'app_args': setup.format_task_string(is_parallel),
'hyperthreads': False, # Add in setup.hyperthreads if this is needed
'wait_on_start': True,
'auto_assign_gpus': setup.setup.get('gpu', False),
'match_procs_to_gpus': setup.setup.get('gpu', False),
# 'app_name': None, # Handled at optimizer setup
# 'stdout': None, # Handled at optimizer setup
# 'stderr': None, # Handled at optimizer setup
Expand All @@ -42,6 +45,9 @@ def create_executor_arguments(setup: Setup, is_parallel: bool) -> dict:
args = {
'app_args': setup.format_task_string(is_parallel)
}
# TODO: Should there really be this kind of hidden interface to override executor setup?
# for key, value in args.items():
# args[key] = setup.setup.get(key, value)

# Cannot be overridden
args['calc_type'] = 'sim'
Expand Down
1 change: 1 addition & 0 deletions rsopt/package_data/setup_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
- ignored_files
- shifter_image
- code_arguments
- gpu
5 changes: 5 additions & 0 deletions rsopt/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ def __call__(self, H, persis_info, sim_specs, libE_info):
# NOTE: Right now f is not passed to the objective function. Would need to go inside J. Or pass J into
# function job.execute(**kwargs)

if job.executor_args.get('auto_assign_gpus'):
from libensemble.tools.test_support import check_gpu_setting
if self.log.level == logging.DEBUG:
self.log.debug(check_gpu_setting(task, assert_setting=False, print_setting=True))

if halt_job_sequence:
break

Expand Down