code: def timed_pt2pt(input, args):
      if args.dist == "torch":
          import torch.distributed as dist
      elif args.dist == "deepspeed":
          import deepspeed.comm as dist
  
      sync_all()
      # Warmups, establish connections, etc.
      for i in range(args.warmups):
          if dist.get_rank() == 0:
              if args.async_op:
                  dist.isend(input, 1)
              else:
                  dist.send(input, 1)
          if dist.get_rank() == 1:
              if args.async_op:
                  dist.irecv(input, src=0)
              else:
                  dist.recv(input, src=0)
      sync_all()
  
      # time the actual comm op trials times and average it
      pre = time.perf_counter()
      for i in range(args.trials):
          if dist.get_rank() == 0:
              if args.async_op:
                  dist.isend(input, 1)
              else:
                  dist.send(input, 1)
          if dist.get_rank() == 1:
              if args.async_op:
                  dist.irecv(input, src=0)
              else:
                  dist.recv(input, src=0)
  
      sync_all()
      duration = time.perf_counter() - pre
  
      # maintain and clean performance data
      avg_duration = duration / args.trials
      size = input.element_size() * input.nelement()
      n = dist.get_world_size()
      tput, busbw = get_bw("pt2pt", size, avg_duration, args)
      tput_str, busbw_str, duration_str = get_metric_strings(
          args, tput, busbw, avg_duration
      )
      desc = f"{input.nelement()}x{input.element_size()}"
  
      if not args.raw:
          size = convert_size(size)
  
      print_rank_0(
          f"{size:<20} {desc:25s} {duration_str:20s} {tput_str:20s} {busbw_str:20s}"
      )
  
imports: from benchmarks.communication.utils import *
  from benchmarks.communication.constants import *
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: timed_pt2pt(input, args) without return types