def freq_submit(job): """ Sends job for frequency analysis of type 'job.freqtype' """ os.chdir(job.indir) if job.freqopt == 'aoforce': try: turbogo_helpers.add_or_modify_control(['$les all 2', '$maxcor 2056']) except turbogo_helpers.ControlFileError: logging.warn("Error modifying control file. Attempting to continue.") job.job.jobtype = job.freqopt script = submit_script_prepare(job.job) try: jobid = submit_job(job.job, script) except Exception as e: logging.warning("Error {} submiting freq job {}".format(e, job.indir)) return -99 logging.info("Job {} submitted for {} analysis" .format(job.name, job.freqopt)) os.chdir(TOPDIR) return jobid
def control_edit(job, filename="control"): """Edit the control files to include or remove the required lines""" logging.debug("Editing control file to add additional info.") turbogo_helpers.remove_control(job.control_remove, filename) turbogo_helpers.add_or_modify_control(job.control_add, filename)