]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Utilities::Trilinos::comm_self.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 7 Aug 2009 19:01:42 +0000 (19:01 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 7 Aug 2009 19:01:42 +0000 (19:01 +0000)
git-svn-id: https://svn.dealii.org/trunk@19207 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/utilities.h
deal.II/base/source/utilities.cc

index 195e4eb79d93fb75fb7445e0ef90f72fdfbccbef..211feb61d33aa64420e3b55697c5e41c5385c684 100644 (file)
@@ -366,6 +366,22 @@ namespace Utilities
                                      */
     const Epetra_Comm& comm_world();
 
+                                    /**
+                                     * Returns a Trilinos Epetra_Comm
+                                     * object needed for creation of
+                                     * Epetra_Maps.
+                                     *
+                                     * If deal.II has been configured to use
+                                     * a compiler that does not support MPI
+                                     * then the resulting communicator will
+                                     * be a serial one. Otherwise, the
+                                     * communicator will correspond to
+                                     * MPI_COMM_SELF, i.e. a communicator
+                                     * that comprises only this one
+                                     * processor.
+                                     */
+    const Epetra_Comm& comm_self();
+    
                                     /**
                                      * Given a communicator, duplicate it. If
                                      * the given communicator is serial, that
index 1c0b7108b10ad70c66931807df207df840b61990..c4e6a4d867e1ce899dda264eec17af653fd91c02 100644 (file)
@@ -609,6 +609,22 @@ namespace Utilities
 
 
 
+    const Epetra_Comm&
+    comm_self()
+    {
+#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
+      static Teuchos::RCP<Epetra_MpiComm>
+       communicator = Teuchos::rcp (new Epetra_MpiComm (MPI_COMM_SELF), true);
+#else
+      static Teuchos::RCP<Epetra_SerialComm>
+       communicator = Teuchos::rcp (new Epetra_SerialComm (), true);
+#endif
+    
+      return *communicator;
+    }
+
+
+
     Epetra_Comm *
     duplicate_communicator (const Epetra_Comm &communicator)
     {

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.