- Timestamp:
- Sep 6, 2017 2:28:14 PM (7 years ago)
- Location:
- palm/trunk/SCRIPTS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_wd
r1754 r2416 25 25 # ----------------- 26 26 # $Id$ 27 # Adapted for palmrun 28 # 29 # 1754 2016-02-22 13:50:22Z maronga 27 30 # 28 31 # 1753 2016-02-22 13:49:49Z maronga … … 662 665 # Return internal jobname 663 666 jobname = self.table.item(self.table.currentRow(),6).text() 667 jobrealname = self.table.item(self.table.currentRow(),0).text() 664 668 665 669 # Check description of job in order to login on the correct host … … 700 704 def ShowDetails(self): 701 705 702 jobname = self.table.item(self.table.currentRow(),6).text() 706 jobname = self.table.item(self.table.currentRow(),6).text() 703 707 descr = self.table.item(self.table.currentRow(),1).text() 704 708 for h in range(0,len(description)): … … 725 729 # Return internal jobname 726 730 jobname = self.table.item(self.table.currentRow(),6).text() 727 731 jobrealname = self.table.item(self.table.currentRow(),0).text() 728 732 # Check description of job in order to login on the correct host 729 733 descr = self.table.item(self.table.currentRow(),1).text() … … 733 737 user = username[h] 734 738 735 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/python palm_wdd stop " + user + " " + jobname],739 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/python palm_wdd stop " + jobrealname], 736 740 shell=False, 737 741 stdout=sub.PIPE, … … 756 760 # Return internal jobname 757 761 jobname = self.table.item(self.table.currentRow(),6).text() 758 762 jobrealname = self.table.item(self.table.currentRow(),0).text() 763 759 764 # Check description of job in order to login on the correct host 760 765 descr = self.table.item(self.table.currentRow(),1).text() … … 764 769 user = username[h] 765 770 766 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/python palm_wdd restart " + user + " " + jobname],771 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/python palm_wdd restart " + jobrealname], 767 772 shell=False, 768 773 stdout=sub.PIPE, … … 796 801 user = username[h] 797 802 798 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/python palm_wdd parin " + user + " " + jobname],803 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/python palm_wdd parin " + jobrealname], 799 804 shell=False, 800 805 stdout=sub.PIPE, … … 829 834 user = username[h] 830 835 831 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/python palm_wdd rc " + user + " " + jobname],836 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/python palm_wdd rc " + jobrealname], 832 837 shell=False, 833 838 stdout=sub.PIPE, -
palm/trunk/SCRIPTS/palm_wd_files/.wdd.config.hlrnIII
r1618 r2416 5 5 [Settings] 6 6 readqueue="showq | egrep" 7 tmpdir="/gfs1/ tmp/"7 tmpdir="/gfs1/work/" 8 8 canceljob="canceljob" 9 9 checkjob="checkjob" -
palm/trunk/SCRIPTS/palm_wdd
r2062 r2416 20 20 # Current revisions: 21 21 # ----------------- 22 # 22 # 23 23 # 24 24 # Former revisions: 25 25 # ----------------- 26 26 # $Id$ 27 # 28 # Bugfix: return proper error messages when .wdd.config is not found and for29 # wrong actions27 # Adapted for palmrun 28 # 29 # 1619 2015-07-13 06:53:19Z maronga 30 30 # 31 31 # 1618 2015-07-13 06:52:15Z maronga … … 65 65 import ConfigParser 66 66 import os 67 import pwd 67 68 from subprocess import check_output 68 69 import sys 69 import socket 70 70 71 71 72 # Read configuration file 72 73 # First check if the configuration file exists 73 74 if ( os.path.exists('.wdd.config') == False ): 74 sys.stderr.write("No configuration file .wdd.config found on remote host %s." % socket.gethostname())75 print "Error. No configuration file .wdd.config found." 75 76 raise SystemExit 76 77 … … 89 90 action = str(sys.argv[1]) 90 91 data = str(sys.argv[2]) 91 if ( len(sys.argv) > 3 ): 92 data2 = str(sys.argv[3]) 93 94 95 cmd_readqueue = cmd_readqueue + " " + data 96 cmd_tmpdir = cmd_tmpdir + data 92 93 cmd_readqueue = cmd_readqueue + " " + pwd.getpwuid( os.getuid() )[ 0 ] 94 cmd_tmpdir = cmd_tmpdir + pwd.getpwuid( os.getuid() )[ 0 ] 97 95 98 96 # reading queuing system … … 137 135 out = check_output(cmd_progress, shell=True, stderr=devnull) 138 136 progress_lines = out.splitlines() 139 job_progress = progress_lines[1].split(" ")[ 1]137 job_progress = progress_lines[1].split(" ")[3] 140 138 out = None 141 139 except: … … 192 190 193 191 194 def DoStopNow( username,jobid):195 196 # collect progress information 197 cmd_dostop = "touch " + cmd_tmpdir + "/" + username + "." + jobid.partition(".")[2]+ "/DO_STOP_NOW"192 def DoStopNow(jobid): 193 194 # collect progress information 195 cmd_dostop = "touch " + cmd_tmpdir + "/" + jobid + "/DO_STOP_NOW" 198 196 try: 199 197 devnull = open(os.devnull, 'w') … … 204 202 return return_message 205 203 206 def DoRestartNow( username,jobid):207 208 # collect progress information 209 cmd_dorestart = "touch " + cmd_tmpdir + "/" + username + "." + jobid.partition(".")[2]+ "/DO_RESTART_NOW"204 def DoRestartNow(jobid): 205 206 # collect progress information 207 cmd_dorestart = "touch " + cmd_tmpdir + "/" + jobid + "/DO_RESTART_NOW" 210 208 try: 211 209 devnull = open(os.devnull, 'w') … … 216 214 return return_message 217 215 218 def GetPARIN( username,jobid):219 220 # collect progress information 221 cmd_dorestart = "cat " + cmd_tmpdir + "/" + username + "." + jobid.partition(".")[2]+ "/PARIN"216 def GetPARIN(jobid): 217 218 # collect progress information 219 cmd_dorestart = "cat " + cmd_tmpdir + "/" + jobid + "/PARIN" 222 220 try: 223 221 devnull = open(os.devnull, 'w') … … 226 224 out = None 227 225 except: 228 return_message = "Action failed." 226 return_message = "Action failed." + "cat " + cmd_tmpdir + "/" + jobid + "/PARIN" 229 227 230 228 return return_message 231 229 232 def GetRC( username,jobid):233 234 # collect progress information 235 cmd_dorestart = "cat " + cmd_tmpdir + "/" + username + "." + jobid.partition(".")[2]+ "/RUN_CONTROL"230 def GetRC(jobid): 231 232 # collect progress information 233 cmd_dorestart = "cat " + cmd_tmpdir + "/" + jobid + "/RUN_CONTROL" 236 234 try: 237 235 devnull = open(os.devnull, 'w') … … 240 238 out = None 241 239 except: 242 return_message = "Action failed." 240 return_message = "Action failed." 243 241 244 242 return return_message … … 254 252 print GetStartTime(data) 255 253 elif ( action == "stop"): 256 print DoStopNow(data ,data2)254 print DoStopNow(data) 257 255 elif ( action == "restart"): 258 print DoRestartNow(data ,data2)256 print DoRestartNow(data) 259 257 elif ( action == "parin"): 260 print GetPARIN(data ,data2)258 print GetPARIN(data) 261 259 elif ( action == "rc"): 262 print GetRC(data ,data2)260 print GetRC(data) 263 261 else: 264 sys.stderr.write("Unknown action on remote host %s." % hostname)265 262 print "Error. Action " + action + " unknown." 263
Note: See TracChangeset
for help on using the changeset viewer.