New timing, moved MPI reduction into function call, started converting some of the pointers into std::vectors

This commit is contained in:
Yohai Meiron 2020-05-09 18:21:01 -04:00
parent 1a438449a8
commit 329dd2ca4d
5 changed files with 88 additions and 312 deletions

4
io.cpp
View file

@ -146,7 +146,7 @@ void h5_read(const std::string file_name, int *step_num, int *N, double *t, doub
#endif
}
void h5_write(const std::string file_name, const int step_num, const int N, const double t, const double *m, const double3 *x, const double3 *v, const double *pot, const double3 *acc, const double3 *jrk, const int extra_mode=0, const bool use_double_precision=true)
void h5_write(const std::string file_name, const int step_num, const int N, const double t, const double *m, const double3 *x, const double3 *v, const std::vector<double>& pot, const double3 *acc, const double3 *jrk, const int extra_mode=0, const bool use_double_precision=true)
{
#ifdef HAS_HDF5
hid_t file_id, group_id, attribute_id, dataspace_id;
@ -181,7 +181,7 @@ void h5_write(const std::string file_name, const int step_num, const int N, cons
bool write_pot = (extra_mode ) & 1;
bool write_acc = (extra_mode >> 1) & 1;
bool write_jrk = (extra_mode >> 2) & 1;
if (write_pot) write_dataset("POT", 1, (double*)pot);
if (write_pot) write_dataset("POT", 1, (double*)pot.data());
if (write_acc) write_dataset("ACC", 2, (double*)acc);
if (write_jrk) write_dataset("JRK", 2, (double*)jrk);