Skip to content
Snippets Groups Projects
Commit adfc4031 authored by Papeleux Luc's avatar Papeleux Luc
Browse files

fix batch atrm / kill scripts

parent d80cf230
No related branches found
No related tags found
No related merge requests found
......@@ -326,24 +326,24 @@ class ParametricJob(PRMSet):
if m:
#cfgFileName, cfgFileExtension = os.path.splitext(self.cfgfile)
#os.system("cp %s %s%s%s"%(self.cfgfile, cfgFileName, batchId, cfgFileExtension))
self.atrmScript(batchId)
self.atrmScript(batchId, launchId)
print("\tuse 'atq' and find job number %s to check the status of your job" % batchId)
print("\t\t - 'a' means waiting in the queue 'a'")
print("\t\t - '=' means running")
print("\tuse 'atrm %s to kill the job" % batchId)
print("\t\t or 'atrm%s.py' to kill the job" % batchId)
print("\t\t or 'atrm%s.py' to kill the job" % launchId)
# to avoid closing the gui
if not (re.match(r'(.+)Gui.pyw', sys.argv[0])):
sys.exit()
def atrmScript(self, pid):
filename = "atrm%s.py"%pid
def atrmScript(self, batchId, launchId):
filename = "atrm%s.py"%launchId
file=open(filename,"w")
file.write("#!/usr/bin/env python\n")
file.write("import os\n")
file.write("os.system('atrm %s')\n" % pid)
file.write("if os.path.isfile('kill%s.py'):\n" % pid)
file.write("\texecfile('kill%s.py')\n" % pid)
file.write("os.system('atrm %s')\n" % batchId)
file.write("if os.path.isfile('kill%s.py'):\n" % launchId)
file.write("\texecfile('kill%s.py')\n" % launchId)
file.close()
os.chmod(filename,0o700)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment