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

Updated Slurm Launcher #741

Open
wants to merge 8 commits into
base: v1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
9 changes: 7 additions & 2 deletions smartsim/_core/launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,22 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from __future__ import annotations

import abc
import typing as t

from ...entity import SmartSimEntity
from ...error import AllocationError, LauncherError, SSUnsupportedError
from ...settings import SettingsBase
from .step import Step
from .step_info import StepInfo, UnmanagedStepInfo
from .step_mapping import StepMap, StepMapping
from .task_manager import TaskManager

if t.TYPE_CHECKING:
from smartsim._core.launcher.stepMapping import StepMap
from smartsim.entity.entity import SmartSimEntity
from smartsim.settings.launchSettings import SettingsBase

Check warning on line 41 in smartsim/_core/launcher/launcher.py

View check run for this annotation

Codecov / codecov/patch

smartsim/_core/launcher/launcher.py#L39-L41

Added lines #L39 - L41 were not covered by tests


class Launcher(abc.ABC): # pragma: no cover
"""Abstract base class of all launchers
Expand Down
9 changes: 7 additions & 2 deletions smartsim/_core/launcher/slurm/slurm_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
import typing as t
from shutil import which

from smartsim._core.launcher_.slurm.slurm_commands import sacct, scancel, sstat
from smartsim._core.launcher_.slurm.slurm_parser import (
parse_sacct,
parse_sstat_nodes,
parse_step_id_from_sacct,
)

from ....error import LauncherError
from ....log import get_logger
from ....settings import (
Expand All @@ -53,8 +60,6 @@
Step,
)
from ..step_info import SlurmStepInfo, StepInfo
from .slurm_commands import sacct, scancel, sstat
from .slurm_parser import parse_sacct, parse_sstat_nodes, parse_step_id_from_sacct

logger = get_logger(__name__)

Expand Down
10 changes: 8 additions & 2 deletions smartsim/_core/launcher/step/alps_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,25 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


from __future__ import annotations

import os
import shutil
import typing as t
from shlex import split as sh_split

from ....entity import Application, FSNode
from ....error import AllocationError
from ....log import get_logger
from ....settings import AprunSettings, RunSettings, Singularity
from ....settings import Singularity
from .step import Step, proxyable_launch_cmd

logger = get_logger(__name__)

if t.TYPE_CHECKING:
from smartsim.entity import Application, FSNode
from smartsim.settings import AprunSettings, RunSettings


class AprunStep(Step):
def __init__(
Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions smartsim/_core/launcher_/shell/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# BSD 2-Clause License
#
# Copyright (c) 2021-2024, Hewlett Packard Enterprise
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 changes: 25 additions & 0 deletions smartsim/_core/launcher_/slurm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# BSD 2-Clause License
#
# Copyright (c) 2021-2024, Hewlett Packard Enterprise
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading
Loading