def get_realizations(n_realizations, batch_size, slurm_idx):
    """Generate a list of realizations to process for the current node."""

    batches = range(0, n_realizations, batch_size)

    try:
        return [list(range(i, i + batch_size, 1)) for i in batches][slurm_idx]
    except IndexError:
        msg = f'No realization batch exists for SLURM_ARRAY_TASK_ID = {slurm_idx}.'
        raise IndexError(msg)