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

Make the domain decomposition parameters optional

parent 0119a458
...@@ -46,11 +46,3 @@ SPH: ...@@ -46,11 +46,3 @@ SPH:
InitialConditions: InitialConditions:
file_name: ./cosmoVolume.hdf5 # The file to read file_name: ./cosmoVolume.hdf5 # The file to read
# Parameters govering domain decomposition
DomainDecomposition:
initial_type: m # The initial strategy ("g", "m", "w", or "v"). See documentation for details.
initial_grid_x: 10 # Grid size if the 'g' strategy is chosen.
initial_grid_y: 10
initial_grid_z: 10
repartition_type: b # The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
...@@ -44,15 +44,6 @@ InitialConditions: ...@@ -44,15 +44,6 @@ InitialConditions:
shift_y: 50. shift_y: 50.
shift_z: 50. shift_z: 50.
# Parameters govering domain decomposition
DomainDecomposition:
initial_type: m # The initial strategy ("g", "m", "w", or "v"). See documentation for details.
initial_grid_x: 10 # Grid size if the 'g' strategy is chosen.
initial_grid_y: 10
initial_grid_z: 10
repartition_type: b # The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
# External potential parameters # External potential parameters
PointMass: PointMass:
position_x: 50. # location of external point mass in internal units position_x: 50. # location of external point mass in internal units
......
...@@ -41,11 +41,3 @@ SPH: ...@@ -41,11 +41,3 @@ SPH:
InitialConditions: InitialConditions:
file_name: ./sedov.hdf5 # The file to read file_name: ./sedov.hdf5 # The file to read
# Parameters govering domain decomposition
DomainDecomposition:
initial_type: m # The initial strategy ("g", "m", "w", or "v"). See documentation for details.
initial_grid_x: 10 # Grid size if the 'g' strategy is chosen.
initial_grid_y: 10
initial_grid_z: 10
repartition_type: b # The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
...@@ -41,11 +41,3 @@ SPH: ...@@ -41,11 +41,3 @@ SPH:
InitialConditions: InitialConditions:
file_name: ./sodShock.hdf5 # The file to read file_name: ./sodShock.hdf5 # The file to read
# Parameters govering domain decomposition
DomainDecomposition:
initial_type: m # The initial strategy ("g", "m", "w", or "v"). See documentation for details.
initial_grid_x: 10 # Grid size if the 'g' strategy is chosen.
initial_grid_y: 10
initial_grid_z: 10
repartition_type: b # The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
...@@ -40,12 +40,3 @@ SPH: ...@@ -40,12 +40,3 @@ SPH:
# Parameters related to the initial conditions # Parameters related to the initial conditions
InitialConditions: InitialConditions:
file_name: ./uniformBox.hdf5 # The file to read file_name: ./uniformBox.hdf5 # The file to read
# Parameters govering domain decomposition
DomainDecomposition:
initial_type: m # The initial strategy ("g", "m", "w", or "v"). See documentation for details.
initial_grid_x: 10 # Grid size if the 'g' strategy is chosen.
initial_grid_y: 10
initial_grid_z: 10
repartition_type: b # The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
...@@ -54,11 +54,11 @@ InitialConditions: ...@@ -54,11 +54,11 @@ InitialConditions:
# Parameters govering domain decomposition # Parameters govering domain decomposition
DomainDecomposition: DomainDecomposition:
initial_type: m # The initial strategy ("g", "m", "w", or "v"). See documentation for details. initial_type: m # (Optional) The initial strategy ("g", "m", "w", or "v").
initial_grid_x: 10 # Grid size if the 'g' strategy is chosen. initial_grid_x: 10 # (Optional) Grid size if the "g" strategy is chosen.
initial_grid_y: 10 initial_grid_y: 10
initial_grid_z: 10 initial_grid_z: 10
repartition_type: b # The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details. repartition_type: b # (Optional) The re-decomposition strategy ("n", "b", "v", "e" or "x").
# Parameters related to external potentials # Parameters related to external potentials
......
...@@ -921,11 +921,11 @@ void partition_init(struct partition *partition, ...@@ -921,11 +921,11 @@ void partition_init(struct partition *partition,
/* Defaults make use of METIS if available */ /* Defaults make use of METIS if available */
#ifdef HAVE_METIS #ifdef HAVE_METIS
*reparttype = REPART_METIS_BOTH; char default_repart = 'b';;
partition->type = INITPART_METIS_NOWEIGHT; char default_part = 'm';
#else #else
*reparttype = REPART_NONE; char default_repart = 'n';
partition->type = INITPART_GRID; char default_part = 'g';
#endif #endif
/* Set a default grid so that grid[0]*grid[1]*grid[2] == nr_nodes. */ /* Set a default grid so that grid[0]*grid[1]*grid[2] == nr_nodes. */
...@@ -935,9 +935,10 @@ void partition_init(struct partition *partition, ...@@ -935,9 +935,10 @@ void partition_init(struct partition *partition,
factor(partition->grid[0] * partition->grid[1], &partition->grid[1], factor(partition->grid[0] * partition->grid[1], &partition->grid[1],
&partition->grid[0]); &partition->grid[0]);
/* Now let's check what the user wants as an initial domain*/ /* Now let's check what the user wants as an initial domain. */
const char part_type = const char part_type =
parser_get_param_char(params, "DomainDecomposition:initial_type"); parser_get_opt_param_char(params, "DomainDecomposition:initial_type",
default_part);
switch (part_type) { switch (part_type) {
case 'g': case 'g':
...@@ -966,16 +967,21 @@ void partition_init(struct partition *partition, ...@@ -966,16 +967,21 @@ void partition_init(struct partition *partition,
/* In case of grid, read more parameters */ /* In case of grid, read more parameters */
if (part_type == 'g') { if (part_type == 'g') {
partition->grid[0] = partition->grid[0] =
parser_get_param_int(params, "DomainDecomposition:initial_grid_x"); parser_get_opt_param_int(params, "DomainDecomposition:initial_grid_x",
partition->grid[0]);
partition->grid[1] = partition->grid[1] =
parser_get_param_int(params, "DomainDecomposition:initial_grid_y"); parser_get_opt_param_int(params, "DomainDecomposition:initial_grid_y",
partition->grid[1]);
partition->grid[2] = partition->grid[2] =
parser_get_param_int(params, "DomainDecomposition:initial_grid_z"); parser_get_opt_param_int(params, "DomainDecomposition:initial_grid_z",
partition->grid[2]);
} }
/* Now let's check what the user wants as a repartition strategy */ /* Now let's check what the user wants as a repartition strategy */
const char repart_type = const char repart_type =
parser_get_param_char(params, "DomainDecomposition:repartition_type"); parser_get_opt_param_char(params,
"DomainDecomposition:repartition_type",
default_repart);
switch (repart_type) { switch (repart_type) {
case 'n': case 'n':
......
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