--- /dev/null
+Improved: The MPI_Comm used in MatrixFree is not configurable via
+AdditionalData anymore but set to the MPI_Comm of the Triangulation.
+<br>
+(Daniel Arndt, 2017/01/08)
/* ---------------------------------------------------------------------
*
- * Copyright (C) 2009 - 2016 by the deal.II authors
+ * Copyright (C) 2009 - 2017 by the deal.II authors
*
* This file is part of the deal.II library.
*
MatrixFree<dim,double>::AdditionalData::none;
additional_data.mapping_update_flags = (update_gradients | update_JxW_values |
update_quadrature_points);
- additional_data.mpi_communicator = MPI_COMM_WORLD;
system_mf_storage.reinit (dof_handler, constraints, QGauss<1>(fe.degree+1),
additional_data);
}
MatrixFree<dim,float>::AdditionalData::none;
additional_data.mapping_update_flags = (update_gradients | update_JxW_values |
update_quadrature_points);
- additional_data.mpi_communicator = MPI_COMM_WORLD;
additional_data.level_mg_handler = level;
mg_mf_storage[level].reinit(dof_handler, level_constraints,
/* ---------------------------------------------------------------------
*
- * Copyright (C) 2011 - 2016 by the deal.II authors
+ * Copyright (C) 2011 - 2017 by the deal.II authors
*
* This file is part of the deal.II library.
*
QGaussLobatto<1> quadrature (fe_degree+1);
typename MatrixFree<dim>::AdditionalData additional_data;
- additional_data.mpi_communicator = MPI_COMM_WORLD;
additional_data.tasks_parallel_scheme =
MatrixFree<dim>::AdditionalData::partition_partition;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2016 by the deal.II authors
+// Copyright (C) 2011 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
/**
* Constructor for AdditionalData.
*/
- AdditionalData (const MPI_Comm mpi_communicator = MPI_COMM_SELF,
+ AdditionalData (const TasksParallelScheme tasks_parallel_scheme = partition_partition,
+ const unsigned int tasks_block_size = 0,
+ const UpdateFlags mapping_update_flags = update_gradients | update_JxW_values,
+ const unsigned int level_mg_handler = numbers::invalid_unsigned_int,
+ const bool store_plain_indices = true,
+ const bool initialize_indices = true,
+ const bool initialize_mapping = true)
+ :
+ tasks_parallel_scheme (tasks_parallel_scheme),
+ tasks_block_size (tasks_block_size),
+ mapping_update_flags (mapping_update_flags),
+ level_mg_handler (level_mg_handler),
+ store_plain_indices (store_plain_indices),
+ initialize_indices (initialize_indices),
+ initialize_mapping (initialize_mapping)
+ {};
+
+ /**
+ * Constructor for AdditionalData.
+ *
+ * @deprecated @p mpi_communicator should not be specified here
+ * since it is not used in the MatrixFree class.
+ */
+ AdditionalData (const MPI_Comm mpi_communicator,
const TasksParallelScheme tasks_parallel_scheme = partition_partition,
const unsigned int tasks_block_size = 0,
const UpdateFlags mapping_update_flags = update_gradients | update_JxW_values,
store_plain_indices (store_plain_indices),
initialize_indices (initialize_indices),
initialize_mapping (initialize_mapping)
- {};
+ {} DEAL_II_DEPRECATED
/**
* Set the MPI communicator that the parallel layout of the operator
* should be based upon. Defaults to MPI_COMM_SELF, but should be set to a
* communicator similar to the one used for a distributed triangulation in
* order to inform this class over all cells that are present.
+ *
+ * @deprecated This variable is not used anymore. The @p mpi_communicator
+ * is automatically set to the one used by the triangulation.
*/
- MPI_Comm mpi_communicator;
+ MPI_Comm mpi_communicator DEAL_II_DEPRECATED;
/**
* Set the scheme for task parallelism. There are four options available.
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2016 by the deal.II authors
+// Copyright (C) 2011 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
-namespace internal
-{
- template <int dim>
- void assert_communicator_equality (const dealii::Triangulation<dim> &tria,
- const MPI_Comm &comm_mf)
- {
-#ifdef DEAL_II_WITH_MPI
- const parallel::distributed::Triangulation<dim> *dist_tria =
- dynamic_cast<const parallel::distributed::Triangulation<dim>*>(&tria);
- if (dist_tria != 0)
- {
- if (Utilities::MPI::job_supports_mpi())
- {
- int communicators_same = 0;
- const int ierr = MPI_Comm_compare (dist_tria->get_communicator(), comm_mf,
- &communicators_same);
- AssertThrowMPI (ierr);
- Assert (communicators_same == MPI_IDENT ||
- communicators_same == MPI_CONGRUENT,
- ExcMessage ("MPI communicator in parallel::distributed::Triangulation "
- "and matrix free class must be the same!"));
- }
- }
-#else
- (void)tria;
- (void)comm_mf;
-#endif
- }
-}
-
-
-
template <int dim, typename Number>
void MatrixFree<dim,Number>::
internal_reinit(const Mapping<dim> &mapping,
AssertDimension (dof_handler.size(), locally_owned_set.size());
// set variables that are independent of FE
- internal::assert_communicator_equality (dof_handler[0]->get_triangulation(),
- additional_data.mpi_communicator);
- size_info.communicator = additional_data.mpi_communicator;
if (Utilities::MPI::job_supports_mpi() == true)
{
+ const parallel::Triangulation<dim> *dist_tria =
+ dynamic_cast<const parallel::Triangulation<dim>*>
+ (&(dof_handler[0]->get_triangulation()));
+ size_info.communicator = dist_tria != 0 ?
+ dist_tria->get_communicator() :
+ MPI_COMM_SELF;
size_info.my_pid =
Utilities::MPI::this_mpi_process(size_info.communicator);
size_info.n_procs =
}
else
{
+ size_info.communicator = MPI_COMM_SELF;
size_info.my_pid = 0;
size_info.n_procs = 1;
}
AssertDimension (dof_handler.size(), locally_owned_set.size());
// set variables that are independent of FE
- internal::assert_communicator_equality (dof_handler[0]->get_triangulation(),
- additional_data.mpi_communicator);
- size_info.communicator = additional_data.mpi_communicator;
if (Utilities::MPI::job_supports_mpi() == true)
{
+ const parallel::Triangulation<dim> *dist_tria =
+ dynamic_cast<const parallel::Triangulation<dim>*>
+ (&(dof_handler[0]->get_triangulation()));
+ size_info.communicator = dist_tria != 0 ?
+ dist_tria->get_communicator() :
+ MPI_COMM_SELF;
size_info.my_pid =
Utilities::MPI::this_mpi_process(size_info.communicator);
size_info.n_procs =
}
else
{
+ size_info.communicator = MPI_COMM_SELF;
size_info.my_pid = 0;
size_info.n_procs = 1;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2016 by the deal.II authors
+// Copyright (C) 2005 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
typename MatrixFree<dim,number>::AdditionalData additional_data;
additional_data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::partition_color;
- if (const parallel::Triangulation<dim,spacedim> *parallel_tria =
- dynamic_cast<const parallel::Triangulation<dim,spacedim>*>(&dof.get_tria()))
- additional_data.mpi_communicator = parallel_tria->get_communicator();
additional_data.mapping_update_flags = (update_values | update_JxW_values);
MatrixFree<dim, number> matrix_free;
matrix_free.reinit (mapping, dof, constraints,
typename MatrixFree<dim,Number>::AdditionalData additional_data;
additional_data.tasks_parallel_scheme =
MatrixFree<dim,Number>::AdditionalData::partition_color;
- if (const parallel::Triangulation<dim,spacedim> *parallel_tria =
- dynamic_cast<const parallel::Triangulation<dim,spacedim>*>(&dof.get_tria()))
- additional_data.mpi_communicator = parallel_tria->get_communicator();
additional_data.mapping_update_flags = (update_values | update_JxW_values);
MatrixFree<dim, Number> matrix_free;
matrix_free.reinit (mapping, dof, constraints,
{
const QGauss<1> quad (fe_degree+1);
typename MatrixFree<dim,double>::AdditionalData data;
- data.mpi_communicator = mpi_communicator;
data.tasks_parallel_scheme =
MatrixFree<dim,double>::AdditionalData::partition_color;
data.mapping_update_flags = update_values | update_gradients | update_JxW_values;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2016 by the deal.II authors
+// Copyright (C) 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const QGauss<1> quad (fe_degree+1);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::none;
data.tasks_block_size = 7;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2016 by the deal.II authors
+// Copyright (C) 2016 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const QGauss<1> quad (fe_degree+1);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::none;
data.tasks_block_size = 7;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2016 by the deal.II authors
+// Copyright (C) 2016 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const QGauss<1> quad (fe_degree+2);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::none;
data.tasks_block_size = 7;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2016 by the deal.II authors
+// Copyright (C) 2016 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const QGauss<1> quad (fe_degree+2);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::none;
data.tasks_block_size = 7;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2016 by the deal.II authors
+// Copyright (C) 2016 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const QGauss<1> quad (fe_degree+2);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::none;
data.tasks_block_size = 7;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2015 by the deal.II authors
+// Copyright (C) 2013 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const QGauss<1> quad (fe_degree+1);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::none;
data.tasks_block_size = 7;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2015 by the deal.II authors
+// Copyright (C) 2013 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const QGauss<1> quad (fe_degree+1);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::none;
data.tasks_block_size = 7;
{
const QGauss<1> quad (fe_degree+1);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
if (parallel_option == 0)
{
data.tasks_parallel_scheme =
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2015 by the deal.II authors
+// Copyright (C) 2013 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const QGauss<1> quad (fe_degree+1);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::none;
data.tasks_block_size = 7;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2015 by the deal.II authors
+// Copyright (C) 2013 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const QGauss<1> quad (fe_degree+1);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::none;
data.tasks_block_size = 7;
{
const QGauss<1> quad (fe_degree+1);
typename MatrixFree<dim,number>::AdditionalData data;
- data.mpi_communicator = MPI_COMM_WORLD;
data.tasks_parallel_scheme =
MatrixFree<dim,number>::AdditionalData::none;
data.tasks_block_size = 7;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 - 2016 by the deal.II authors
+// Copyright (C) 2014 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
typename MatrixFree<dim,number>::AdditionalData addit_data;
addit_data.tasks_parallel_scheme = MatrixFree<dim,number>::AdditionalData::none;
addit_data.level_mg_handler = level;
- addit_data.mpi_communicator = MPI_COMM_WORLD;
// extract the constraints due to Dirichlet boundary conditions
ConstraintMatrix constraints;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2016 by the deal.II authors
+// Copyright (C) 2016 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
typename MatrixFree<dim,number>::AdditionalData fine_level_additional_data;
fine_level_additional_data.tasks_parallel_scheme = MatrixFree<dim,number>::AdditionalData::none;
- fine_level_additional_data.mpi_communicator = MPI_COMM_WORLD;
fine_level_data.reinit (mapping, dof, constraints, QGauss<1>(n_q_points_1d),
fine_level_additional_data);
{
typename MatrixFree<dim,number>::AdditionalData mg_additional_data;
mg_additional_data.tasks_parallel_scheme = MatrixFree<dim,number>::AdditionalData::none;
- mg_additional_data.mpi_communicator = MPI_COMM_WORLD;
mg_additional_data.level_mg_handler = level;
ConstraintMatrix level_constraints;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 - 2016 by the deal.II authors
+// Copyright (C) 2014 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
addit_data.tasks_parallel_scheme = MatrixFree<dim,number>::AdditionalData::none;
addit_data.tasks_block_size = 3;
addit_data.level_mg_handler = level;
- addit_data.mpi_communicator = MPI_COMM_WORLD;
ConstraintMatrix constraints;
if (level == numbers::invalid_unsigned_int)
{
// ---------------------------------------------------------------------
//
-// Copyright (C) 2016 by the deal.II authors
+// Copyright (C) 2016 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
typename MatrixFree<dim,number>::AdditionalData fine_level_additional_data;
fine_level_additional_data.tasks_parallel_scheme = MatrixFree<dim,number>::AdditionalData::none;
fine_level_additional_data.tasks_block_size = 3;
- fine_level_additional_data.mpi_communicator = MPI_COMM_WORLD;
fine_level_data.reinit (mapping, dof, constraints, QGauss<1>(n_q_points_1d),
fine_level_additional_data);
typename MatrixFree<dim,number>::AdditionalData mg_additional_data;
mg_additional_data.tasks_parallel_scheme = MatrixFree<dim,number>::AdditionalData::none;
mg_additional_data.tasks_block_size = 3;
- mg_additional_data.mpi_communicator = MPI_COMM_WORLD;
mg_additional_data.level_mg_handler = level;
ConstraintMatrix level_constraints;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 - 2016 by the deal.II authors
+// Copyright (C) 2014 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
addit_data.tasks_parallel_scheme = MatrixFree<dim,number>::AdditionalData::none;
addit_data.tasks_block_size = 3;
addit_data.level_mg_handler = level;
- addit_data.mpi_communicator = MPI_COMM_WORLD;
ConstraintMatrix constraints;
if (level == numbers::invalid_unsigned_int)
{
// ---------------------------------------------------------------------
//
-// Copyright (C) 2016 by the deal.II authors
+// Copyright (C) 2016 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
typename MatrixFree<dim,number>::AdditionalData fine_level_additional_data;
fine_level_additional_data.tasks_parallel_scheme = MatrixFree<dim,number>::AdditionalData::none;
fine_level_additional_data.tasks_block_size = 3;
- fine_level_additional_data.mpi_communicator = MPI_COMM_WORLD;
fine_level_data.reinit (mapping, dof, constraints, QGauss<1>(n_q_points_1d),
fine_level_additional_data);
typename MatrixFree<dim,number>::AdditionalData mg_additional_data;
mg_additional_data.tasks_parallel_scheme = MatrixFree<dim,number>::AdditionalData::none;
mg_additional_data.tasks_block_size = 3;
- mg_additional_data.mpi_communicator = MPI_COMM_WORLD;
mg_additional_data.level_mg_handler = level;
ConstraintMatrix level_constraints;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 - 2016 by the deal.II authors
+// Copyright (C) 2014 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
typename MatrixFree<dim,number>::AdditionalData addit_data;
addit_data.tasks_parallel_scheme = MatrixFree<dim,number>::AdditionalData::none;
addit_data.level_mg_handler = level;
- addit_data.mpi_communicator = MPI_COMM_WORLD;
// extract the constraints due to Dirichlet boundary conditions
ConstraintMatrix constraints;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2015 by the deal.II authors
+// Copyright (C) 2012 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
QGaussLobatto<1> quadrature (fe_degree+1);
typename MatrixFree<dim>::AdditionalData additional_data;
- additional_data.mpi_communicator = MPI_COMM_WORLD;
additional_data.tasks_parallel_scheme =
MatrixFree<dim>::AdditionalData::partition_partition;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2015 by the deal.II authors
+// Copyright (C) 2012 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
QGaussLobatto<1> quadrature (fe_degree+1);
typename MatrixFree<dim>::AdditionalData additional_data;
- additional_data.mpi_communicator = MPI_COMM_WORLD;
additional_data.tasks_parallel_scheme =
MatrixFree<dim>::AdditionalData::partition_partition;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2016 by the deal.II authors
+// Copyright (C) 2016 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
typename MatrixFree<dim,double>::AdditionalData additional_data;
additional_data.tasks_parallel_scheme = MatrixFree<dim,double>::AdditionalData::partition_color;
- additional_data.mpi_communicator = MPI_COMM_WORLD;
additional_data.mapping_update_flags = update_values | update_JxW_values | update_quadrature_points;
MatrixFree<dim,double> data;
data.reinit (dof_handler, constraints, quadrature_formula_1d, additional_data);