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

code compiles and links successfully

It also successfully gives the "wrong number of command line arguments"
message.
parent 48629ea6
Branches
Tags
1 merge request!21Bugfix/nansampling
...@@ -76,21 +76,26 @@ class _base(object): ...@@ -76,21 +76,26 @@ class _base(object):
function_suffix = '', function_suffix = '',
template_class = '', template_class = '',
template_prefix = '', template_prefix = '',
file_group = 'parameters'): file_group = 'parameters',
just_declaration = False,
simname_variable = 'simname'):
if type(parameters) == type(None): if type(parameters) == type(None):
parameters = self.parameters parameters = self.parameters
key = sorted(list(parameters.keys())) key = sorted(list(parameters.keys()))
src_txt = (template_prefix + src_txt = (template_prefix +
'int ' + 'int ' +
template_class + template_class +
'read_parameters' + function_suffix + '()\n{\n' + 'read_parameters' + function_suffix + '()')
'hid_t parameter_file;\n' + if just_declaration:
'hid_t dset, memtype, space;\n' + return src_txt + ';\n'
'char fname[256];\n' + src_txt += ('\n{\n' +
'hsize_t dims[1];\n' + 'hid_t parameter_file;\n' +
'char *string_data;\n' + 'hid_t dset, memtype, space;\n' +
'sprintf(fname, "%s.h5", simname);\n' + 'char fname[256];\n' +
'parameter_file = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);\n') 'hsize_t dims[1];\n' +
'char *string_data;\n' +
'sprintf(fname, "%s.h5", {0});\n'.format(simname_variable) +
'parameter_file = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);\n')
for i in range(len(key)): for i in range(len(key)):
src_txt += 'dset = H5Dopen(parameter_file, "/{0}/{1}", H5P_DEFAULT);\n'.format( src_txt += 'dset = H5Dopen(parameter_file, "/{0}/{1}", H5P_DEFAULT);\n'.format(
file_group, key[i]) file_group, key[i])
......
...@@ -56,6 +56,7 @@ int main_code( ...@@ -56,6 +56,7 @@ int main_code(
std::cerr << std::cerr <<
"Wrong number of command line arguments. Stopping." << "Wrong number of command line arguments. Stopping." <<
std::endl; std::endl;
MPI_Init(&argc, &argv);
MPI_Finalize(); MPI_Finalize();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment