clusterjob/backends/slurm.py
def resource_headers(self, jobscript):
        """Given a :class:`~clusterjob.JobScript` instance, return a list of
        lines that encode the resource requirements, to be added at the top of
        the rendered job script
        """
        lines = []
        for (key, val) in jobscript.resources.items():
            if key in self.resource_replacements:
                slurm_key = self.resource_replacements[key]
                val = str(val).strip()
            else:
                slurm_key = key
            if not slurm_key.startswith('-'):
                if len(slurm_key) == 1:
                    slurm_key = '-%s' % slurm_key
                else:
                    slurm_key = '--%s' % slurm_key
            if val is None:
                continue
            if type(val) is bool:
                if val:
                    lines.append("%s %s" % (self.prefix, slurm_key))
            else:
                if slurm_key.startswith('--'):
                    lines.append('%s %s=%s'
                                  % (self.prefix, slurm_key, str(val)))
                else:
                    lines.append('%s %s %s'
                                 % (self.prefix, slurm_key, str(val)))
        return lines
Given a :class:`~clusterjob.JobScript` instance, return a list of
        lines that encode the resource requirements, to be added at the top of
        the rendered job script
        
Given a :class:`~clusterjob.JobScript` instance, return a list of
lines that encode the resource requirements, to be added at the top of
the rendered job script
Given a : class : ` ~clusterjob . JobScript ` instance return a list of lines that encode the resource requirements to be added at the top of the rendered job script
def resource_headers(self, jobscript):
        lines = []
        for (key, val) in jobscript.resources.items():
            if key in self.resource_replacements:
                slurm_key = self.resource_replacements[key]
                val = str(val).strip()
            else:
                slurm_key = key
            if not slurm_key.startswith('-'):
                if len(slurm_key) == 1:
                    slurm_key = '-%s' % slurm_key
                else:
                    slurm_key = '--%s' % slurm_key
            if val is None:
                continue
            if type(val) is bool:
                if val:
                    lines.append("%s %s" % (self.prefix, slurm_key))
            else:
                if slurm_key.startswith('--'):
                    lines.append('%s %s=%s'
                                  % (self.prefix, slurm_key, str(val)))
                else:
                    lines.append('%s %s %s'
                                 % (self.prefix, slurm_key, str(val)))
        return lines
def resource_headers ( self , jobscript ) : lines = [ ] for ( key , val ) in jobscript . resources . items ( ) : if key in self . resource_replacements : slurm_key = self . resource_replacements [ key ] val = str ( val ) . strip ( ) else : slurm_key = key if not slurm_key . startswith ( '-' ) : if len ( slurm_key ) == 1 : slurm_key = '-%s' % slurm_key else : slurm_key = '--%s' % slurm_key if val is None : continue if type ( val ) is bool : if val : lines . append ( "%s %s" % ( self . prefix , slurm_key ) ) else : if slurm_key . startswith ( '--' ) : lines . append ( '%s %s=%s' % ( self . prefix , slurm_key , str ( val ) ) ) else : lines . append ( '%s %s %s' % ( self . prefix , slurm_key , str ( val ) ) ) return lines
Given a :class:`~clusterjob.JobScript` instance, return a list of
lines that encode the resource requirements, to be added at the top of
the rendered job script
Given a : class : ` ~clusterjob . JobScript ` instance return a list of lines that encode the resource requirements to be added at the top of the rendered job script
"""Given a :class:`~clusterjob.JobScript` instance, return a list of
        lines that encode the resource requirements, to be added at the top of
        the rendered job script
        """
self
jobscript