From 22182c984878c702e803f84ba60446e724298b16 Mon Sep 17 00:00:00 2001 From: Amanda Richardson Date: Mon, 11 Mar 2024 16:32:56 -0500 Subject: [PATCH 1/5] depricate initial push --- doc/api/smartsim_api.rst | 12 ++++++-- smartsim/settings/mpirunSettings.py | 41 -------------------------- smartsim/slurm.py | 45 ----------------------------- tests/test_slurm_get_alloc.py | 2 +- tests/test_slurm_validation.py | 2 +- 5 files changed, 11 insertions(+), 91 deletions(-) delete mode 100644 smartsim/settings/mpirunSettings.py delete mode 100644 smartsim/slurm.py diff --git a/doc/api/smartsim_api.rst b/doc/api/smartsim_api.rst index adf7081ec..a5ad2b612 100644 --- a/doc/api/smartsim_api.rst +++ b/doc/api/smartsim_api.rst @@ -511,12 +511,18 @@ Slurm ===== -.. currentmodule:: smartsim.slurm +.. currentmodule:: smartsim.wlm.slurm .. autosummary:: get_allocation release_allocation - -.. automodule:: smartsim.slurm + validate + get_default_partition + get_hosts + get_queue + get_tasks + get_tasks_per_node + +.. automodule:: smartsim.wlm.slurm :members: diff --git a/smartsim/settings/mpirunSettings.py b/smartsim/settings/mpirunSettings.py deleted file mode 100644 index 994d62bba..000000000 --- a/smartsim/settings/mpirunSettings.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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. - -from warnings import simplefilter, warn - -from ..log import get_logger - -# pylint: disable-next=unused-import -from .mpiSettings import MpiexecSettings, MpirunSettings, OrterunSettings - -logger = get_logger(__name__) - -simplefilter("once", DeprecationWarning) -warn( - "mpirunSettings will be deprecated; use mpiSettings instead.", - DeprecationWarning, - stacklevel=2, -) diff --git a/smartsim/slurm.py b/smartsim/slurm.py deleted file mode 100644 index 6a32d0213..000000000 --- a/smartsim/slurm.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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. - - -from warnings import simplefilter, warn - -# pylint: disable-next=unused-import -from .wlm.slurm import ( - _get_alloc_cmd, - _get_system_partition_info, - get_allocation, - get_default_partition, - release_allocation, - validate, -) - -simplefilter("once", category=DeprecationWarning) -DEPRECATION_MSG = ( - "`smartsim.slurm` has been deprecated and will be removed in a future release.\n" - "Please update your code to use `smartsim.wlm.slurm`" -) -warn(DEPRECATION_MSG, category=DeprecationWarning, stacklevel=2) diff --git a/tests/test_slurm_get_alloc.py b/tests/test_slurm_get_alloc.py index aa12ce362..561e3d984 100644 --- a/tests/test_slurm_get_alloc.py +++ b/tests/test_slurm_get_alloc.py @@ -26,7 +26,7 @@ import pytest -from smartsim.slurm import _get_alloc_cmd +from smartsim.wlm.slurm import _get_alloc_cmd # The tests in this file belong to the group_b group pytestmark = pytest.mark.group_b diff --git a/tests/test_slurm_validation.py b/tests/test_slurm_validation.py index 02baddce6..7fd5fd886 100644 --- a/tests/test_slurm_validation.py +++ b/tests/test_slurm_validation.py @@ -28,7 +28,7 @@ import pytest from smartsim.error.errors import LauncherError -from smartsim.slurm import _get_system_partition_info, get_default_partition, validate +from smartsim.wlm.slurm import _get_system_partition_info, get_default_partition, validate # The tests in this file belong to the group_b group pytestmark = pytest.mark.group_b From c8f7a098f668ef25a4abb75b5568701f4a8b6ec7 Mon Sep 17 00:00:00 2001 From: Amanda Richardson Date: Mon, 11 Mar 2024 16:36:32 -0500 Subject: [PATCH 2/5] small doc format --- smartsim/wlm/slurm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smartsim/wlm/slurm.py b/smartsim/wlm/slurm.py index 9308eea98..098056c9e 100644 --- a/smartsim/wlm/slurm.py +++ b/smartsim/wlm/slurm.py @@ -60,12 +60,12 @@ def get_allocation( The options can be used to pass extra settings to the workload manager such as the following for Slurm: - - nodelist="nid00004" + - nodelist="nid00004" For arguments without a value, pass None or and empty string as the value. For Slurm: - - exclusive=None + - exclusive=None :param nodes: number of nodes for the allocation, defaults to 1 :type nodes: int, optional From 9dfd3c81c717ff3b292bfca67967140f1887703a Mon Sep 17 00:00:00 2001 From: Amanda Richardson Date: Tue, 12 Mar 2024 12:43:41 -0500 Subject: [PATCH 3/5] make black --- tests/test_slurm_validation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_slurm_validation.py b/tests/test_slurm_validation.py index 7fd5fd886..fbb6406c6 100644 --- a/tests/test_slurm_validation.py +++ b/tests/test_slurm_validation.py @@ -28,7 +28,11 @@ import pytest from smartsim.error.errors import LauncherError -from smartsim.wlm.slurm import _get_system_partition_info, get_default_partition, validate +from smartsim.wlm.slurm import ( + _get_system_partition_info, + get_default_partition, + validate, +) # The tests in this file belong to the group_b group pytestmark = pytest.mark.group_b From d82269d3814007347a5e4510c0481eff61f259e2 Mon Sep 17 00:00:00 2001 From: Amanda Richardson Date: Wed, 13 Mar 2024 14:50:20 -0700 Subject: [PATCH 4/5] edit to changelog --- doc/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/changelog.rst b/doc/changelog.rst index a45a30850..c009a7f9b 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -18,6 +18,7 @@ To be released at some future point in time Description +- Remove deprecated SmartSim modules - SmartSim Documentation refactor - Update the version of Redis from `7.0.4` to `7.2.4` - Update Experiment API typing @@ -25,6 +26,7 @@ Description Detailed Notes +- Removed deprecated SmartSim modules: slurm and mpirunSettings. - Implemented new structure of SmartSim documentation. Added examples images and further detail of SmartSim components. - Update Redis version to `7.2.4`. This change fixes an issue in the Redis @@ -36,6 +38,7 @@ Detailed Notes (SmartSim-PR-PR504_) - Update the generic `t.Any` typehints in Experiment API. (SmartSim-PR501_) +.. _SmartSim-PR514: https://github.com/CrayLabs/SmartSim/pull/514 .. _SmartSim-PR463: https://github.com/CrayLabs/SmartSim/pull/463 .. _SmartSim-PR507: https://github.com/CrayLabs/SmartSim/pull/507 .. _SmartSim-PR504: https://github.com/CrayLabs/SmartSim/pull/504 From eb2046894f1a5364a35b0ca4ca016d999c19e8ca Mon Sep 17 00:00:00 2001 From: Amanda Richardson Date: Wed, 13 Mar 2024 14:54:52 -0700 Subject: [PATCH 5/5] small edit to changelog --- doc/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.rst b/doc/changelog.rst index c009a7f9b..85e3994fa 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -27,6 +27,7 @@ Description Detailed Notes - Removed deprecated SmartSim modules: slurm and mpirunSettings. + (SmartSim-PR514_) - Implemented new structure of SmartSim documentation. Added examples images and further detail of SmartSim components. - Update Redis version to `7.2.4`. This change fixes an issue in the Redis