From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9E05442D17; Wed, 21 Jun 2023 20:28:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A9C64068E; Wed, 21 Jun 2023 20:28:06 +0200 (CEST) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by mails.dpdk.org (Postfix) with ESMTP id 579624003C for ; Wed, 21 Jun 2023 20:28:04 +0200 (CEST) Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3a0423ea749so1179281b6e.0 for ; Wed, 21 Jun 2023 11:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1687372083; x=1689964083; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6v9FNuX7vDu2ihaqEEmMmY1/5RLXkhdxHWtcJt1Yljg=; b=Cbvd0fX6XrZw1AUg0cLa2NKU8uqG/ejeMzx9JB2HU5cAVv4BW3oGwzBTc8+RE33p/R xm5d1sdfNvsDIZqWThTr9SkY/Jjd4hNX0hJjHU2q3DQcWft7JPy80ncknLHo2p2l4esB 5XrfYVaipPREB4JhmdAnoDlqiw7DFdLEOr0Pw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687372083; x=1689964083; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6v9FNuX7vDu2ihaqEEmMmY1/5RLXkhdxHWtcJt1Yljg=; b=PAN3yrUOBg2NehoDyqO9jTC+s6/VIoLOL2CMnIN4N//uNKyrYhDtAMi9AtdTmhTYU1 NXwR3QpF7e+P36M3o2m7tXDyYYiAkBTbzDq0aYhbiziJS8s9GkmlajKx3ZktQV+cVC7L iLmeZkNK5fSzQGi/UndurKvgIs7qPesCcXlfuSDKuQ+/rR0dfaiq8ELCBLE2IlhnnMZF a8J0hOjPjTMAsJ2H+J3a82LhB/y2DIhVsJ3rHUjSwYLUgtiGlIalenf2S5oh99B5g6xB mHRGSZVEKN2hKypMJbm+49kLOGF+QUk0vZnHV5GEBQrwwbDmmUgXI+78ff0DsPHQxfeg uMfQ== X-Gm-Message-State: AC+VfDynCCB5SVyt/sD74HNRO70EJ5oz/sZULV9gmXqveF25BBvQva95 NWo6O1cT0r1v8ZsO6iPUrllBm4RSTx/CilzKUPtC8g== X-Google-Smtp-Source: ACHHUZ5ZbXid0tStDHLkS/5SDZCY8L7vOqmbTWFUncl3bFWpqc2xE6vkwIl1gZtvd+g+c5ggdZSPYHLhSb+rrb//QkY= X-Received: by 2002:a05:6808:1792:b0:39e:b986:6609 with SMTP id bg18-20020a056808179200b0039eb9866609mr16228108oib.38.1687372083600; Wed, 21 Jun 2023 11:28:03 -0700 (PDT) MIME-Version: 1.0 References: <20230504123749.1417259-1-juraj.linkes@pantheon.tech> <20230511091408.236638-1-juraj.linkes@pantheon.tech> <20230511091408.236638-5-juraj.linkes@pantheon.tech> In-Reply-To: <20230511091408.236638-5-juraj.linkes@pantheon.tech> From: Jeremy Spewock Date: Wed, 21 Jun 2023 14:27:52 -0400 Message-ID: Subject: Re: [RFC PATCH v3 4/4] dts: format docstrigs to google format To: =?UTF-8?Q?Juraj_Linke=C5=A1?= Cc: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, lijuan.tu@intel.com, bruce.richardson@intel.com, wathsala.vithanage@arm.com, probb@iol.unh.edu, dev@dpdk.org Content-Type: multipart/alternative; boundary="000000000000a5b46205fea7eda2" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --000000000000a5b46205fea7eda2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Acked-by: Jeremy Spweock On Thu, May 11, 2023 at 5:14=E2=80=AFAM Juraj Linke=C5=A1 wrote: > WIP: only one module is reformatted to serve as a demonstration. > > The google format is documented here [0]. > > [0]: https://google.github.io/styleguide/pyguide.html > > Signed-off-by: Juraj Linke=C5=A1 > --- > dts/framework/testbed_model/node.py | 152 +++++++++++++++++++--------- > 1 file changed, 103 insertions(+), 49 deletions(-) > > diff --git a/dts/framework/testbed_model/node.py > b/dts/framework/testbed_model/node.py > index 90467981c3..ad8ef442af 100644 > --- a/dts/framework/testbed_model/node.py > +++ b/dts/framework/testbed_model/node.py > @@ -3,8 +3,13 @@ > # Copyright(c) 2022-2023 PANTHEON.tech s.r.o. > # Copyright(c) 2022-2023 University of New Hampshire > > -""" > -A node is a generic host that DTS connects to and manages. > +"""Common functionality for node management. > + > +There's a base class, Node, that's supposed to be extended by other > classes > +with functionality specific to that node type. > +The only part that can be used standalone is the Node.skip_setup static > method, > +which is a decorator used to skip method execution > +if skip_setup is passed by the user on the cmdline or in an env variable= . > """ > > from typing import Any, Callable > @@ -26,10 +31,25 @@ > > > class Node(object): > - """ > - Basic class for node management. This class implements methods that > - manage a node, such as information gathering (of CPU/PCI/NIC) and > - environment setup. > + """The base class for node management. > + > + It shouldn't be instantiated, but rather extended. > + It implements common methods to manage any node: > + > + * connection to the node > + * information gathering of CPU > + * hugepages setup > + > + Arguments: > + node_config: The config from the input configuration file. > + > + Attributes: > + main_session: The primary OS-agnostic remote session used > + to communicate with the node. > + config: The configuration used to create the node. > + name: The name of the node. > + lcores: The list of logical cores that DTS can use on the node. > + It's derived from logical cores present on the node and user > configuration. > """ > > main_session: OSSession > @@ -56,65 +76,89 @@ def __init__(self, node_config: NodeConfiguration): > self._logger.info(f"Created node: {self.name}") > > def set_up_execution(self, execution_config: ExecutionConfiguration) > -> None: > - """ > - Perform the execution setup that will be done for each execution > - this node is part of. > + """Execution setup steps. > + > + Configure hugepages and call self._set_up_execution where > + the rest of the configuration steps (if any) are implemented. > + > + Args: > + execution_config: The execution configuration according to > which > + the setup steps will be taken. > """ > self._setup_hugepages() > self._set_up_execution(execution_config) > > def _set_up_execution(self, execution_config: ExecutionConfiguration= ) > -> None: > - """ > - This method exists to be optionally overwritten by derived > classes and > - is not decorated so that the derived class doesn't have to use > the decorator. > + """Optional additional execution setup steps for derived classes= . > + > + Derived classes should overwrite this > + if they want to add additional execution setup steps. > """ > > def tear_down_execution(self) -> None: > - """ > - Perform the execution teardown that will be done after each > execution > - this node is part of concludes. > + """Execution teardown steps. > + > + There are currently no common execution teardown steps > + common to all DTS node types. > """ > self._tear_down_execution() > > def _tear_down_execution(self) -> None: > - """ > - This method exists to be optionally overwritten by derived > classes and > - is not decorated so that the derived class doesn't have to use > the decorator. > + """Optional additional execution teardown steps for derived > classes. > + > + Derived classes should overwrite this > + if they want to add additional execution teardown steps. > """ > > def set_up_build_target( > self, build_target_config: BuildTargetConfiguration > ) -> None: > - """ > - Perform the build target setup that will be done for each build > target > - tested on this node. > + """Build target setup steps. > + > + There are currently no common build target setup steps > + common to all DTS node types. > + > + Args: > + build_target_config: The build target configuration accordin= g > to which > + the setup steps will be taken. > """ > self._set_up_build_target(build_target_config) > > def _set_up_build_target( > self, build_target_config: BuildTargetConfiguration > ) -> None: > - """ > - This method exists to be optionally overwritten by derived > classes and > - is not decorated so that the derived class doesn't have to use > the decorator. > + """Optional additional build target setup steps for derived > classes. > + > + Derived classes should optionally overwrite this > + if they want to add additional build target setup steps. > """ > > def tear_down_build_target(self) -> None: > - """ > - Perform the build target teardown that will be done after each > build target > - tested on this node. > + """Build target teardown steps. > + > + There are currently no common build target teardown steps > + common to all DTS node types. > """ > self._tear_down_build_target() > > def _tear_down_build_target(self) -> None: > - """ > - This method exists to be optionally overwritten by derived > classes and > - is not decorated so that the derived class doesn't have to use > the decorator. > + """Optional additional build target teardown steps for derived > classes. > + > + Derived classes should overwrite this > + if they want to add additional build target teardown steps. > """ > > def create_session(self, name: str) -> OSSession: > - """ > - Create and return a new OSSession tailored to the remote OS. > + """Create and return a new OS-agnostic remote session. > + > + The returned session won't be used by the object creating it. > + Will be cleaned up automatically. > + > + Args: > + name: The name of the session. > + > + Returns: > + A new OS-agnostic remote session. > """ > session_name =3D f"{self.name} {name}" > connection =3D create_session( > @@ -130,14 +174,24 @@ def filter_lcores( > filter_specifier: LogicalCoreCount | LogicalCoreList, > ascending: bool =3D True, > ) -> list[LogicalCore]: > - """ > - Filter the LogicalCores found on the Node according to > - a LogicalCoreCount or a LogicalCoreList. > + """Filter the node's logical cores that DTS can use. > > - If ascending is True, use cores with the lowest numerical id fir= st > - and continue in ascending order. If False, start with the highes= t > - id and continue in descending order. This ordering affects which > - sockets to consider first as well. > + Logical cores that DTS can use are ones that are present on the > node, > + but filtered according to user config. > + The filter_specifier will filter cores from those logical cores. > + > + Args: > + filter_specifier: Two different filters can be used, one tha= t > specifies > + the number of logical cores per core, cores per socket a= nd > + the number of sockets, > + the other that specifies a logical core list. > + ascending: If True, use cores with the lowest numerical id > first > + and continue in ascending order. If False, start with th= e > highest > + id and continue in descending order. This ordering > affects which > + sockets to consider first as well. > + > + Returns: > + A list of logical cores. > """ > self._logger.debug(f"Filtering {filter_specifier} from > {self.lcores}.") > return lcore_filter( > @@ -147,17 +201,14 @@ def filter_lcores( > ).filter() > > def _get_remote_cpus(self) -> None: > - """ > - Scan CPUs in the remote OS and store a list of LogicalCores. > - """ > + """Scan CPUs in the remote OS and store a list of LogicalCores."= "" > self._logger.info("Getting CPU information.") > self.lcores =3D > self.main_session.get_remote_cpus(self.config.use_first_core) > > def _setup_hugepages(self): > - """ > - Setup hugepages on the Node. Different architectures can supply > different > - amounts of memory for hugepages and numa-based hugepage > allocation may need > - to be considered. > + """Setup hugepages on the Node. > + > + Configure the hugepages only if they're specified in user > configuration. > """ > if self.config.hugepages: > self.main_session.setup_hugepages( > @@ -165,9 +216,7 @@ def _setup_hugepages(self): > ) > > def close(self) -> None: > - """ > - Close all connections and free other resources. > - """ > + """Close all connections and free other resources.""" > if self.main_session: > self.main_session.close() > for session in self._other_sessions: > @@ -176,6 +225,11 @@ def close(self) -> None: > > @staticmethod > def skip_setup(func: Callable[..., Any]) -> Callable[..., Any]: > + """A decorator that skips the decorated function. > + > + When used, the decorator executes an empty lambda function > + instead of the decorated function. > + """ > if SETTINGS.skip_setup: > return lambda *args: None > else: > -- > 2.30.2 > > --000000000000a5b46205fea7eda2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
<= tr>
Acked-by: Jeremy Spweock <jspweock@iol.unh.edu>

