class_docstr: ClusterResolver for system with Slurm workload manager.
  
  This is an implementation of ClusterResolver for Slurm clusters. This allows
  the specification of jobs and task counts, number of tasks per node, number
  of GPUs on each node and number of GPUs for each task. It retrieves system
  attributes by Slurm environment variables, resolves allocated computing node
  names, constructs a cluster and returns a ClusterResolver object which can be
  used for distributed TensorFlow.
class_docstr_tok: ["ClusterResolver","for","system","with","Slurm","workload","manager",".","This","is","an","implementation","of","ClusterResolver","for","Slurm","clusters",".","This","allows","the","specification","of","jobs","and","task","counts",",","number","of","tasks","per","node",",","number","of","GPUs","on","each","node","and","number","of","GPUs","for","each","task",".","It","retrieves","system","attributes","by","Slurm","environment","variables",",","resolves","allocated","computing","node","names",",","constructs","a","cluster","and","returns","a","ClusterResolver","object","which","can","be","used","for","distributed","TensorFlow","."]
docstr: Creates a mapping of hostnames to the number of tasks allocated on it.
  
  Reads the SLURM environment to determine the nodes involved in the current
  job step and number of tasks running on each node.
  
  Returns a dictionary mapping each hostname to the number of tasks.
docstr_tok: ["Creates","a","mapping","of","hostnames","to","the","number","of","tasks","allocated","on","it",".","Reads","the","SLURM","environment","to","determine","the","nodes","involved","in","the","current","job","step","and","number","of","tasks","running","on","each","node",".","Returns","a","dictionary","mapping","each","hostname","to","the","number","of","tasks","."]
code: def _resolve_task_configuration(self):
      """Creates a mapping of hostnames to the number of tasks allocated on it.
  
      Reads the SLURM environment to determine the nodes involved in the current
      job step and number of tasks running on each node.
  
      Returns a dictionary mapping each hostname to the number of tasks.
      """
      hostlist = self._resolve_hostlist()
      tasks_per_node = expand_tasks_per_node(
          _get_slurm_var("STEP_TASKS_PER_NODE")
      )
      return {
          host: num_tasks
          for (host, num_tasks) in zip(hostlist, tasks_per_node)
      }
  
imports: import os
  import re
  import subprocess
  from tensorflow.python.distribute.cluster_resolver.cluster_resolver import ClusterResolver
  from tensorflow.python.distribute.cluster_resolver.cluster_resolver import format_master_url
  from tensorflow.python.training.server_lib import ClusterSpec
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 5 for calling the SlurmClusterResolver obj's underlying member method code with example usage: obj._resolve_task_configuration() and returns: unknown