Skip to content

Commit cfef876

Browse files
re-flowing long lines
1 parent 683855b commit cfef876

17 files changed

+88
-58
lines changed

include/graphblas/algorithms/hpcg/average_coarsener.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,11 @@ namespace grb {
341341
grb::utils::multigrid::ArrayVectorStorage< DIMS, CoordType > > system;
342342
grb::utils::multigrid::LinearizedNDimSystem< CoordType,
343343
grb::utils::multigrid::ArrayVectorStorage< DIMS, CoordType > > _finer_subspace;
344-
grb::utils::multigrid::ArrayVectorStorage< DIMS, CoordType > steps;///< array of steps, i.e. how much each column coordinate (finer system) must be
345-
//// incremented when incrementing the row coordinates; is is the ration between
346-
//// #finer_sizes and row_generator#physical_sizes
344+
///
345+
/// array of steps, i.e. how much each column coordinate (finer system) must be
346+
/// incremented when incrementing the row coordinates; it is the ratio between
347+
//// #finer_sizes and row_generator#physical_sizes
348+
grb::utils::multigrid::ArrayVectorStorage< DIMS, CoordType > steps;
347349
};
348350

349351
} // namespace algorithms

include/graphblas/algorithms/hpcg/greedy_coloring.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ namespace grb {
8282
bool reorder_rows_per_color = false
8383
) {
8484
CoordType nrows = system.system_size();
85-
row_colors.insert( row_colors.begin(), nrows, nrows ); // value `nrows' means `uninitialized'; initialized colors go from 0 to nrow-1
85+
// value `nrows' means `uninitialized'; initialized colors go from 0 to nrow-1
86+
row_colors.insert( row_colors.begin(), nrows, nrows );
8687
CoordType totalColors = 1;
8788
row_colors[ 0 ] = 0; // first point gets color 0
8889

include/graphblas/algorithms/hpcg/single_point_coarsener.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,11 @@ namespace grb {
312312
const grb::utils::multigrid::LinearizedNDimSystem< CoordType,
313313
grb::utils::multigrid::ArrayVectorStorage< DIMS, CoordType > > system;
314314

315-
ArrayType steps; ///< array of steps, i.e. how much each column coordinate (finer system) must be
316-
//// incremented when incrementing the row coordinates; is is the ration between
317-
//// #finer_sizes and row_generator#physical_sizes
315+
///
316+
/// array of steps, i.e. how much each column coordinate (finer system) must be
317+
/// incremented when incrementing the row coordinates; it is the ratio between
318+
/// #finer_sizes and row_generator#physical_sizes
319+
ArrayType steps;
318320
};
319321

320322
} // namespace algorithms

include/graphblas/algorithms/hpcg/system_building_utils.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ namespace grb {
365365
std::vector< size_t >::const_iterator begin = rows.cbegin();
366366
std::vector< size_t >::const_iterator end = rows.cend();
367367
// partition_iteration_range( rows.size(), begin, end );
368-
grb::RC rc = grb::buildVectorUnique( output_mask, begin, end, true_iter< size_t >( 0 ), true_iter< size_t >( rows.size() ), IOMode::SEQUENTIAL );
368+
grb::RC rc = grb::buildVectorUnique( output_mask, begin, end,
369+
true_iter< size_t >( 0 ), true_iter< size_t >( rows.size() ), IOMode::SEQUENTIAL );
369370
if( rc != SUCCESS ) {
370371
std::cerr << "error while creating output mask for color " << i << ": " << toString( rc ) << std::endl;
371372
return rc;
@@ -434,7 +435,8 @@ namespace grb {
434435
}
435436
logger << "- found " << color_counters.size() << " colors,"
436437
<< " generating color masks...";
437-
return internal::hpcg_build_static_color_masks( system_generator.system_size(), per_color_rows, smoothing_info.color_masks );
438+
return internal::hpcg_build_static_color_masks( system_generator.system_size(),
439+
per_color_rows, smoothing_info.color_masks );
438440
}
439441

440442
} // namespace algorithms

