code: def run_check(rank, world_size, port):
      launch(
          config=CONFIG,
          rank=rank,
          world_size=world_size,
          host="localhost",
          port=port,
          backend="nccl",
      )
      logger = get_dist_logger()
      rank = gpc.get_global_rank()
      prev_rank = gpc.get_prev_global_rank(ParallelMode.PIPELINE)
      next_rank = gpc.get_next_global_rank(ParallelMode.PIPELINE)
      logger.info(
          "Rank {0}: prev rank {1}, next rank {2}".format(
              rank, prev_rank, next_rank
          )
      )
      logger.info("Distributed environment is initialized.")
  
      check_comm(world_size, rank, prev_rank, next_rank, logger)
      gpc.destroy()
      torch.cuda.empty_cache()
  
file_path: colossalai/tests/test_legacy/test_trainer/test_pipeline/test_p2p.py
imports: import pytest
  import torch
  import torch.distributed
  from colossalai.legacy.communication import recv_backward, recv_forward, send_backward, send_backward_recv_forward, send_forward, send_forward_recv_backward
  from colossalai.legacy.context.parallel_mode import ParallelMode
  from colossalai.legacy.core import global_context
  from colossalai.legacy.initialize import launch
  from colossalai.logging import get_dist_logger
  from colossalai.testing import rerun_if_address_is_in_use, spawn
  from colossalai.utils import get_current_device
label_desc: Use image node_id 6 for calling a global function with example usage: run_check(rank, world_size, port) without return types