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 for conflicting or incorrectly set variables set through `srun` and raises a useful error message.
  
  Right now, we only check for the most common user errors. See
  `the srun docs <https://slurm.schedmd.com/srun.html>`_
  for a complete list of supported srun variables.
docstr_tok: ["Checks","for","conflicting","or","incorrectly","set","variables","set","through","`","srun","`","and","raises","a","useful","error","message",".","Right","now",",","we","only","check","for","the","most","common","user","errors",".","See","`","the","srun","docs","<","https",":","\/\/slurm.schedmd.com\/srun.html",">","`","_","for","a","complete","list","of","supported","srun","variables","."]
code: def _validate_srun_variables() -> None:
      """Checks for conflicting or incorrectly set variables set through `srun` and raises a useful error message.
  
      Right now, we only check for the most common user errors. See
      `the srun docs <https://slurm.schedmd.com/srun.html>`_
      for a complete list of supported srun variables.
  
      """
      ntasks = int(os.environ.get("SLURM_NTASKS", "1"))
      if ntasks > 1 and "SLURM_NTASKS_PER_NODE" not in os.environ:
          raise RuntimeError(
              f"You set `--ntasks={ntasks}` in your SLURM bash script, but this variable is not supported."
              f" HINT: Use `--ntasks-per-node={ntasks}` instead."
          )
  
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 17 for calling the SLURMEnvironment obj's underlying member method code with example usage: obj._validate_srun_variables() without return types