job.py (1881:fc205a7edd58) | job.py (1908:73342b7d6f83) |
---|---|
1#!/usr/bin/env python 2# Copyright (c) 2005 The Regents of The University of Michigan 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 154 unchanged lines hidden (view full) --- 163 164 os.umask(0022) 165 166 jobdir = JobDir(outdir) 167 168 started = date() 169 jobdir.echofile('.running', started) 170 jobdir.rmfile('.queued') | 1#!/usr/bin/env python 2# Copyright (c) 2005 The Regents of The University of Michigan 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 154 unchanged lines hidden (view full) --- 163 164 os.umask(0022) 165 166 jobdir = JobDir(outdir) 167 168 started = date() 169 jobdir.echofile('.running', started) 170 jobdir.rmfile('.queued') |
171 jobdir.echofile('.pbs_jobid', pbs_jobid) 172 jobdir.echofile('.pbs_jobname', pbs_jobid) | |
173 jobdir.echofile('.host', host) 174 175 jobdir.setstatus('running on %s on %s' % (host, started)) 176 177 if os.path.isdir(workdir): 178 cleandir(workdir) 179 else: 180 os.mkdir(workdir) --- 33 unchanged lines hidden (view full) --- 214 def handler(signum, frame): 215 if childpid != 0: 216 os.kill(childpid, signum) 217 218 signal.signal(signal.SIGHUP, handler) 219 signal.signal(signal.SIGINT, handler) 220 signal.signal(signal.SIGQUIT, handler) 221 signal.signal(signal.SIGTERM, handler) | 171 jobdir.echofile('.host', host) 172 173 jobdir.setstatus('running on %s on %s' % (host, started)) 174 175 if os.path.isdir(workdir): 176 cleandir(workdir) 177 else: 178 os.mkdir(workdir) --- 33 unchanged lines hidden (view full) --- 212 def handler(signum, frame): 213 if childpid != 0: 214 os.kill(childpid, signum) 215 216 signal.signal(signal.SIGHUP, handler) 217 signal.signal(signal.SIGINT, handler) 218 signal.signal(signal.SIGQUIT, handler) 219 signal.signal(signal.SIGTERM, handler) |
222 signal.signal(signal.SIGSTOP, handler) | |
223 signal.signal(signal.SIGCONT, handler) 224 signal.signal(signal.SIGUSR1, handler) 225 signal.signal(signal.SIGUSR2, handler) 226 227 done = 0 228 while not done: 229 try: 230 thepid,ec = os.waitpid(childpid, 0) --- 14 unchanged lines hidden --- | 220 signal.signal(signal.SIGCONT, handler) 221 signal.signal(signal.SIGUSR1, handler) 222 signal.signal(signal.SIGUSR2, handler) 223 224 done = 0 225 while not done: 226 try: 227 thepid,ec = os.waitpid(childpid, 0) --- 14 unchanged lines hidden --- |