Skip to content

Commit 55bd2dc

Browse files
committed
Merge branch 'new_cluster' of github.com:SSCHAcode/python-sscha into new_cluster
2 parents 843e258 + e99609f commit 55bd2dc

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

Modules/Cluster.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,12 @@ def ExecuteCMD(self, cmd, raise_error = True, return_output = False, on_cluster
326326
if not isinstance(output, str):
327327
try:
328328
output = str(output.decode("utf-8"))
329-
except:
330-
pass
329+
except Exception as e:
330+
sys.stderr.write("Error in the following command:\n")
331+
sys.stderr.write(e)
332+
sys.stderr.write("\n")
333+
sys.stderr.flush()
334+
331335
output = output.strip()
332336
status = p.wait()
333337
if not err is None:
@@ -763,8 +767,12 @@ def batch_submission(self, list_of_structures, calc, indices,
763767
# Get the results
764768
try:
765769
results[i] = self.read_results(calc, lbl)
766-
except:
767-
pass
770+
except Exception as e:
771+
sys.stderr.write("JOB {} | {} resulted in error:\n".format(i, lbl))
772+
sys.stderr.write(e)
773+
sys.stderr.write("\n")
774+
sys.stderr.flush()
775+
768776

769777
return results
770778

@@ -1202,7 +1210,15 @@ def parse_string(self, string):
12021210
# Open a pipe with the server
12031211
# Use single ' to avoid string parsing by the local terminal
12041212
cmd = "%s %s 'echo \"%s\"'" % (self.sshcmd, self.hostname, string)
1213+
1214+
if self.use_active_shell:
1215+
cmd = "{ssh} {host} -t '{shell} --login -c \"echo {string}\"'".format(ssh = self.sshcmd,
1216+
host = self.hostname,
1217+
string = string.replace("$", "\$"),
1218+
shell = self.terminal)
12051219
#print cmd
1220+
1221+
#print(cmd)
12061222

12071223
status, output = self.ExecuteCMD(cmd, return_output = True)
12081224
#

0 commit comments

Comments
 (0)