def down(job, input_file_id, n, down_checkpoints):
    input_file = job.fileStore.readGlobalFile(input_file_id, cache=False)
    length = os.path.getsize(input_file)
    if length > n:
        job.fileStore.logToMaster("Splitting file: %s of size: %s"
                                  % (input_file_id, length), level=logging.CRITICAL)
        mid_point = get_midpoint(input_file, 0, length)
        t1 = job.fileStore.getLocalTempFile()
        with open(t1, 'w') as fH:
            copy_subrange_of_file(input_file, 0, mid_point + 1, fH)
        t2 = job.fileStore.getLocalTempFile()
        with open(t2, 'w') as fH:
            copy_subrange_of_file(input_file, mid_point + 1, length, fH)
        return job.addFollowOnJobFn(up, job.addChildJobFn(down, job.fileStore.writeGlobalFile(t1), n,
                                    down_checkpoints=down_checkpoints, memory='600M').rv(),
                                    job.addChildJobFn(down, job.fileStore.writeGlobalFile(t2), n,
                                                      down_checkpoints=down_checkpoints,
                                                      memory='600M').rv()).rv()
    else:
        job.fileStore.logToMaster("Sorting file: %s of size: %s"
                                  % (input_file_id, length), level=logging.CRITICAL)
        output_file = job.fileStore.getLocalTempFile()
        sort(input_file, output_file)
        return job.fileStore.writeGlobalFile(output_file)