multi_generate_hpc_jobs.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:graynet 作者: raamana 项目源码 文件源码
def make_job(subject_id_list, freesurfer_dir,
             base_feature, weight_method, num_bins, edge_range, summary_stat,
             atlas, fwhm, out_proc_dir, job_dir, job_name, num_procs):
    "Creates graynet job for running on HPC"

    str_list_weight_method = ' '.join(weight_method)

    job_file = pjoin(job_dir, '{}.{}.job'.format(job_name, job_type))
    job_log = pjoin(job_dir, '{}.{}.log'.format(job_name, job_type))
    if pexists(job_file):
        os.remove(job_file)
    with open(job_file, 'w') as jf:
        jf.write('#!/bin/bash\n')
        jf.write(specify_hpc_resources(mem, queue, num_procs, job_dir, job_log))
        jf.write(make_cli_call(cli_name, realpath(subject_id_list), base_feature, realpath(freesurfer_dir),
                               str_list_weight_method, num_bins, edge_range, summary_stat, atlas, fwhm, realpath(out_proc_dir),
                               num_procs))

    st = os.stat(job_file)
    os.chmod(job_file, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)

    return job_file
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号