Commit 0292fbd0 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

add no-debug option for launcher

parent c5435b26
Pipeline #37284 failed with stage
......@@ -530,6 +530,10 @@ class DNS(_code):
metavar = 'NTHREADS_PER_PROCESS',
help = 'number of threads to use per MPI process',
default = 1)
parser.add_argument(
'--no-debug',
action = 'store_true',
dest = 'no_debug')
parser.add_argument(
'--no-submit',
action = 'store_true',
......@@ -1051,6 +1055,7 @@ class DNS(_code):
njobs = opt.njobs,
hours = opt.minutes // 60,
minutes = opt.minutes % 60,
no_submit = opt.no_submit)
no_submit = opt.no_submit,
no_debug = opt.no_debug)
return None
......@@ -194,7 +194,9 @@ class _code(_base):
outfile.write(self.main)
outfile.write(self.main_end)
return None
def compile_code(self):
def compile_code(
self,
no_debug = False):
# compile code
if not os.path.isfile(os.path.join(bfps.header_dir, 'base.hpp')):
raise IOError('header not there:\n' +
......@@ -206,6 +208,8 @@ class _code(_base):
command_strings = [bfps.install_info['compiler']]
command_strings += [self.name + '.cpp', '-o', self.name]
command_strings += bfps.install_info['extra_compile_args']
if no_debug:
command_strings += ['-DNDEBUG']
command_strings += ['-I' + idir for idir in bfps.install_info['include_dirs']]
command_strings.append('-I' + bfps.header_dir)
command_strings += ['-L' + ldir for ldir in bfps.install_info['library_dirs']]
......@@ -237,7 +241,8 @@ class _code(_base):
hours = 0,
minutes = 10,
njobs = 1,
no_submit = False):
no_submit = False,
no_debug = False):
self.read_parameters()
with h5py.File(os.path.join(self.work_dir, self.simname + '.h5'), 'r') as data_file:
iter0 = data_file['iteration'].value
......@@ -249,7 +254,7 @@ class _code(_base):
need_to_compile = (datetime.fromtimestamp(os.path.getctime(os.path.join(self.work_dir, self.name))) <
bfps.install_info['install_date'])
if need_to_compile:
assert self.compile_code() == 0
assert self.compile_code(no_debug = no_debug) == 0
if self.work_dir != os.path.realpath(os.getcwd()):
shutil.copy(self.name, self.work_dir)
if 'niter_todo' not in self.parameters.keys():
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment