def run_shelxd_drmaa(njobs, job_settings): '''Run shelxd on cluster with settings given in dictionary, containing: nrefl = 1 + floor(nref / 100000) - space to allocate ncpu - number of cpus to use wd - working directory''' import drmaa with drmaa.Session() as session: job = session.createJobTemplate() batches = range(0, len(job_settings), njobs) for idx in batches: jobs = [] for _settings in job_settings[idx:idx+njobs]: nrefl = _settings['nrefl'] ncpu = _settings['ncpu'] wd = _settings['wd'] setup_job_drmaa(job, 'shelxd', ['-L%d' % nrefl, 'sad_fa', '-t%d' % ncpu], [], wd, ncpu, timeout = 600) jobs.append(session.runJob(job)) session.synchronize(jobs, drmaa.Session.TIMEOUT_WAIT_FOREVER, True) session.deleteJobTemplate(job) return
def run_shelxe_drmaa(njobs, job_settings): '''Run shelxe on cluster with settings given in dictionary, containing: nsite - number of sites solv - solvent fraction resol - high resolution limit hand - original or inverted wd - working directory''' import drmaa with drmaa.Session() as session: job = session.createJobTemplate() batches = range(0, len(job_settings), njobs) for idx in batches: jobs = [] for _settings in job_settings[idx:idx + njobs]: nsite = _settings['nsite'] solv = _settings['solv'] hand = _settings['hand'] resol = _settings['resol'] nrefl = _settings['nrefl'] wd = _settings['wd'] if hand == 'original': setup_job_drmaa(job, 'shelxe', [ 'sad', 'sad_fa', '-l%d' % nrefl, '-h%d' % nsite, '-s%f' % solv, '-d%f' % resol, '-m20' ], [], wd, 1, timeout=600) else: setup_job_drmaa(job, 'shelxe', [ 'sad', 'sad_fa', '-l%d' % nrefl, '-h%d' % nsite, '-s%f' % solv, '-d%f' % resol, '-m20', '-i' ], [], wd, 1, timeout=600) jobs.append(session.runJob(job)) session.synchronize(jobs, drmaa.Session.TIMEOUT_WAIT_FOREVER, True) session.deleteJobTemplate(job) return