# increase memory and walltime # TODO: consider how to scale mem/time here oldmem = sendjob_dict['mem'] sendjob_dict['mem'] = int(oldmem) * 2 oldtime = sendjob_dict['walltime'] sendjob_dict['walltime'] = int(oldtime) * 4 # replace chunk file and set number of new jobs sendjob_dict['njobs'] = int(nummiss) job_dict['cfile'] = tmp_chunk_file_name # re-save new settings (primarily to track updating mem and walltime) save_job(jfile=orig_job_conf, cmd_templ=cmd_templ, job_dict=job_dict, sendjob_dict=sendjob_dict) # submit imp_cmd = cmd_templ.format(**job_dict) jobres = send_job(jobname=sendjob_dict['jobname'], cmd=imp_cmd, logname=sendjob_dict['logname'], mem=sendjob_dict['mem'], walltime=sendjob_dict['walltime'], njobs=sendjob_dict['njobs'], sleep=sendjob_dict['sleep'], forcearray=True) print 'GWAS jobs resubmitted for %d chunks.\n' % nummiss
# get number of chunks (-1 is for header) nchunks = file_len(outdot+'.chunks.txt')-1 # store job information for possible resubs job_store_file = 'imp.chunks.'+str(outdot)+'.pkl' clust_dict = init_sendjob_dict() clust_dict['jobname'] = 'imp.chunks.'+str(outdot) clust_dict['logname'] = str('imp.chunks.'+str(outdot)+'.'+str(clust_conf['log_task_id'])+'.sub.log') clust_dict['mem'] = 8000 clust_dict['walltime'] = 2 clust_dict['njobs'] = int(nchunks) clust_dict['sleep'] = args.sleep save_job(jfile=job_store_file, cmd_templ=imp_templ, job_dict=jobdict, sendjob_dict=clust_dict) # submit cmd_imp = imp_templ.format(**jobdict) jobres2 = send_job(jobname='imp.chunks.'+str(outdot), cmd=cmd_imp, logname=str('imp.chunks.'+str(outdot)+'.'+str(clust_conf['log_task_id'])+'.sub.log'), mem=8000, walltime=2, njobs=int(nchunks), sleep=args.sleep) print 'Imputation jobs submitted for %d chunks.\n' % nchunks
# increase memory and walltime # TODO: consider how to scale mem/time here oldmem = sendjob_dict['mem'] sendjob_dict['mem'] = int(oldmem)*2 oldtime = sendjob_dict['walltime'] sendjob_dict['walltime'] = int(oldtime)*4 # replace chunk file and set number of new jobs sendjob_dict['njobs'] = int(nummiss) job_dict['cfile'] = tmp_chunk_file_name # re-save new settings (primarily to track updating mem and walltime) save_job(jfile=orig_job_conf, cmd_templ=cmd_templ, job_dict=job_dict, sendjob_dict=sendjob_dict) # submit gwas_cmd = cmd_templ.format(**job_dict) jobres = send_job(jobname=sendjob_dict['jobname'], cmd=gwas_cmd, logname=sendjob_dict['logname'], mem=sendjob_dict['mem'], walltime=sendjob_dict['walltime'], njobs=sendjob_dict['njobs'], maxpar=sendjob_dict['maxpar'], sleep=sendjob_dict['sleep'], forcearray=True)