]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Provide read access to the MPI partitioner, improve documentation
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sat, 5 Dec 2015 10:02:47 +0000 (11:02 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 14 Dec 2015 07:24:33 +0000 (08:24 +0100)
include/deal.II/lac/parallel_vector.h

index dbc39aa93b5a167dd2ebf59a84e499b5e31a24d9..74c9e58da76a6ab1bb8b45b4c5be0b93e8d73a5e 100644 (file)
@@ -144,12 +144,12 @@ namespace parallel
      *
      * This vector class is based on two different number types for indexing.
      * The so-called global index type encodes the overall size of the vector.
-     * Its type is types::global_dof_index. The largest possible
-     * value is <code>2^32-1</code> or approximately four billion in case 64
-     * bit integers are disabled at configuration of deal.II (default case) or
+     * Its type is types::global_dof_index. The largest possible value is
+     * <code>2^32-1</code> or approximately 4 billion in case 64 bit integers
+     * are disabled at configuration of deal.II (default case) or
      * <code>2^64-1</code> or approximately <code>10^19</code> if 64 bit
-     * integers are enabled (see the glossary entry on
-     * @ref GlobalDoFIndex for further information).
+     * integers are enabled (see the glossary entry on @ref GlobalDoFIndex for
+     * further information).
      *
      * The second relevant index type is the local index used within one MPI
      * rank. As opposed to the global index, the implementation assumes 32-bit
@@ -983,14 +983,24 @@ namespace parallel
        */
       const MPI_Comm &get_mpi_communicator () const;
 
+      /**
+       * Return the MPI partitioner that describes the parallel layout of the
+       * vector. This object can be used to initialize another vector with the
+       * respective reinit() call, for additional queries regarding the
+       * parallel communication, or the compatibility of partitioners.
+       */
+      std_cxx11::shared_ptr<const Utilities::MPI::Partitioner>
+      get_partitioner () const;
+
       /**
        * Checks whether the given partitioner is compatible with the
        * partitioner used for this vector. Two partitioners are compatible if
        * they have the same local size and the same ghost indices. They do not
-       * necessarily need to be the same data field. This is a local operation
-       * only, i.e., if only some processors decide that the partitioning is
-       * not compatible, only these processors will return @p false, whereas
-       * the other processors will return @p true.
+       * necessarily need to be the same data field of the shared
+       * pointer. This is a local operation only, i.e., if only some
+       * processors decide that the partitioning is not compatible, only these
+       * processors will return @p false, whereas the other processors will
+       * return @p true.
        */
       bool
       partitioners_are_compatible (const Utilities::MPI::Partitioner &part) const;
@@ -2387,6 +2397,16 @@ namespace parallel
       return partitioner->get_communicator();
     }
 
+
+
+    template <typename Number>
+    inline
+    std_cxx11::shared_ptr<const Utilities::MPI::Partitioner>
+    Vector<Number>::get_partitioner () const
+    {
+      return partitioner;
+    }
+
 #endif  // ifndef DOXYGEN
 
   } // end of namespace distributed

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.