def calculate_iteration_count(total_recs, max_rec):
    """
    Given the total number of records and the maximum records allowed in a granule,
    calculates the number of iterations required to traverse the entire array in chunks of size max_rec
    @param total_recs The total number of records
    @param max_rec The maximum number of records allowed in a granule
    """
    cnt = total_recs / max_rec
    if total_recs % max_rec > 0:
        cnt += 1

    return cnt