/**
* 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:
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);
}
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
// 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
// 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());
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);
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));
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));