def prepareQsub(self, cpu, mem, jobID):
        qsubline = ['qsub', '-b', 'y', '-terse', '-j', 'y', '-cwd', '-o', '/dev/null',
                    '-e', '/dev/null', '-N', 'toil_job_' + str(jobID)]

        if self.boss.environment:
            qsubline.append('-v')
            qsubline.append(','.join(k + '=' + quote(os.environ[k] if v is None else v)
                                     for k, v in self.boss.environment.iteritems()))

        reqline = list()
        if mem is not None:
            memStr = str(mem / 1024) + 'K'
            reqline += ['vf=' + memStr, 'h_vmem=' + memStr]
        if len(reqline) > 0:
            qsubline.extend(['-hard', '-l', ','.join(reqline)])
        if cpu is not None and math.ceil(cpu) > 1:
            peConfig = os.getenv('TOIL_GRIDENGINE_PE') or 'shm'
            qsubline.extend(['-pe', peConfig, str(int(math.ceil(cpu)))])
        return qsubline
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/batchSystems/gridengine.py/Worker.prepareQsub/original