On Thu, May 11, 202= 3 at 5:14=E2=80=AFAM Juraj Linke=C5=A1 <juraj.linkes@pantheon.tech> w= rote:
WIP: only = one module is reformatted to serve as a demonstration.

The google format is documented here [0].

[0]: https://google.github.io/styleguide/pyguide.htm= l

Signed-off-by: Juraj Linke=C5=A1 <juraj.linkes@pantheon.tech>
---
=C2=A0dts/framework/testbed_model/node.py | 152 +++++++++++++++++++--------= -
=C2=A01 file changed, 103 insertions(+), 49 deletions(-)

diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_mo= del/node.py
index 90467981c3..ad8ef442af 100644
--- a/dts/framework/testbed_model/node.py
+++ b/dts/framework/testbed_model/node.py
@@ -3,8 +3,13 @@
=C2=A0# Copyright(c) 2022-2023 PANTHEON.tech s.r.o.
=C2=A0# Copyright(c) 2022-2023 University of New Hampshire

-"""
-A node is a generic host that DTS connects to and manages.
+"""Common functionality for node management.
+
+There's a base class, Node, that's supposed to be extended by othe= r classes
+with functionality specific to that node type.
+The only part that can be used standalone is the Node.skip_setup static me= thod,
+which is a decorator used to skip method execution
+if skip_setup is passed by the user on the cmdline or in an env variable.<= br> =C2=A0"""

=C2=A0from typing import Any, Callable
@@ -26,10 +31,25 @@


=C2=A0class Node(object):
-=C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 Basic class for node management. This class implements metho= ds that
-=C2=A0 =C2=A0 manage a node, such as information gathering (of CPU/PCI/NIC= ) and
-=C2=A0 =C2=A0 environment setup.
+=C2=A0 =C2=A0 """The base class for node management.
+
+=C2=A0 =C2=A0 It shouldn't be instantiated, but rather extended.
+=C2=A0 =C2=A0 It implements common methods to manage any node:
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0* connection to the node
+=C2=A0 =C2=A0 =C2=A0 =C2=A0* information gathering of CPU
+=C2=A0 =C2=A0 =C2=A0 =C2=A0* hugepages setup
+
+=C2=A0 =C2=A0 Arguments:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 node_config: The config from the input configu= ration file.
+
+=C2=A0 =C2=A0 Attributes:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 main_session: The primary OS-agnostic remote s= ession used
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 to communicate with the node. +=C2=A0 =C2=A0 =C2=A0 =C2=A0 config: The configuration used to create the n= ode.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 name: The name of the node.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 lcores: The list of logical cores that DTS can= use on the node.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 It's derived from logical co= res present on the node and user configuration.
=C2=A0 =C2=A0 =C2=A0"""

=C2=A0 =C2=A0 =C2=A0main_session: OSSession
@@ -56,65 +76,89 @@ def __init__(self, node_config: NodeConfiguration):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._logger.info(f"Created node: {self.name}")

=C2=A0 =C2=A0 =C2=A0def set_up_execution(self, execution_config: ExecutionC= onfiguration) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Perform the execution setup that will be done = for each execution
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 this node is part of.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Execution setup steps.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Configure hugepages and call self._set_up_exec= ution where
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 the rest of the configuration steps (if any) a= re implemented.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Args:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 execution_config: The execution = configuration according to which
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 the setup steps wi= ll be taken.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._setup_hugepages()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._set_up_execution(execution_config)<= br>
=C2=A0 =C2=A0 =C2=A0def _set_up_execution(self, execution_config: Execution= Configuration) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 This method exists to be optionally overwritte= n by derived classes and
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 is not decorated so that the derived class doe= sn't have to use the decorator.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Optional additional executio= n setup steps for derived classes.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Derived classes should overwrite this
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if they want to add additional execution setup= steps.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""

=C2=A0 =C2=A0 =C2=A0def tear_down_execution(self) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Perform the execution teardown that will be do= ne after each execution
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 this node is part of concludes.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Execution teardown steps. +
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 There are currently no common execution teardo= wn steps
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 common to all DTS node types.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._tear_down_execution()

=C2=A0 =C2=A0 =C2=A0def _tear_down_execution(self) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 This method exists to be optionally overwritte= n by derived classes and
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 is not decorated so that the derived class doe= sn't have to use the decorator.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Optional additional executio= n teardown steps for derived classes.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Derived classes should overwrite this
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if they want to add additional execution teard= own steps.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""

=C2=A0 =C2=A0 =C2=A0def set_up_build_target(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self, build_target_config: BuildTargetCon= figuration
=C2=A0 =C2=A0 =C2=A0) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Perform the build target setup that will be do= ne for each build target
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 tested on this node.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Build target setup steps. +
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 There are currently no common build target set= up steps
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 common to all DTS node types.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Args:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 build_target_config: The build t= arget configuration according to which
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 the setup steps wi= ll be taken.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._set_up_build_target(build_target_co= nfig)

=C2=A0 =C2=A0 =C2=A0def _set_up_build_target(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self, build_target_config: BuildTargetCon= figuration
=C2=A0 =C2=A0 =C2=A0) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 This method exists to be optionally overwritte= n by derived classes and
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 is not decorated so that the derived class doe= sn't have to use the decorator.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Optional additional build ta= rget setup steps for derived classes.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Derived classes should optionally overwrite th= is
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if they want to add additional build target se= tup steps.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""

=C2=A0 =C2=A0 =C2=A0def tear_down_build_target(self) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Perform the build target teardown that will be= done after each build target
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 tested on this node.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Build target teardown steps.=
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 There are currently no common build target tea= rdown steps
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 common to all DTS node types.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._tear_down_build_target()

=C2=A0 =C2=A0 =C2=A0def _tear_down_build_target(self) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 This method exists to be optionally overwritte= n by derived classes and
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 is not decorated so that the derived class doe= sn't have to use the decorator.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Optional additional build ta= rget teardown steps for derived classes.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Derived classes should overwrite this
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if they want to add additional build target te= ardown steps.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""

=C2=A0 =C2=A0 =C2=A0def create_session(self, name: str) -> OSSession: -=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Create and return a new OSSession tailored to = the remote OS.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Create and return a new OS-a= gnostic remote session.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 The returned session won't be used by the = object creating it.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Will be cleaned up automatically.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Args:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 name: The name of the session. +
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Returns:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 A new OS-agnostic remote session= .
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0session_name =3D f"{
self.name} {name}&quo= t;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0connection =3D create_session(
@@ -130,14 +174,24 @@ def filter_lcores(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0filter_specifier: LogicalCoreCount | Logi= calCoreList,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ascending: bool =3D True,
=C2=A0 =C2=A0 =C2=A0) -> list[LogicalCore]:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Filter the LogicalCores found on the Node acco= rding to
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 a LogicalCoreCount or a LogicalCoreList.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Filter the node's logica= l cores that DTS can use.

-=C2=A0 =C2=A0 =C2=A0 =C2=A0 If ascending is True, use cores with the lowes= t numerical id first
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 and continue in ascending order. If False, sta= rt with the highest
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 id and continue in descending order. This orde= ring affects which
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 sockets to consider first as well.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Logical cores that DTS can use are ones that a= re present on the node,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 but filtered according to user config.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 The filter_specifier will filter cores from th= ose logical cores.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Args:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 filter_specifier: Two different = filters can be used, one that specifies
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 the number of logi= cal cores per core, cores per socket and
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 the number of sock= ets,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 the other that spe= cifies a logical core list.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ascending: If True, use cores wi= th the lowest numerical id first
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 and continue in as= cending order. If False, start with the highest
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 id and continue in= descending order. This ordering affects which
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sockets to conside= r first as well.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Returns:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 A list of logical cores.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._logger.debug(f"Filtering {filt= er_specifier} from {self.lcores}.")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return lcore_filter(
@@ -147,17 +201,14 @@ def filter_lcores(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0).filter()

=C2=A0 =C2=A0 =C2=A0def _get_remote_cpus(self) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Scan CPUs in the remote OS and store a list of= LogicalCores.
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Scan CPUs in the remote OS a= nd store a list of LogicalCores."""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._logger.info("Getting CPU informa= tion.")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.lcores =3D self.main_session.get_rem= ote_cpus(self.config.use_first_core)

=C2=A0 =C2=A0 =C2=A0def _setup_hugepages(self):
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Setup hugepages on the Node. Different archite= ctures can supply different
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 amounts of memory for hugepages and numa-based= hugepage allocation may need
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 to be considered.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Setup hugepages on the Node.=
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Configure the hugepages only if they're sp= ecified in user configuration.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if self.config.hugepages:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.main_session.setup_hug= epages(
@@ -165,9 +216,7 @@ def _setup_hugepages(self):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)

=C2=A0 =C2=A0 =C2=A0def close(self) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Close all connections and free other resources= .
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Close all connections and fr= ee other resources."""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if self.main_session:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.main_session.close() =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for session in self._other_sessions:
@@ -176,6 +225,11 @@ def close(self) -> None:

=C2=A0 =C2=A0 =C2=A0@staticmethod
=C2=A0 =C2=A0 =C2=A0def skip_setup(func: Callable[..., Any]) -> Callable= [..., Any]:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """A decorator that skips the d= ecorated function.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 When used, the decorator executes an empty lam= bda function
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 instead of the decorated function.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if SETTINGS.skip_setup:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return lambda *args: None =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else:
--
2.30.2

--000000000000a5b46205fea7eda2--