Skip to content

Commit 0b021a7

Browse files
committed
Revert "Add an option for disabling preacc to tests."
This reverts commit dfe691b.
1 parent 8ed32fc commit 0b021a7

1 file changed

Lines changed: 0 additions & 51 deletions

File tree

TestCases/TestCase.py

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def __init__(self,tag_in):
6868
self.su2_exec = "SU2_CFD"
6969
self.timeout = 300
7070
self.tol = 0.001
71-
self.no_preacc = False
7271

7372
# Options for file-comparison tests
7473
self.reference_file = "of_grad.dat.ref"
@@ -96,10 +95,6 @@ def run_test(self):
9695
if self.no_restart:
9796
self.disable_restart()
9897

99-
# Check for disabling preacc
100-
if self.no_preacc:
101-
self.disable_preacc()
102-
10398
# Assemble the shell command to run SU2
10499
if len(self.test_vals) != 0:
105100
logfilename = '%s.log' % os.path.splitext(self.cfg_file)[0]
@@ -237,10 +232,6 @@ def run_filediff(self):
237232
# Adjust the number of iterations in the config file
238233
self.adjust_iter()
239234

240-
# Check for disabling preacc
241-
if self.no_preacc:
242-
self.disable_preacc()
243-
244235
# if root, add flag to mpirun
245236
if os.geteuid()==0:
246237
if self.su2_exec.startswith('mpirun'):
@@ -333,10 +324,6 @@ def run_opt(self):
333324
# Adjust the number of iterations in the config file
334325
self.adjust_opt_iter()
335326

336-
# Check for disabling preacc
337-
if self.no_preacc:
338-
self.disable_preacc()
339-
340327
# Assemble the shell command to run SU2
341328
logfilename = '%s.log' % os.path.splitext(self.cfg_file)[0]
342329
command = "%s %s > %s 2>&1" % (self.su2_exec, self.cfg_file, logfilename)
@@ -774,41 +761,3 @@ def disable_restart(self):
774761

775762
return
776763

777-
def disable_preacc(self):
778-
779-
# Read the cfg file
780-
workdir = os.getcwd()
781-
os.chdir(self.cfg_dir)
782-
file_in = open(self.cfg_file, 'r')
783-
lines = file_in.readlines()
784-
file_in.close()
785-
786-
# Rewrite the file with a .autotest extension
787-
extension_added = False
788-
if not self.cfg_file.endswith('.autotest'):
789-
self.cfg_file = "%s.autotest"%self.cfg_file
790-
extension_added = True
791-
file_out = open(self.cfg_file,'w')
792-
lines_to_skip = 0
793-
if extension_added:
794-
file_out.write('% This file automatically generated by the regression script\n')
795-
file_out.write('% Preaccumulation disabled\n')
796-
else:
797-
while lines[lines_to_skip].startswith('%'):
798-
file_out.write(lines[lines_to_skip])
799-
lines_to_skip += 1
800-
file_out.write('% Preaccumulation disabled\n')
801-
preacc_configured = False
802-
for line in lines[lines_to_skip:]:
803-
if not line.startswith("PREACC"):
804-
file_out.write(line)
805-
else:
806-
preacc_configured = True
807-
file_out.write("PREACC= NO\n")
808-
if not preacc_configured:
809-
file_out.write("PREACC= NO\n")
810-
811-
file_out.close()
812-
os.chdir(workdir)
813-
814-
return

0 commit comments

Comments
 (0)