Commit c009fbb9 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Only read the scheduler parameters in engine_config() when restarting.

parent c6a9b81b
......@@ -5631,47 +5631,50 @@ void engine_config(int restart, int fof, struct engine *e,
e->sched.mpi_message_limit =
parser_get_opt_param_int(params, "Scheduler:mpi_message_limit", 4) * 1024;
/* Get the constants for the scheduler */
space_maxsize = parser_get_opt_param_int(params, "Scheduler:cell_max_size",
space_maxsize_default);
space_subsize_pair_hydro =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_pair_hydro",
space_subsize_pair_hydro_default);
space_subsize_self_hydro =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_hydro",
space_subsize_self_hydro_default);
space_subsize_pair_stars =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_pair_stars",
space_subsize_pair_stars_default);
space_subsize_self_stars =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_stars",
space_subsize_self_stars_default);
space_subsize_pair_grav =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_pair_grav",
space_subsize_pair_grav_default);
space_subsize_self_grav =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_grav",
space_subsize_self_grav_default);
space_splitsize = parser_get_opt_param_int(
params, "Scheduler:cell_split_size", space_splitsize_default);
space_subdepth_diff_grav =
parser_get_opt_param_int(params, "Scheduler:cell_subdepth_diff_grav",
space_subdepth_diff_grav_default);
space_extra_parts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_parts", space_extra_parts_default);
space_extra_sparts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_sparts", space_extra_sparts_default);
space_extra_gparts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_gparts", space_extra_gparts_default);
space_extra_bparts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_bparts", space_extra_bparts_default);
engine_max_parts_per_ghost =
parser_get_opt_param_int(params, "Scheduler:engine_max_parts_per_ghost",
engine_max_parts_per_ghost_default);
engine_max_sparts_per_ghost =
parser_get_opt_param_int(params, "Scheduler:engine_max_sparts_per_ghost",
engine_max_sparts_per_ghost_default);
if (restart) {
/* Overwrite the constants for the scheduler */
space_maxsize = parser_get_opt_param_int(params, "Scheduler:cell_max_size",
space_maxsize_default);
space_subsize_pair_hydro =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_pair_hydro",
space_subsize_pair_hydro_default);
space_subsize_self_hydro =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_hydro",
space_subsize_self_hydro_default);
space_subsize_pair_stars =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_pair_stars",
space_subsize_pair_stars_default);
space_subsize_self_stars =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_stars",
space_subsize_self_stars_default);
space_subsize_pair_grav =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_pair_grav",
space_subsize_pair_grav_default);
space_subsize_self_grav =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_grav",
space_subsize_self_grav_default);
space_splitsize = parser_get_opt_param_int(
params, "Scheduler:cell_split_size", space_splitsize_default);
space_subdepth_diff_grav =
parser_get_opt_param_int(params, "Scheduler:cell_subdepth_diff_grav",
space_subdepth_diff_grav_default);
space_extra_parts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_parts", space_extra_parts_default);
space_extra_sparts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_sparts", space_extra_sparts_default);
space_extra_gparts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_gparts", space_extra_gparts_default);
space_extra_bparts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_bparts", space_extra_bparts_default);
engine_max_parts_per_ghost =
parser_get_opt_param_int(params, "Scheduler:engine_max_parts_per_ghost",
engine_max_parts_per_ghost_default);
engine_max_sparts_per_ghost = parser_get_opt_param_int(
params, "Scheduler:engine_max_sparts_per_ghost",
engine_max_sparts_per_ghost_default);
}
/* Allocate and init the threads. */
if (swift_memalign("runners", (void **)&e->runners, SWIFT_CACHE_ALIGNMENT,
......
......@@ -4633,6 +4633,48 @@ void space_init(struct space *s, struct swift_params *params,
"least %d",
maxtcells, needtcells);
/* Get the constants for the scheduler */
space_maxsize = parser_get_opt_param_int(params, "Scheduler:cell_max_size",
space_maxsize_default);
space_subsize_pair_hydro =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_pair_hydro",
space_subsize_pair_hydro_default);
space_subsize_self_hydro =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_hydro",
space_subsize_self_hydro_default);
space_subsize_pair_stars =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_pair_stars",
space_subsize_pair_stars_default);
space_subsize_self_stars =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_stars",
space_subsize_self_stars_default);
space_subsize_pair_grav =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_pair_grav",
space_subsize_pair_grav_default);
space_subsize_self_grav =
parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_grav",
space_subsize_self_grav_default);
space_splitsize = parser_get_opt_param_int(
params, "Scheduler:cell_split_size", space_splitsize_default);
space_subdepth_diff_grav =
parser_get_opt_param_int(params, "Scheduler:cell_subdepth_diff_grav",
space_subdepth_diff_grav_default);
space_extra_parts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_parts", space_extra_parts_default);
space_extra_sparts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_sparts", space_extra_sparts_default);
space_extra_gparts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_gparts", space_extra_gparts_default);
space_extra_bparts = parser_get_opt_param_int(
params, "Scheduler:cell_extra_bparts", space_extra_bparts_default);
engine_max_parts_per_ghost =
parser_get_opt_param_int(params, "Scheduler:engine_max_parts_per_ghost",
engine_max_parts_per_ghost_default);
engine_max_sparts_per_ghost =
parser_get_opt_param_int(params, "Scheduler:engine_max_sparts_per_ghost",
engine_max_sparts_per_ghost_default);
if (verbose) {
message("max_size set to %d split_size set to %d", space_maxsize,
space_splitsize);
......
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