def start(self, n): self.context["cores"] = self.cores if self.mem: # lsf.conf can specify nonstandard units for memory reservation lsf_unit = lsf.get_lsf_units(resource=True) mem = utils.convert_mb(float(self.mem) * 1024, lsf_unit) # check if memory reservation is per core or per job if lsf.per_core_reservation(): mem = mem / self.cores self.context["mem"] = '#BSUB -R "rusage[mem=%s]"' % mem else: self.context["mem"] = "" self.context["tag"] = self.tag if self.tag else "bcbio" self.context["resources"] = _format_lsf_resources(self.resources) return super(BcbioLSFEngineSetLauncher, self).start(n)
def parse_memory(mem): """ Parse memory parameter """ lsf_unit = get_lsf_units(resource=True) return utils.convert_mb(float(mem) * 1024, lsf_unit)