code: def test_server_starter():
      cluster = tf.train.ClusterSpec(
          {
              "worker1": ["localhost:15001"],
              "worker2": ["localhost:15002"],
          }
      )
  
      def start(job_name, task_index):
          from autodist.utils.server_starter import gen_server
  
          server = gen_server(
              cluster,
              job_name=job_name,
              task_index=task_index,
              cpu_device_num=1,
          )
  
          with tf.Graph().as_default():
              if job_name == "worker1":
                  with tf.device(
                      "/job:worker1/task:{}".format(task_index)
                  ):
                      queue = tf.compat.v1.FIFOQueue(
                          cluster.num_tasks("worker2"),
                          tf.int32,
                          shared_name="queue{}".format(task_index),
                      )
                  with tf.compat.v1.Session(server.target) as sess:
                      for i in range(cluster.num_tasks("worker2")):
                          sess.run(queue.dequeue())
  
              elif job_name == "worker2":
                  queues = []
                  for i in range(cluster.num_tasks("worker1")):
                      with tf.device("/job:worker1/task:{}".format(i)):
                          queues.append(
                              tf.compat.v1.FIFOQueue(
                                  cluster.num_tasks("worker2"),
                                  tf.int32,
                                  shared_name="queue{}".format(i),
                              )
                          )
                  with tf.compat.v1.Session(server.target) as sess:
                      for i in range(cluster.num_tasks("worker1")):
                          sess.run(queues[i].enqueue(task_index))
  
      os.environ["CUDA_VISIBLE_DEVICES"] = ""
      thread_pool = [
          threading.Thread(target=start, args=("worker1", 0)),
          threading.Thread(target=start, args=("worker2", 0)),
      ]
      for thread in thread_pool:
          thread.start()
      for thread in thread_pool:
          thread.join()
  
file_path: autodist/tests/test_kernels/test_common/test_utils.py
imports: import os, threading
  import tensorflow
  from tensorflow.python import ops
  from tensorflow.python import constant_op
  from tensorflow.python.ops.gen_control_flow_ops import no_op
  from autodist.kernel.common import utils
  from autodist.kernel.common.utils import replica_prefix, strip_replica_prefix
label_desc: Use image node_id 3 for calling a global function with example usage: test_server_starter() without return types