def _write_resources(self, f, config=None):
        """
        Write resource requirements (memory, threads, wall time)
        to file ``f``

        """
        if config is None:
            c = self.config
        else:
            c = config

        if c.parallel.environment == 'qsub':
            conf = c.get_key('parallel.resources.memory', default=False)
            if conf:
                mem_gb = 1000.0 / conf  # Convert MB in settings to GB
                f.write('#$ -l mem_total={:.1f}G\n'.format(mem_gb))

            conf = c.get_key('parallel.resources.threads', default=False)
            if conf:
                try:
                    penv = c.get_key('parallel.parallel_env')
                except KeyError:
                    raise KeyError('Must specify parallel_env for '
                                   'threads >1 and qsub.')
                f.write('#$ -pe {} {}\n'.format(penv, conf))
        elif c.parallel.environment == 'bsub':
            conf = c.get_key('parallel.resources.memory', default=False)
            if conf:
                f.write('#BSUB -R "rusage[mem={:.0f}]"\n'.format(conf))
            conf = c.get_key('parallel.resources.threads', default=False)
            if conf:
                f.write('#BSUB -n {:.0f}\n'.format(conf))
            conf = c.get_key('parallel.resources.wall_time', default=False)
            if conf:
                f.write('#BSUB -W {:.0f}\n'.format(conf))
dataset/ETHPy150Open calliope-project/calliope/calliope/parallel.py/Parallelizer._write_resources/swapped operands of `/`