Commit 0d1c2ebb authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

The parallel i/o should also not get the DM part mass.

parent 2b015f3f
......@@ -856,13 +856,12 @@ int main(int argc, char *argv[]) {
#if defined(HAVE_HDF5)
#if defined(WITH_MPI)
#if defined(HAVE_PARALLEL_HDF5)
read_ic_parallel(ICfileName, &us, dim, &parts, &gparts, &sparts, &bparts,
&Ngas, &Ngpart, &Ngpart_background, &Nspart, &Nbpart,
&flag_entropy_ICs, &high_res_DM_mass, with_hydro,
(with_external_gravity || with_self_gravity), with_stars,
with_black_holes, cleanup_h, cleanup_sqrt_a, cosmo.h,
cosmo.a, myrank, nr_nodes, MPI_COMM_WORLD, MPI_INFO_NULL,
nr_threads, dry_run);
read_ic_parallel(
ICfileName, &us, dim, &parts, &gparts, &sparts, &bparts, &Ngas, &Ngpart,
&Ngpart_background, &Nspart, &Nbpart, &flag_entropy_ICs, with_hydro,
(with_external_gravity || with_self_gravity), with_stars,
with_black_holes, cleanup_h, cleanup_sqrt_a, cosmo.h, cosmo.a, myrank,
nr_nodes, MPI_COMM_WORLD, MPI_INFO_NULL, nr_threads, dry_run);
#else
read_ic_serial(
ICfileName, &us, dim, &parts, &gparts, &sparts, &bparts, &Ngas, &Ngpart,
......
......@@ -49,7 +49,7 @@ Gravity:
# Parameters for the hydrodynamics scheme
SPH:
resolution_eta: 1.48691 # 100 ngb with wendland0-c2
resolution_eta: 1.48691 # 100 ngb with wendland0-c2
h_min_ratio: 0.1 # Minimal smoothing in units of softening.
CFL_condition: 0.1 # Courant-Friedrich-Levy condition for time integration.
minimal_temperature: 100 # (internal units)
......
......@@ -706,10 +706,10 @@ void read_ic_parallel(char* fileName, const struct unit_system* internal_units,
struct spart** sparts, struct bpart** bparts,
size_t* Ngas, size_t* Ngparts, size_t* Ngparts_background,
size_t* Nstars, size_t* Nblackholes, int* flag_entropy,
float* gpart_mass, int with_hydro, int with_gravity,
int with_stars, int with_black_holes, int cleanup_h,
int cleanup_sqrt_a, double h, double a, int mpi_rank,
int mpi_size, MPI_Comm comm, MPI_Info info, int n_threads,
int with_hydro, int with_gravity, int with_stars,
int with_black_holes, int cleanup_h, int cleanup_sqrt_a,
double h, double a, int mpi_rank, int mpi_size,
MPI_Comm comm, MPI_Info info, int n_threads,
int dry_run) {
hid_t h_file = 0, h_grp = 0;
......@@ -981,13 +981,6 @@ void read_ic_parallel(char* fileName, const struct unit_system* internal_units,
/* Prepare the DM particles */
io_prepare_dm_gparts(&tp, *gparts, Ndm);
/* Record the mass of the DM particles */
const float local_gpart_mass = (*gparts)[0].mass;
float global_gpart_mass;
MPI_Allreduce(&local_gpart_mass, &global_gpart_mass, 1, MPI_FLOAT, MPI_MAX,
comm);
*gpart_mass = global_gpart_mass;
/* Prepare the DM background particles */
io_prepare_dm_background_gparts(&tp, *gparts + Ndm, Ndm_background);
......
......@@ -38,11 +38,11 @@ void read_ic_parallel(char* fileName, const struct unit_system* internal_units,
struct spart** sparts, struct bpart** bparts,
size_t* Ngas, size_t* Ngparts, size_t* Ngparts_background,
size_t* Nsparts, size_t* Nbparts, int* flag_entropy,
float* gpart_mass, int with_hydro, int with_gravity,
int with_stars, int with_black_holes, int cleanup_h,
int cleanup_sqrt_a, double h, double a, int mpi_rank,
int mpi_size, MPI_Comm comm, MPI_Info info,
int nr_threads, int dry_run);
int with_hydro, int with_gravity, int with_stars,
int with_black_holes, int cleanup_h, int cleanup_sqrt_a,
double h, double a, int mpi_rank, int mpi_size,
MPI_Comm comm, MPI_Info info, int nr_threads,
int dry_run);
void write_output_parallel(struct engine* e, const char* baseName,
const struct unit_system* internal_units,
......
Supports Markdown
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