def get_ranks_info():
    """
    Return current MPI rank and number of ranks
    None, None - if MPI environment is not available

    :return: rank, max_rank
    """
    rank = None
    max_rank = None
    try:
        from mpi4py import MPI
        comm = MPI.COMM_WORLD
        rank = comm.Get_rank()
        max_rank = comm.Get_size()
    except ImportError:
        print('mpi4py not found')
    return rank, max_rank
