def submit(jobs, job_attributes={}, serial=False, dump_job=True):
    """ lets you submit multiple jobs serial to each other or in parallel

    Args:
        jobs (:obj:`list` or `tuple` :obj:`Job`): jobs to submit
        job_attributes (dict): effective overrides to all job attributes
        serial (bool): if True jobs will be serial to each other
        dump_job (bool): if True it will store the job as alf file.

    Returns:
        list: job ids

    """
    ids = []
    parent_id = None
    for job in jobs:
        job.job_attributes.update(job_attributes)
        if serial and parent_id:
            # setting serial relationship
            job.job_attributes["afterjids"] = [parent_id]

        parent_id = job.submit(dump_job=dump_job, **job.job_attributes)
        ids.append(parent_id)

    return ids