include/graphblas/algorithms/multigrid/multigrid_cg.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ namespace grb {
134134
static_assert( std::is_move_constructible< MultiGridRunnerType >::value,
135135
"cannot construct the Multi-Grid runner by move" );
136136

137-
Ring ring; ///< algebraic ring to be used
138-
Minus minus; ///< minus operator to be used
139-
bool with_preconditioning = true; ///< whether preconditioning is enabled
140-
size_t max_iterations = 10; ///< max number of allowed iterations for CG: after that, the solver is halted
141-
///< and the result achieved so far returned
142-
ResidualType tolerance = ring.template getZero< ResidualType >(); ///< ratio between initial residual and current residual that halts the solver
143-
///< if reached, for the solution is to be considered "good enough"
144-
137+
Ring ring; ///< algebraic ring to be used
138+
Minus minus; ///< minus operator to be used
139+
bool with_preconditioning = true; ///< whether preconditioning is enabled
140+
size_t max_iterations = 10; ///< max number of allowed iterations for CG:
141+
///< after that, the solver is halted and the result achieved so far returned
142+
ResidualType tolerance = ring.template getZero< ResidualType >(); ///< ratio
143+
///< between initial residual and current residual that halts the solver
144+
///< if reached, for the solution is to be considered "good enough"
145145
MultiGridRunnerType & mg_runner; ///< runner object for MG
146146
DbgOutputStreamType dbg_logger; ///< logger to trace execution
147147

include/graphblas/algorithms/multigrid/multigrid_data.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ namespace grb {
5555
typename TelControllerType
5656
> struct MultiGridData {
5757

58-
grb::utils::telemetry::Stopwatch< TelControllerType > mg_stopwatch; ///< stopwatch to measure the execution time in MG
59-
grb::utils::telemetry::Stopwatch< TelControllerType > sm_stopwatch; ///< stopwatch to measure the execution time in the smoother
60-
const size_t level; ///< level of the grid (0 for the finest physical system)
61-
const size_t system_size; ///< size of the system, i.e. side of the #A system matrix
58+
grb::utils::telemetry::Stopwatch< TelControllerType > mg_stopwatch; ///< stopwatch
59+
///< to measure the execution time in MG
60+
grb::utils::telemetry::Stopwatch< TelControllerType > sm_stopwatch; ///< stopwatch
61+
///< to measure the execution time in the smoother
62+
const size_t level; ///< level of the grid (0 for the finest physical system)
63+
const size_t system_size; ///< size of the system, i.e. side of the #A system matrix
6264
grb::Matrix< NonzeroType > A; ///< system matrix
63-
grb::Vector< IOType > z; ///< multi-grid solution
64-
grb::Vector< IOType > r; ///< residual
65+
grb::Vector< IOType > z; ///< multi-grid solution
66+
grb::Vector< IOType > r; ///< residual
6567

6668
/**
6769
* Construct a new multigrid data object from level information and system size.

include/graphblas/algorithms/multigrid/multigrid_v_cycle.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ namespace grb {
9191
DbgOutputStreamType dbg_logger; ///< logger to trace execution
9292

9393
std::vector< std::unique_ptr< MultiGridInputType > > system_levels; ///< levels of the grid (finest first)
94-
Ring ring; ///< algebraic ring
95-
Minus minus; ///< minus operator
94+
Ring ring; ///< algebraic ring
95+
Minus minus; ///< minus operator
9696

9797
// operator to extract the reference out of an std::unique_ptr object
9898
struct __extractor {

include/graphblas/algorithms/multigrid/red_black_gauss_seidel.hpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,17 @@ namespace grb {
8181
using Ring = typename SmootherTypes::Ring;
8282
using Minus = typename SmootherTypes::Minus;
8383
using Divide = typename SmootherTypes::Divide;
84-
using SmootherInputType = MultiGridData< IOType, NonzeroType, TelControllerType >; ///< external input structure
85-
using SmootherDataType = SmootherData< IOType >; ///< smoothing information and temporary variables (per MG level)
86-
87-
size_t presmoother_steps = 1UL; ///< number of pre-smoother steps
88-
size_t postsmoother_steps = 1UL; ///< number of post-smoother steps
89-
size_t non_recursive_smooth_steps = 1UL; ///< number of smoother steps for the last grid level
84+
using SmootherInputType = MultiGridData< IOType, NonzeroType, TelControllerType >; ///< external
85+
///< input structure
86+
using SmootherDataType = SmootherData< IOType >; ///< smoothing information
87+
///< and temporary variables (per MG level)
88+
89+
size_t presmoother_steps = 1UL; ///< number of pre-smoother steps
90+
size_t postsmoother_steps = 1UL; ///< number of post-smoother steps
91+
size_t non_recursive_smooth_steps = 1UL; ///< number of smoother steps for the last grid level
9092
std::vector< std::unique_ptr< SmootherDataType > > levels; ///< for each grid level,
91-
///< the smoothing data (finest first)
92-
Ring ring; ///< the algebraic ring
93+
///< the smoothing data (finest first)
94+
Ring ring; ///< the algebraic ring
9395
Minus minus;
9496
Divide divide;
9597

@@ -136,7 +138,8 @@ namespace grb {
136138
/**
137139
* Runs a single step of Red-Black Gauss-Seidel for a specific color.
138140
*
139-
* @param[in,out] data structure with external containers, corresponsign to an MG level: vector to smooth, system matrix, residual
141+
* @param[in,out] data structure with external containers, corresponsign to an MG level:
142+
* vector to smooth, system matrix, residual
140143
* @param[in,out] smoothing_info smoothing-specific information: temporary vectors, color masks
141144
* @return grb::RC::SUCCESS if the algorithm could correctly terminate, the error code of the first
142145
* unsuccessful operation otherwise
@@ -174,7 +177,8 @@ namespace grb {
174177

175178
ret = ret ? ret :
176179
grb::eWiseLambda(
177-
[ &z, &r, &smoother_temp, &color_mask, &A_diagonal , &ri, &mi, &di ]( const size_t i ) {
180+
[ &z, &r, &smoother_temp, &color_mask, &A_diagonal ,
181+
&ri, &mi, &di ]( const size_t i ) {
178182
IOType d = A_diagonal[ i ];
179183
IOType v;
180184
ri.getMultiplicativeOperator().apply( z[ i ], d, v );
@@ -203,7 +207,8 @@ namespace grb {
203207
* and no check is performed to ensure these assumptions hold. Hence, it is up to user logic
204208
* to pass correct coloring information. Otherwise, \b no guarantees hold on the result.
205209
*
206-
* @param[in,out] data structure with external containers, corresponsign to an MG level: vector to smooth, system matrix, residual
210+
* @param[in,out] data structure with external containers, corresponsign to an MG level:
211+
* vector to smooth, system matrix, residual
207212
* @param[in,out] smoothing_info smoothing-specific information: temporary vectors, color masks
208213
* @return grb::RC::SUCCESS if the algorithm could correctly terminate, the error code of the first
209214
* unsuccessful operation otherwise

include/graphblas/algorithms/multigrid/single_matrix_coarsener.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ namespace grb {
8383
using Minus = typename CoarsenerTypes::Minus;
8484

8585
using MultiGridInputType = MultiGridData< IOType, NonzeroType, TelControllerType >; ///< input data from MG
86-
using CoarseningDataType = CoarseningData< IOType, NonzeroType >; ///< internal data with coarsening information
86+
using CoarseningDataType = CoarseningData< IOType, NonzeroType >; ///< internal data
87+
///< with coarsening information
8788

8889
static_assert( std::is_default_constructible< Ring >::value,
8990
"cannot construct the Ring with default values" );

include/graphblas/utils/multigrid/dynamic_vector_storage.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ namespace grb {
3232
namespace multigrid {
3333

3434
/**
35-
* Array with fixed size (i.e. decided at object creation) allocated on the heap with an interface compliant
36-
* to what other classes in the geometry namespace expect, like storage() and dimensions() methods.
35+
* Array with fixed size (i.e. decided at object creation) allocated on the heap
36+
* with an interface compliant to what other classes in the geometry namespace expect,
37+
* like storage() and dimensions() methods.
3738
*
3839
* It describes a vector of dimensions #dimensions().
3940
*

0 commit comments

Comments
 (0)