Skip to content

Commit 4a54740

Browse files
committed
Ensure to pass killall the correct process name.
1 parent 88bdc9d commit 4a54740

7 files changed

Lines changed: 432 additions & 220 deletions

TestCases/TestCase.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ def __init__(self,tag_in):
6868
self.cpu_arch = platform.processor()
6969
self.enabled_on_cpu_arch = ["x86_64", "aarch64"]
7070

71-
# These can be optionally varied
72-
self.su2_exec = "SU2_CFD"
71+
# These can be optionally varied
72+
self.su2_exec_prefix = ""
73+
self.su2_exec = "SU2_CFD"
74+
self.su2_exec_suffix = ""
7375
self.timeout = 300
7476
self.tol = 0.001
7577

@@ -92,8 +94,8 @@ def run_test(self):
9294

9395
# if root, add flag to mpirun
9496
if os.geteuid()==0:
95-
if self.su2_exec.startswith('mpirun'):
96-
self.su2_exec = self.su2_exec.replace('mpirun', 'mpirun --allow-run-as-root')
97+
if self.su2_exec_prefix.startswith('mpirun'):
98+
self.su2_exec_prefix = self.su2_exec_prefix.replace('mpirun', 'mpirun --allow-run-as-root')
9799

98100
# Adjust the number of iterations in the config file
99101
if len(self.test_vals) != 0:
@@ -111,11 +113,11 @@ def run_test(self):
111113

112114
# Check for polar calls
113115
if self.polar:
114-
command = "%s > %s" % (self.su2_exec, logfilename)
116+
command = "%s %s %s > %s" % (self.su2_exec_prefix, self.su2_exec, self.su2_exec_suffix, logfilename)
115117
else:
116-
command = "%s %s > %s 2>&1" % (self.su2_exec,
117-
self.cfg_file,
118-
logfilename)
118+
command = "%s %s %s %s > %s 2>&1" % (self.su2_exec_prefix, self.su2_exec, self.su2_exec_suffix,
119+
self.cfg_file,
120+
logfilename)
119121

120122
self.adjust_test_data()
121123

@@ -252,12 +254,12 @@ def run_filediff(self):
252254

253255
# if root, add flag to mpirun
254256
if os.geteuid()==0:
255-
if self.su2_exec.startswith('mpirun'):
256-
self.su2_exec = self.su2_exec.replace('mpirun', 'mpirun --allow-run-as-root')
257+
if self.su2_exec_prefix.startswith('mpirun'):
258+
self.su2_exec_prefix = self.su2_exec_prefix.replace('mpirun', 'mpirun --allow-run-as-root')
257259

258260
# Assemble the shell command to run
259261
logfilename = '%s.log' % os.path.splitext(self.cfg_file)[0]
260-
command = "%s %s > %s 2>&1" % (self.su2_exec, self.cfg_file, logfilename)
262+
command = "%s %s %s %s > %s 2>&1" % (self.su2_exec_prefix, self.su2_exec, self.su2_exec_suffix, self.cfg_file, logfilename)
261263

262264
# Run SU2
263265
workdir = os.getcwd()
@@ -350,7 +352,7 @@ def run_opt(self):
350352

351353
# Assemble the shell command to run SU2
352354
logfilename = '%s.log' % os.path.splitext(self.cfg_file)[0]
353-
command = "%s %s > %s 2>&1" % (self.su2_exec, self.cfg_file, logfilename)
355+
command = "%s %s %s %s > %s 2>&1" % (self.su2_exec_prefix, self.su2_exec, self.su2_exec_suffix, self.cfg_file, logfilename)
354356

355357
# Run SU2
356358
workdir = os.getcwd()
@@ -477,12 +479,12 @@ def run_geo(self):
477479

478480
# if root, add flag to mpirun
479481
if os.geteuid()==0:
480-
if self.su2_exec.startswith('mpirun'):
481-
self.su2_exec = self.su2_exec.replace('mpirun', 'mpirun --allow-run-as-root')
482+
if self.su2_exec_prefix.startswith('mpirun'):
483+
self.su2_exec_prefix = self.su2_exec_prefix.replace('mpirun', 'mpirun --allow-run-as-root')
482484

483485
# Assemble the shell command to run SU2
484486
logfilename = '%s.log' % os.path.splitext(self.cfg_file)[0]
485-
command = "%s %s > %s 2>&1" % (self.su2_exec, self.cfg_file, logfilename)
487+
command = "%s %s %s %s > %s 2>&1" % (self.su2_exec_prefix, self.su2_exec, self.su2_exec_suffix, self.cfg_file, logfilename)
486488

487489
# Run SU2
488490
workdir = os.getcwd()
@@ -606,12 +608,12 @@ def run_def(self):
606608

607609
# if root, add flag to mpirun
608610
if os.geteuid()==0:
609-
if self.su2_exec.startswith('mpirun'):
610-
self.su2_exec = self.su2_exec.replace('mpirun', 'mpirun --allow-run-as-root')
611+
if self.su2_exec_prefix.startswith('mpirun'):
612+
self.su2_exec_prefix = self.su2_exec_prefix.replace('mpirun', 'mpirun --allow-run-as-root')
611613

612614
# Assemble the shell command to run SU2
613615
logfilename = '%s.log' % os.path.splitext(self.cfg_file)[0]
614-
command = "%s %s > %s 2>&1" % (self.su2_exec, self.cfg_file, logfilename)
616+
command = "%s %s %s %s > %s 2>&1" % (self.su2_exec_prefix, self.su2_exec, self.su2_exec_suffix, self.cfg_file, logfilename)
615617

616618
# Run SU2
617619
workdir = os.getcwd()

TestCases/hybrid_regression.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,8 @@ def main():
765765
pywrapper_translating_naca0012 = TestCase('pywrapper_translating_naca0012')
766766
pywrapper_translating_naca0012.cfg_dir = "py_wrapper/translating_NACA0012"
767767
pywrapper_translating_naca0012.cfg_file = "config.cfg"
768-
pywrapper_translating_naca0012.su2_exec = "python run_su2.py"
768+
pywrapper_translating_naca0012.su2_exec = "python"
769+
pywrapper_translating_naca0012.su2_exec_suffix = "run_su2.py"
769770
pywrapper_translating_naca0012.timeout = 60
770771
pywrapper_translating_naca0012.reference_file = "forces_0.csv.ref"
771772
pywrapper_translating_naca0012.reference_file_aarch64 = "forces_0_aarch64.csv.ref"
@@ -778,7 +779,8 @@ def main():
778779
######################################
779780

780781
for test in test_list:
781-
test.su2_exec = "SU2_CFD -t 2"
782+
test.su2_exec = "SU2_CFD"
783+
test.su2_exec_suffix = "-t 2"
782784
test.timeout = 600
783785
test.tol = 1e-4
784786
#end

TestCases/hybrid_regression_AD.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ def main():
215215
######################################
216216

217217
for test in test_list:
218-
test.su2_exec = "SU2_CFD_AD -t 2"
218+
test.su2_exec = "SU2_CFD_AD"
219+
test.su2_exec_suffix = "-t 2"
219220
test.timeout = 600
220221
test.tol = 1e-4
221222
#end

0 commit comments

Comments
 (0)