def get_comm(comm):
    """Helper routine to get communicator

    Parameters
    ----------
    comm : MPI_Comm
        MPI communicator

    Returns
    -------
    MPI_Comm
        If the input communicator is None, then return the MPI_COMM_WORLD
    """
    if comm is None:
        from mpi4py import MPI
        return MPI.COMM_WORLD
    return comm
