def SetParallelMode(mode):
    """Set the mode of data parallelism.

    Parameters
    ----------
    mode : str
        The mode, ``MPI``, ``NCCL`` or ``MIXED``.

    Returns
    -------
    None

    Notes
    -----
    The default mode is ``MPI``.

    """
    assert mode == 'MPI' or mode == 'NCCL' or mode == 'MIXED'
    global _parallel_mode
    _parallel_mode = mode
