Skip to content

Commit

Permalink
Fixup docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
shuds13 committed Apr 28, 2023
1 parent 22bac74 commit 798152f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion libensemble/executors/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@


class ExecutorException(Exception):
"Raised for any exception in the Executor"
"""Raised for any exception in the Executor"""


class TimeoutExpired(Exception):
Expand Down
9 changes: 5 additions & 4 deletions libensemble/executors/mpi_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def _set_gpu_env_var(self, wresources, task, gpus_per_node, gpus_env):
task._add_to_env(gpus_env, slot_list)

def _local_runner_set_gpus(self, task, wresources, extra_args, gpus_per_node, ppn):
"""Set default GPU setting for MPI runner"""
if self.default_gpu_arg is not None:
arg_type = self.default_gpu_arg_type
gpu_value = gpus_per_node // ppn if arg_type == "option_gpus_per_task" else gpus_per_node
Expand All @@ -133,8 +134,8 @@ def _local_runner_set_gpus(self, task, wresources, extra_args, gpus_per_node, pp
self._set_gpu_env_var(wresources, task, gpus_per_node, gpus_env)
return extra_args

def _assign_to_slots(self, task, resources, nprocs, nnodes, ppn, ngpus, extra_args, match_procs_to_gpus):
"""Assign GPU resources to slots
def _assign_gpus(self, task, resources, nprocs, nnodes, ppn, ngpus, extra_args, match_procs_to_gpus):
"""Assign GPU resources to slots, limited by ngpus if present.
GPUs will be assigned using the slot count and GPUs per slot (from resources).
If ``match_procs_to_gpus`` is True, then MPI processor/node configuration will
Expand Down Expand Up @@ -239,7 +240,7 @@ def get_mpi_specs(
# if no_config_set, make match_procs_to_gpus default.
if no_config_set:
match_procs_to_gpus = True
nprocs, nnodes, ppn, extra_args = self._assign_to_slots(
nprocs, nnodes, ppn, extra_args = self._assign_gpus(
task, resources, nprocs, nnodes, ppn, ngpus, extra_args, match_procs_to_gpus
)

Expand Down Expand Up @@ -466,7 +467,7 @@ def get_mpi_specs(
# if no_config_set, make match_procs_to_gpus default.
if no_config_set:
match_procs_to_gpus = True
nprocs, nnodes, ppn, extra_args = self._assign_to_slots(
nprocs, nnodes, ppn, extra_args = self._assign_gpus(
task, resources, nprocs, nnodes, ppn, ngpus, extra_args, match_procs_to_gpus
)

Expand Down
2 changes: 1 addition & 1 deletion libensemble/gen_funcs/aposmm_localopt_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@


class APOSMMException(Exception):
"Raised for any exception in APOSMM"
"""Raised for any exception in APOSMM"""


class ConvergedMsg(object):
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 @@ -9,7 +9,7 @@


class MPIResourcesException(Exception):
"Resources module exception."
"""Resources module exception"""


def rassert(test: Optional[Union[int, bool]], *args) -> None:
Expand Down
2 changes: 1 addition & 1 deletion libensemble/resources/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


class PlatformException(Exception):
"Platform module exception."
"""Platform module exception"""


class Platform(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion libensemble/resources/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


class ResourcesException(Exception):
"Resources module exception."
"""Resources module exception"""


class Resources:
Expand Down
4 changes: 2 additions & 2 deletions libensemble/tests/unit_tests/test_libE_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@


class MPIAbortException(Exception):
"Raised when mock mpi abort is called"
"""Raised when mock mpi abort is called"""


class MPISendException(Exception):
"Raised when mock mpi abort is called"
"""Raised when mock mpi abort is called"""


class Fake_MPI:
Expand Down

0 comments on commit 798152f

Please sign in to comment.