def apply_overwrite(self, job):
    'Apply the profile and overwrite all settings that are set\n        in this profile\n        '
    log.debug('Profiles | Overwriting job profile to %s', job)
    if self.name:
        job.name = self._render_job_name(job)
    if self.threads:
        job.threads = int(self.threads)
    if (self.nodes is not None):
        job.nodes = self.nodes
    if (self.tasks is not None):
        job.tasks = self.tasks
    if (self.tasks_per_node is not None):
        job.tasks_per_node = self.tasks_per_node
    if (self.environment is not None):
        job.environment = self.environment
    if (self.queue is not None):
        job.queue = self.queue
    if (self.priority is not None):
        job.priority = self.priority
    if (self.time is not None):
        job.max_time = jip.utils.parse_time(self.time)
    if (self.mem is not None):
        job.max_memory = jip.utils.parse_mem(self.mem)
    if (self.log is not None):
        job.stderr = self._render(job, self.log)
    if (self.out is not None):
        job.stdout = self._render(job, self.out)
    if (self.account is not None):
        job.account = self.account
    if (self.temp is not None):
        job.temp = self.temp
    if (self.extra is not None):
        job.extra = self.extra
    if (self.working_dir is not None):
        job.working_directory = os.path.abspath(self.working_dir)
    if (job.stdout and (not job.stdout.startswith('/'))):
        job.stdout = os.path.join(job.working_directory, job.stdout)
    if (job.stderr and (not job.stderr.startswith('/'))):
        job.stderr = os.path.join(job.working_directory, job.stderr)
    if self.env:
        current = os.environ.copy()
        if job.env:
            current.update(job.env)
        rendered = {}
        for (k, v) in self.env.iteritems():
            rendered[k] = render_template(v, **current)
        job.env.update(rendered)
    if hasattr(job, 'pipe_to'):
        for child in job.pipe_to:
            self.apply_overwrite(child)
    for (spec_name, spec) in self.specs.iteritems():
        if fnmatch.fnmatch(job.name, spec_name):
            spec.apply_overwrite(job)
Apply the profile and overwrite all settings that are set
in this profile
def apply_overwrite(self, job):
    'Apply the profile and overwrite all settings that are set\n        in this profile\n        '
    log.debug('Profiles | Overwriting job profile to %s', job)
    if self.name:
        job.name = self._render_job_name(job)
    if self.threads:
        job.threads = int(self.threads)
    if (self.nodes is not None):
        job.nodes = self.nodes
    if (self.tasks is not None):
        job.tasks = self.tasks
    if (self.tasks_per_node is not None):
        job.tasks_per_node = self.tasks_per_node
    if (self.environment is not None):
        job.environment = self.environment
    if (self.queue is not None):
        job.queue = self.queue
    if (self.priority is not None):
        job.priority = self.priority
    if (self.time is not None):
        job.max_time = jip.utils.parse_time(self.time)
    if (self.mem is not None):
        job.max_memory = jip.utils.parse_mem(self.mem)
    if (self.log is not None):
        job.stderr = self._render(job, self.log)
    if (self.out is not None):
        job.stdout = self._render(job, self.out)
    if (self.account is not None):
        job.account = self.account
    if (self.temp is not None):
        job.temp = self.temp
    if (self.extra is not None):
        job.extra = self.extra
    if (self.working_dir is not None):
        job.working_directory = os.path.abspath(self.working_dir)
    if (job.stdout and (not job.stdout.startswith('/'))):
        job.stdout = os.path.join(job.working_directory, job.stdout)
    if (job.stderr and (not job.stderr.startswith('/'))):
        job.stderr = os.path.join(job.working_directory, job.stderr)
    if self.env:
        current = os.environ.copy()
        if job.env:
            current.update(job.env)
        rendered = {}
        for (k, v) in self.env.iteritems():
            rendered[k] = render_template(v, **current)
        job.env.update(rendered)
    if hasattr(job, 'pipe_to'):
        for child in job.pipe_to:
            self.apply_overwrite(child)
    for (spec_name, spec) in self.specs.iteritems():
        if fnmatch.fnmatch(job.name, spec_name):
            spec.apply_overwrite(job)