Skip to content
Snippets Groups Projects
Commit 750437e5 authored by Berenger Bramas's avatar Berenger Bramas
Browse files

Update after rebase and set long long in the python from 1Billion particles

parent 3e467330
Branches
Tags
2 merge requests!21Bugfix/nansampling,!11Feature/longlong particles
......@@ -56,7 +56,7 @@ class _base(object):
key = sorted(list(parameters.keys()))
src_txt = ''
for i in range(len(key)):
if (type(parameters[key[i]]) == int && parameters[key[i]] >= 1<<30) || type(parameters[key[i]]) == long:
if (type(parameters[key[i]]) == int and parameters[key[i]] >= 1<<30):
src_txt += 'long long int ' + key[i] + ';\n'
elif type(parameters[key[i]]) == int:
src_txt += 'int ' + key[i] + ';\n'
......@@ -101,7 +101,7 @@ class _base(object):
for i in range(len(key)):
src_txt += 'dset = H5Dopen(parameter_file, "/{0}/{1}", H5P_DEFAULT);\n'.format(
file_group, key[i])
if (type(parameters[key[i]]) == int && parameters[key[i]] >= 1<<30) || type(parameters[key[i]]) == long:
if (type(parameters[key[i]]) == int and parameters[key[i]] >= 1<<30):
src_txt += 'H5Dread(dset, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, &{0});\n'.format(key[i])
elif type(parameters[key[i]]) == int:
src_txt += 'H5Dread(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &{0});\n'.format(key[i])
......
......@@ -63,7 +63,7 @@ int NSVEp<rnumber>::initialize(void)
fs->cvelocity, // (field object)
fs->kk, // (kspace object, contains dkx, dky, dkz)
tracers0_integration_steps, // to check coherency between parameters and hdf input file (nb rhs)
nparticles, // to check coherency between parameters and hdf input file
(long long int)nparticles, // to check coherency between parameters and hdf input file
fs->get_current_fname(), // particles input filename
std::string("/tracers0/state/") + std::to_string(fs->iteration), // dataset name for initial input
std::string("/tracers0/rhs/") + std::to_string(fs->iteration), // dataset name for initial input
......@@ -71,7 +71,7 @@ int NSVEp<rnumber>::initialize(void)
tracers0_smoothness, // parameter
this->comm,
fs->iteration+1);
this->particles_output_writer_mpi = new particles_output_hdf5<double,3,3>(
this->particles_output_writer_mpi = new particles_output_hdf5<long long int,double,3,3>(
MPI_COMM_WORLD,
"tracers0",
nparticles,
......
......@@ -63,8 +63,8 @@ class NSVEp: public direct_numerical_simulation
vorticity_equation<rnumber, FFTW> *fs;
field<rnumber, FFTW, THREE> *tmp_vec_field;
field<rnumber, FFTW, ONE> *tmp_scal_field;
std::unique_ptr<abstract_particles_system<double>> ps;
particles_output_hdf5<double,3,3> *particles_output_writer_mpi;
std::unique_ptr<abstract_particles_system<long long int, double>> ps;
particles_output_hdf5<long long int, double,3,3> *particles_output_writer_mpi;
NSVEp(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment