]> https://gitweb.dealii.org/ - dealii.git/commitdiff
cleanup public interface
authorDenis Davydov <davydden@gmail.com>
Wed, 29 Nov 2017 12:58:09 +0000 (13:58 +0100)
committerDenis Davydov <davydden@gmail.com>
Wed, 29 Nov 2017 12:58:09 +0000 (13:58 +0100)
include/deal.II/lac/scalapack.h
source/base/process_grid.cc
source/lac/scalapack.cc

index 9d93b05d8002cc9c3a8d2404a7b3f466ba9b42e6..2a1002e944d8ea81ac53689feb1eb961446b33a0 100644 (file)
@@ -230,32 +230,32 @@ public:
   /**
    * Number of local rows on this MPI processes.
    */
-  int local_m() const;
+  unsigned int local_m() const;
 
   /**
    * Number of local columns on this MPI process.
    */
-  int local_n() const;
+  unsigned int local_n() const;
 
   /**
    * Return the global row number for the given local row @p loc_row .
    */
-  int global_row(const int loc_row) const;
+  unsigned int global_row(const unsigned int loc_row) const;
 
   /**
    * Return the global column number for the given local column @p loc_column.
    */
-  int global_column(const int loc_column) const;
+  unsigned int global_column(const unsigned int loc_column) const;
 
   /**
    * Read access to local element.
    */
-  NumberType local_el(const int loc_row, const int loc_column) const;
+  NumberType local_el(const unsigned int loc_row, const unsigned int loc_column) const;
 
   /**
    * Write access to local element.
    */
-  NumberType &local_el(const int loc_row, const int loc_column);
+  NumberType &local_el(const unsigned int loc_row, const unsigned int loc_column);
 
 private:
 
@@ -371,7 +371,7 @@ private:
 template <typename NumberType>
 inline
 NumberType
-ScaLAPACKMatrix<NumberType>::local_el(const int loc_row, const int loc_column) const
+ScaLAPACKMatrix<NumberType>::local_el(const unsigned int loc_row, const unsigned int loc_column) const
 {
   return (*this)(loc_row,loc_column);
 }
@@ -381,11 +381,49 @@ ScaLAPACKMatrix<NumberType>::local_el(const int loc_row, const int loc_column) c
 template <typename NumberType>
 inline
 NumberType &
-ScaLAPACKMatrix<NumberType>::local_el(const int loc_row, const int loc_column)
+ScaLAPACKMatrix<NumberType>::local_el(const unsigned int loc_row, const unsigned int loc_column)
 {
   return (*this)(loc_row,loc_column);
 }
 
+
+template <typename NumberType>
+inline
+unsigned int
+ScaLAPACKMatrix<NumberType>::m() const
+{
+  return n_rows;
+}
+
+
+
+template <typename NumberType>
+inline
+unsigned int
+ScaLAPACKMatrix<NumberType>::n() const
+{
+  return n_columns;
+}
+
+
+
+template <typename NumberType>
+unsigned int
+ScaLAPACKMatrix<NumberType>::local_m() const
+{
+  return n_local_rows;
+}
+
+
+
+template <typename NumberType>
+unsigned int
+ScaLAPACKMatrix<NumberType>::local_n() const
+{
+  return n_local_columns;
+}
+
+
 #endif // DOXYGEN
 
 DEAL_II_NAMESPACE_CLOSE
index 5b391b8786067dc9251be7baa8c0a740fda97cf7..4727265fd041fa172f0f91ad2a952d725f7df3ec 100644 (file)
@@ -122,8 +122,8 @@ namespace Utilities
       // Initialize Cblas context from the provided communicator
       blacs_context = Csys2blacs_handle(mpi_communicator);
       const char *order = ( column_major ? "Col" : "Row" );
-      // FIXME: blacs_context can be modified below. Thus Cblacs2sys_handle
-      // may not return the same MPI communicator
+      // Note that blacs_context can be modified below. Thus Cblacs2sys_handle
+      // may not return the same MPI communicator.
       Cblacs_gridinit(&blacs_context, order, n_process_rows, n_process_columns);
 
       // Blacs may modify the grid size on processes which are not used
@@ -134,14 +134,14 @@ namespace Utilities
 
       // If this MPI core is not on the grid, flag it as inactive and
       // skip all jobs
-      // FIXME: different condition is used here
+      // Note that a different condition is used in FORTRAN code here
       // https://stackoverflow.com/questions/18516915/calling-blacs-with-more-processes-than-used
       if (this_process_row < 0 || this_process_column < 0)
         mpi_process_is_active = false;
       else
         mpi_process_is_active = true;
 
-      // Create an auxiliary communicator which has root and all inactive cores
+      // Create an auxiliary communicator which has root and all inactive cores.
       // Assume that inactive cores start with id=n_process_rows*n_process_columns
       Assert (mpi_process_is_active || this_mpi_process >= n_process_rows*n_process_columns,
               ExcInternalError());
@@ -166,7 +166,7 @@ namespace Utilities
       AssertThrowMPI(ierr);
 
       // Create the communicator based on the group
-      // Note that, on most cores the communicator will be MPI_COMM_NULL
+      // Note that on most cores the communicator will be MPI_COMM_NULL.
       // FIXME: switch to MPI_Comm_create_group for MPI-3 so that only processes within the to-be subgroup call this
       ierr = MPI_Comm_create(mpi_communicator, inactive_with_root_group,
                              &mpi_communicator_inactive_with_root);
index 4d55ec7188c2c5fd7c25ddc091f08e6b26ad0088..4c306173945cf35f3f9ec8b2b071a30bd3f90ea7 100644 (file)
@@ -142,43 +142,7 @@ ScaLAPACKMatrix<NumberType>::operator = (const FullMatrix<NumberType> &matrix)
 
 template <typename NumberType>
 unsigned int
-ScaLAPACKMatrix<NumberType>::m() const
-{
-  return n_rows;
-}
-
-
-
-template <typename NumberType>
-unsigned int
-ScaLAPACKMatrix<NumberType>::n() const
-{
-  return n_columns;
-}
-
-
-
-template <typename NumberType>
-int
-ScaLAPACKMatrix<NumberType>::local_m() const
-{
-  return n_local_rows;
-}
-
-
-
-template <typename NumberType>
-int
-ScaLAPACKMatrix<NumberType>::local_n() const
-{
-  return n_local_columns;
-}
-
-
-
-template <typename NumberType>
-int
-ScaLAPACKMatrix<NumberType>::global_row(const int loc_row) const
+ScaLAPACKMatrix<NumberType>::global_row(const unsigned int loc_row) const
 {
   Assert (loc_row >= 0 && loc_row < n_local_rows,
           ExcIndexRange(loc_row,0,n_local_rows));
@@ -189,8 +153,8 @@ ScaLAPACKMatrix<NumberType>::global_row(const int loc_row) const
 
 
 template <typename NumberType>
-int
-ScaLAPACKMatrix<NumberType>::global_column(const int loc_column) const
+unsigned int
+ScaLAPACKMatrix<NumberType>::global_column(const unsigned int loc_column) const
 {
   Assert (loc_column >= 0 && loc_column < n_local_columns,
           ExcIndexRange(loc_column,0,n_local_columns));

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.