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)
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)
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)
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)
def command_interrupted(context, event): # @UnusedVariable error('Command %r interrupted.' % event.kwargs['command'])
def compmake_bug(context, event): # @UnusedVariable error(my_prefix + event.kwargs['user_msg']) error(my_prefix + event.kwargs['dev_msg'])
def job_interrupted(context, event): # @UnusedVariable error(my_prefix + 'Job %r interrupted:\n %s' % (event.kwargs['job_id'], indent(event.kwargs['bt'], '> ')))
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)
def command_failed(context, event): # @UnusedVariable error('Command %r failed: %s' % (event.kwargs['command'], event.kwargs['reason']))