code: def _run_test_with_mpi(test_name, dtype=None):
      # subprocess is required not to interfere with cupy module imported in top
      # of this file
      runner_path = pathlib.Path(__file__).parent / "comm_runner.py"
      args = [
          "mpiexec",
          "-n",
          "2",
          "--allow-run-as-root",
          sys.executable,
          runner_path,
          test_name,
          "mpi",
      ]
      if dtype is not None:
          args.append(numpy.dtype(dtype).char)
      proc = subprocess.Popen(
          args,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          env=os.environ,
      )
      stdoutdata, stderrdata = proc.communicate()
      assert stderrdata.decode() == ""
      assert proc.returncode == 0
  
imports: import pathlib
  import subprocess
  import sys
  import unittest
  import os
  import numpy
  import pytest
  from cupy.cuda import nccl
  from cupy import testing
  from cupyx.distributed import init_process_group
  from cupyx.distributed._nccl_comm import _mpi_available
label_desc: Use image node_id 2 for calling a global function with example usage: _run_test_with_mpi(test_name, dtype) without return types