Commit eacf9c23 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Add timebins as sole edge weights and with particle counts as well.

Naming was getting messy, so adopt a more obvious scheme of vertex/edge descriptions
parent 070794d2
......@@ -79,8 +79,13 @@ DomainDecomposition:
initial_grid_x: 10 # (Optional) Grid size if the "grid" strategy is chosen.
initial_grid_y: 10 # ""
initial_grid_z: 10 # ""
repartition_type: task_costs # (Optional) The re-decomposition strategy: "none", "task_costs", "particle_weights",
# "edge_task_costs", "hybrid_weights" or "bin_weights"
repartition_type: costs/costs # (Optional) The re-decomposition strategy, one of:
# "none/none", "costs/costs", "counts/none", "none/costs", "counts/costs",
# "costs/time" or "none/time".
# These are vertex/edge weights with "costs" as task timing, "counts" as
# sum of particles and "time" as the expected time of the next updates
trigger: 0.05 # (Optional) Fractional (<1) CPU time difference between MPI ranks required to trigger a
# new decomposition, or number of steps (>1) between decompositions
minfrac: 0.9 # (Optional) Fractional of all particles that should be updated in previous step when
......@@ -120,7 +125,7 @@ SineWavePotential:
amplitude: 10. # Amplitude of the sine wave (internal units)
timestep_limit: 1. # Time-step dimensionless pre-factor.
growth_time: 0. # (Optional) Time for the potential to grow to its final size.
# Parameters related to cooling function ----------------------------------------------
# Constant du/dt cooling function
......
......@@ -64,11 +64,13 @@ const char *initial_partition_name[] = {
/* Simple descriptions of repartition types for reports. */
const char *repartition_name[] = {
"none",
"METIS edge and vertex cost weights",
"METIS edge and vertex task cost weights",
"METIS particle count vertex weights",
"METIS cost edge weights",
"METIS particle count vertex and cost edge weights",
"METIS vertex costs and edge delta timebin weights",
"METIS task cost edge weights",
"METIS particle count vertex and task cost edge weights",
"METIS vertex task costs and edge delta timebin weights",
"METIS particle count vertex and edge delta timebin weights",
"METIS edge delta timebin weights",
};
/* Local functions, if needed. */
......@@ -841,17 +843,23 @@ void partition_repartition(struct repartition *reparttype, int nodeID,
#if defined(WITH_MPI) && defined(HAVE_METIS)
if (reparttype->type == REPART_METIS_VERTEX_COSTS_EDGE_COSTS) {
repart_edge_metis(1, 1, 0, nodeID, nr_nodes, s, tasks, nr_tasks);
repart_edge_metis(0, 1, 0, nodeID, nr_nodes, s, tasks, nr_tasks);
} else if (reparttype->type == REPART_METIS_EDGE_COSTS) {
repart_edge_metis(0, 0, 0, nodeID, nr_nodes, s, tasks, nr_tasks);
} else if (reparttype->type == REPART_METIS_VERTEX_COUNTS_EDGE_COSTS) {
repart_edge_metis(1, 0, 0, nodeID, nr_nodes, s, tasks, nr_tasks);
repart_edge_metis(1, 1, 0, nodeID, nr_nodes, s, tasks, nr_tasks);
} else if (reparttype->type == REPART_METIS_VERTEX_COSTS_EDGE_TIMEBINS) {
repart_edge_metis(0, 1, 1, nodeID, nr_nodes, s, tasks, nr_tasks);
} else if (reparttype->type == REPART_METIS_VERTEX_COUNTS_EDGE_TIMEBINS) {
repart_edge_metis(1, 1, 1, nodeID, nr_nodes, s, tasks, nr_tasks);
} else if (reparttype->type == REPART_METIS_EDGE_TIMEBINS) {
repart_edge_metis(0, 0, 1, nodeID, nr_nodes, s, tasks, nr_tasks);
} else if (reparttype->type == REPART_METIS_VERTEX_COUNTS) {
repart_vertex_metis(s, nodeID, nr_nodes);
......@@ -1013,10 +1021,10 @@ void partition_init(struct partition *partition,
/* Defaults make use of METIS if available */
#ifdef HAVE_METIS
const char *default_repart = "task_costs";
const char *default_repart = "costs/costs";
const char *default_part = "simple_metis";
#else
const char *default_repart = "none";
const char *default_repart = "none/none";
const char *default_part = "grid";
#endif
......@@ -1073,35 +1081,41 @@ void partition_init(struct partition *partition,
parser_get_opt_param_string(params, "DomainDecomposition:repartition_type",
part_type, default_repart);
switch (part_type[0]) {
case 'n':
if (strcmp("none/none", part_type) == 0) {
repartition->type = REPART_NONE;
break;
#ifdef HAVE_METIS
case 't':
} else if (strcmp("costs/costs", part_type) == 0) {
repartition->type = REPART_METIS_VERTEX_COSTS_EDGE_COSTS;
break;
case 'e':
repartition->type = REPART_METIS_EDGE_COSTS;
break;
case 'p':
} else if (strcmp("counts/none", part_type) == 0) {
repartition->type = REPART_METIS_VERTEX_COUNTS;
break;
case 'h':
} else if (strcmp("none/costs", part_type) == 0) {
repartition->type = REPART_METIS_EDGE_COSTS;
} else if (strcmp("counts/costs", part_type) == 0) {
repartition->type = REPART_METIS_VERTEX_COUNTS_EDGE_COSTS;
break;
case 'b':
} else if (strcmp("costs/time", part_type) == 0) {
repartition->type = REPART_METIS_VERTEX_COSTS_EDGE_TIMEBINS;
break;
default:
} else if (strcmp("counts/time", part_type) == 0) {
repartition->type = REPART_METIS_VERTEX_COUNTS_EDGE_TIMEBINS;
} else if (strcmp("none/time", part_type) == 0) {
repartition->type = REPART_METIS_EDGE_TIMEBINS;
} else {
message("Invalid choice of re-partition type '%s'.", part_type);
error(
"Permitted values are: 'none', 'task_costs', 'particle_weights',"
"'edge_task_costs', 'hybrid_weights' or 'bin_weights'");
"Permitted values are: 'none/none', 'costs/costs',"
"'counts/none', 'none/costs', 'counts/costs', "
"'costs/time', 'counts/time' or 'none/time'");
#else
default:
} else {
message("Invalid choice of re-partition type '%s'.", part_type);
error("Permitted values are: 'none' when compiled without METIS.");
error("Permitted values are: 'none/none' when compiled without METIS.");
#endif
}
......
......@@ -48,6 +48,8 @@ enum repartition_type {
REPART_METIS_EDGE_COSTS,
REPART_METIS_VERTEX_COUNTS_EDGE_COSTS,
REPART_METIS_VERTEX_COSTS_EDGE_TIMEBINS,
REPART_METIS_VERTEX_COUNTS_EDGE_TIMEBINS,
REPART_METIS_EDGE_TIMEBINS
};
/* Repartition preferences. */
......
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