Skip to content
Snippets Groups Projects
Commit 0a20cb17 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

only compile if executable does not exist

parent 23290d32
Branches
Tags
No related merge requests found
...@@ -153,12 +153,13 @@ class code(base): ...@@ -153,12 +153,13 @@ class code(base):
self.read_parameters() self.read_parameters()
with h5py.File(os.path.join(self.work_dir, self.simname + '.h5'), 'r') as data_file: with h5py.File(os.path.join(self.work_dir, self.simname + '.h5'), 'r') as data_file:
iter0 = data_file['iteration'].value iter0 = data_file['iteration'].value
assert(self.compile_code() == 0)
current_dir = os.getcwd()
if not os.path.isdir(self.work_dir): if not os.path.isdir(self.work_dir):
os.makedirs(self.work_dir) os.makedirs(self.work_dir)
if not os.path.exists(os.path.join(self.work_dir, self.name)):
assert(self.compile_code() == 0)
if self.work_dir != './': if self.work_dir != './':
shutil.copy(self.name, self.work_dir) shutil.copy(self.name, self.work_dir)
current_dir = os.getcwd()
os.chdir(self.work_dir) os.chdir(self.work_dir)
os.chdir(current_dir) os.chdir(current_dir)
command_atoms = ['mpirun', command_atoms = ['mpirun',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment