@@ -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 ()
0 commit comments