Skip to content
Snippets Groups Projects
Commit 10e85df0 authored by EXT Jean-Matthieu Etancelin's avatar EXT Jean-Matthieu Etancelin
Browse files

fix simulation parameters writting on restart

parent a1ab32fe
No related branches found
No related tags found
1 merge request!29fix simulation parameters writting on restart
Pipeline #69066 passed
......@@ -380,13 +380,14 @@ class Simulation(object):
if ('file' in kwds) and (kwds['file'] is not None):
kwds['file'].close()
if self.mpi_params.rank == io_params.io_leader:
if os.path.isfile(filename):
if os.path.isfile(filename) and self._restart == 0:
os.remove(filename)
if (fileformat is IO.ASCII):
f = open(filename, 'a')
header = '{}\n'.format('\t'.join('{}({})'.format(
p.name, p.pretty_name) for p in params))
f.write(header)
if self._restart == 0:
f.write(header)
kwds['file'] = f
formatter = {'float_kind': lambda x: '{:.8g}'.format(x)}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment