diff --git a/parametricJob.py b/parametricJob.py index 95d7d018b2098b2039a85910bd7c904326e525aa..3f2af1b1f4f6377804097fa758bda8335d15264e 100644 --- a/parametricJob.py +++ b/parametricJob.py @@ -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)