class_docstr: Cluster environment for training on a cluster managed by SLURM.
  
  You can configure the `main_address` and `main_port` properties via the env variables `MASTER_ADDR` and
  `MASTER_PORT`, respectively.
  
  Args:
      auto_requeue: Whether automatic job resubmission is enabled or not. How and under which conditions a job gets
          rescheduled gets determined by the owner of this plugin.
      requeue_signal: The signal that SLURM will send to indicate that the job should be requeued. Defaults to
          SIGUSR1 on Unix.
class_docstr_tok: ["Cluster","environment","for","training","on","a","cluster","managed","by","SLURM",".","You","can","configure","the","`","main_address","`","and","`","main_port","`","properties","via","the","env","variables","`","MASTER_ADDR","`","and","`","MASTER_PORT","`",",","respectively",".","Args",":","auto_requeue",":","Whether","automatic","job","resubmission","is","enabled","or","not",".","How","and","under","which","conditions","a","job","gets","rescheduled","gets","determined","by","the","owner","of","this","plugin",".","requeue_signal",":","The","signal","that","SLURM","will","send","to","indicate","that","the","job","should","be","requeued",".","Defaults","to","SIGUSR1","on","Unix","."]
docstr: Checks if the `srun` command is available and used.
  
  Parallel jobs (multi-GPU, multi-node) in SLURM are launched by prepending `srun` in front of the Python command.
  Not doing so will result in processes hanging, which is a frequent user error. Lightning will emit a warning if
  `srun` is found but not used.
docstr_tok: ["Checks","if","the","`","srun","`","command","is","available","and","used",".","Parallel","jobs","(","multi-GPU",",","multi-node",")","in","SLURM","are","launched","by","prepending","`","srun","`","in","front","of","the","Python","command",".","Not","doing","so","will","result","in","processes","hanging",",","which","is","a","frequent","user","error",".","Lightning","will","emit","a","warning","if","`","srun","`","is","found","but","not","used","."]
code: def _validate_srun_used() -> None:
      """Checks if the `srun` command is available and used.
  
      Parallel jobs (multi-GPU, multi-node) in SLURM are launched by prepending `srun` in front of the Python command.
      Not doing so will result in processes hanging, which is a frequent user error. Lightning will emit a warning if
      `srun` is found but not used.
  
      """
      if _IS_WINDOWS:
          return
  
      srun_exists = shutil.which("srun") is not None
      if srun_exists and not _is_srun_used():
          hint = " ".join(
              ["srun", os.path.basename(sys.executable), *sys.argv]
          )[:64]
          rank_zero_warn(
              "The `srun` command is available on your system but is not used. HINT: If your intention is to run"
              f" Lightning on SLURM, prepend your python command with `srun` like so: {hint} ...",
              category=PossibleUserWarning,
          )
  
imports: import logging
  import os
  import re
  import shutil
  import signal
  import sys
  from typing import Optional
  from typing_extensions import override
  from lightning.fabric.plugins.environments.cluster_environment import ClusterEnvironment
  from lightning.fabric.utilities.imports import _IS_WINDOWS
  from lightning.fabric.utilities.rank_zero import rank_zero_warn
  from lightning.fabric.utilities.warnings import PossibleUserWarning
label_desc: Use image node_id 16 for calling the SLURMEnvironment obj's underlying member method code with example usage: obj._validate_srun_used() without return types