Esempio n. 1
0
 def delete_job(self):
     # cmd = ['qdel', self.sge_id]
     cmd = ['qdel', self.sge_job_name]
     cwd = os.path.abspath(os.getcwd())
     # TODO: check errors
     try:
         _ = system_cmd_result(cwd, cmd,
                               display_stdout=False,
                               display_stderr=False,
                               raise_on_error=True,
                               capture_keyboard_interrupt=False)
     except CmdException as e:
         error('Error while deleting job:\n%s' % e)
Esempio n. 2
0
 def delete_job(self):
     # cmd = ['qdel', self.sge_id]
     cmd = ['qdel', self.sge_job_name]
     cwd = os.path.abspath(os.getcwd())
     # TODO: check errors
     try:
         _ = system_cmd_result(cwd,
                               cmd,
                               display_stdout=False,
                               display_stderr=False,
                               raise_on_error=True,
                               capture_keyboard_interrupt=False)
     except CmdException as e:
         error('Error while deleting job:\n%s' % e)
Esempio n. 3
0
def job_failed(context, event):  # @UnusedVariable
    job_id = event.kwargs['job_id']
    reason = event.kwargs['reason']
    bt = event.kwargs['bt']

    msg = 'Job %r failed:' % job_id
    # s = reason.strip
    # if get_compmake_config('echo'):
    #     s += '\n' + bt
    msg += '\n' + indent(reason.strip(), '| ')

    if get_compmake_config('echo'):
        msg += '\n' + indent(bt.strip(), '> ')
    else:
        msg += '\nUse "config echo 1" to have errors displayed.'
    msg += '\nWrite "details %s" to inspect the error.' % job_id
    error(my_prefix + msg)
Esempio n. 4
0
def job_failed(context, event):  # @UnusedVariable
    job_id = event.kwargs['job_id']
    reason = event.kwargs['reason']
    bt = event.kwargs['bt']

    msg = 'Job %r failed:' % job_id
    # s = reason.strip
    # if get_compmake_config('echo'):
    #     s += '\n' + bt
    msg += '\n' + indent(reason.strip(), '| ')
    
    if get_compmake_config('echo'):
        s = bt.strip()
        msg += '\n' + indent(s, '> ')
    else:
        msg += '\nUse "config echo 1" to have errors displayed.' 
    msg += '\nWrite "details %s" to inspect the error.' % job_id
    error(my_prefix + msg)
Esempio n. 5
0
def manager_succeeded(event):
    if event.kwargs['nothing_to_do']:
        info('Nothing to do.')
    else:
        ntargets = len(event.kwargs['all_targets'])
        ndone = len(event.kwargs['done'])
        nfailed = len(event.kwargs['failed'])
        nblocked = len(event.kwargs['blocked'])
        if ntargets:
            s = 'Processed %d jobs (' % ntargets
            ss = []
            if ndone:
                ss.append('%d done' % ndone)
            if nfailed:
                ss.append('%d failed' % nfailed)
            if nblocked:
                ss.append('%d blocked' % nblocked)
            s += ", ".join(ss)
            s += ').'
            if nfailed:
                error(s)
            else:
                info(s)
Esempio n. 6
0
def manager_succeeded(event):
    if event.kwargs['nothing_to_do']:
        info('Nothing to do.')
    else:
        ntargets = len(event.kwargs['all_targets'])
        ndone = len(event.kwargs['done'])
        nfailed = len(event.kwargs['failed'])
        nblocked = len(event.kwargs['blocked'])
        if ntargets:
            s = 'Processed %d jobs (' % ntargets 
            ss = []
            if ndone:
                ss.append('%d done' % ndone)
            if nfailed:
                ss.append('%d failed' % nfailed)
            if nblocked:
                ss.append('%d blocked' % nblocked)
            s += ", ".join(ss)
            s += ').'
            if nfailed:
                error(s)
            else:
                info(s)
Esempio n. 7
0
def command_interrupted(context, event):  # @UnusedVariable
    error('Command %r interrupted.' % event.kwargs['command'])
Esempio n. 8
0
def compmake_bug(context, event):  # @UnusedVariable
    error(my_prefix + event.kwargs['user_msg'])
    error(my_prefix + event.kwargs['dev_msg'])
Esempio n. 9
0
def job_interrupted(context, event):  # @UnusedVariable
    error(my_prefix + 'Job %r interrupted:\n %s' %
          (event.kwargs['job_id'], indent(event.kwargs['bt'], '> ')))
Esempio n. 10
0
def command_line_failed(context, event):  # @UnusedVariable
    # Only write something if it is more than one
    command = event.kwargs['command']
    if not ';' in command:
        return
    error(my_prefix + 'Command sequence %r failed.' % command)
Esempio n. 11
0
def command_failed(context, event):  # @UnusedVariable
    error('Command %r failed: %s' %
          (event.kwargs['command'], event.kwargs['reason']))
Esempio n. 12
0
def compmake_bug(context, event):  # @UnusedVariable
    error(my_prefix + event.kwargs['user_msg'])
    error(my_prefix + event.kwargs['dev_msg'])
Esempio n. 13
0
def job_interrupted(context, event):  # @UnusedVariable
    error(my_prefix + 'Job %r interrupted:\n %s' %
          (event.kwargs['job_id'],
           indent(event.kwargs['bt'], '> ')))
Esempio n. 14
0
def command_line_failed(context, event):  # @UnusedVariable
    # Only write something if it is more than one
    command = event.kwargs['command']
    if not ';' in command:
        return
    error(my_prefix + 'Command sequence %r failed.' % command)
Esempio n. 15
0
def command_failed(context, event):  # @UnusedVariable
    error('Command %r failed: %s' % (event.kwargs['command'],
                                     event.kwargs['reason']))
Esempio n. 16
0
def command_interrupted(context, event):  # @UnusedVariable
    error('Command %r interrupted.' % event.kwargs['command'])