Commit 07029747 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

Merge branch 'bugfix/segfault' into v1.2

parents 669fe9c1 73a49f5c
......@@ -368,6 +368,7 @@ class NavierStokes(_fluid_particle_base):
strncpy(fs->forcing_type, forcing_type, 128);
fs->iteration = iteration;
fs->read('v', 'c');
DEBUG_MSG("finished reading field\\n");
if (fs->cd->myrank == 0)
{{
H5T_field_complex = H5Tcreate(H5T_COMPOUND, sizeof(tmp_complex_type));
......@@ -399,11 +400,11 @@ class NavierStokes(_fluid_particle_base):
'if (fs->cd->myrank == 0)\n' +
'{\n' +
'delete[] kindices;\n' +
'H5Tclose(H5T_field_complex);\n' +
'}\n' +
'delete fs;\n')
'H5Tclose(H5T_field_complex);\n')
if self.parameters['nparticles'] > 0:
self.fluid_end += 'H5Fclose(particle_file);\n'
self.fluid_end += ('}\n' +
'delete fs;\n')
return None
def add_3D_rFFTW_field(
self,
......@@ -1001,8 +1002,7 @@ class NavierStokes(_fluid_particle_base):
return None
def prepare_launch(
self,
args = [],
noparticles = False):
args = []):
opt = _code.prepare_launch(self, args = args)
# with the default Lundgren forcing, I can estimate the dissipation
# with nondefault forcing, figure out the amplitude for this viscosity
......@@ -1029,6 +1029,15 @@ class NavierStokes(_fluid_particle_base):
self.name += '-QR'
if len(opt.src_work_dir) == 0:
opt.src_work_dir = opt.work_dir
self.pars_from_namespace(opt)
return opt
def launch(
self,
args = [],
noparticles = False,
**kwargs):
opt = self.prepare_launch(args = args)
self.fill_up_fluid_code()
if noparticles:
opt.nparticles = 0
elif opt.nparticles > 0:
......@@ -1041,14 +1050,6 @@ class NavierStokes(_fluid_particle_base):
integration_steps = [4],
interpolator = 'cubic_spline',
acc_name = 'rFFTW_acc')
self.pars_from_namespace(opt)
return opt
def launch(
self,
args = [],
**kwargs):
opt = self.prepare_launch(args = args)
self.fill_up_fluid_code()
self.finalize_code()
self.launch_jobs(opt = opt)
return None
......
......@@ -62,6 +62,7 @@ class _base(object):
def cread_pars(self):
key = sorted(list(self.parameters.keys()))
src_txt = ('int read_parameters(hid_t data_file_id)\n{\n'
# + 'DEBUG_MSG("entered read_parameters\\n");\n'
+ 'hid_t dset, memtype, space;\n'
+ 'hsize_t dims[1];\n'
+ 'char *string_data;\n')
......@@ -82,6 +83,7 @@ class _base(object):
else:
src_txt += 'H5Dread(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &{0});\n'.format(key[i])
src_txt += 'H5Dclose(dset);\n'
#src_txt += 'DEBUG_MSG("exiting read_parameters\\n");\n' # finishing read_parameters
src_txt += 'return 0;\n}\n' # finishing read_parameters
return src_txt
def cprint_pars(self):
......
Markdown is supported
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