Skip to content

Commit 4698e0c

Browse files
committed
Add comments
1 parent d989a81 commit 4698e0c

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

cajita/src/Cajita_DynamicPartitioner.hpp

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,24 @@
2828
namespace Cajita
2929
{
3030

31+
//---------------------------------------------------------------------------//
32+
/*!
33+
Workload measurer for DynamicPartitioner. It can be customized by the user
34+
to compute workload on each rank.
35+
36+
\tparam Device Kokkos device type.
37+
*/
3138
template <typename Device>
3239
class DynamicPartitionerWorkloadMeasurer
3340
{
3441
using memory_space = typename Device::memory_space;
3542

3643
public:
37-
virtual void compute( Kokkos::View<int***, memory_space>& ) = 0;
44+
/*!
45+
\brief this function need to be overwrited to compute workload
46+
\param workload workload computed on each rank
47+
*/
48+
virtual void compute( Kokkos::View<int***, memory_space>& workload ) = 0;
3849
};
3950

4051
//---------------------------------------------------------------------------//
@@ -769,18 +780,22 @@ class DynamicPartitioner : public BlockPartitioner<NumSpaceDim>
769780
int _max_optimize_iteration;
770781

771782
protected:
772-
// represent the rectangle partition in each dimension
773-
// with form [0, p_1, ..., p_n, cell_num], n = rank num in current
774-
// dimension, partition in this dimension would be [0, p_1), [p_1, p_2) ...
775-
// [p_n, total_tile_num] (unit: tile)
783+
//! represent the rectangle partition in each dimension
784+
//! with form [0, p_1, ..., p_n, cell_num], n = rank num in current
785+
//! dimension, partition in this dimension would be [0, p_1), [p_1, p_2) ...
786+
//! [p_n, total_tile_num] (unit: tile)
776787
partition_view _rectangle_partition_dev;
777-
// the workload of each tile on current
788+
//! the workload of each tile on current
778789
workload_view _workload_per_tile;
779-
// 3d prefix sum of the workload of each tile on current
790+
//! 3d prefix sum of the workload of each tile on current
780791
workload_view _workload_prefix_sum;
781-
// ranks per dimension
792+
//! ranks per dimension
782793
Kokkos::Array<int, num_space_dim> _ranks_per_dim;
783794

795+
/*!
796+
\brief allocate internal data structure for the partition algorithm
797+
\param global_cells_per_dim grid size along each dimension
798+
*/
784799
void allocate( const std::array<int, num_space_dim>& global_cells_per_dim )
785800
{
786801

0 commit comments

Comments
 (0)