-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZoltanPartitioner.hpp
59 lines (50 loc) · 1.52 KB
/
ZoltanPartitioner.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*!
* @file ZoltanPartitioner.hpp
* @author Athena Elafrou <[email protected]>
* @date 23 Aug 2024
*/
#pragma once
#include <memory>
#include <zoltan_cpp.h>
#include "Grid.hpp"
#include "Partitioner.hpp"
/*!
* @class ZoltanPartitioner
* @brief A class that encapsulates a 2D grid partitioner using the Zoltan
* toolkit.
*
* A class that encapsulates a 2D grid partitioner using the Zoltan toolkit. We
* use the Recursive Coordinate Bisection (RCB) geometric partitioning
* algorithm.
*/
class ZoltanPartitioner final : public Partitioner {
public:
// Disallow compiler-generated special functions
ZoltanPartitioner(const ZoltanPartitioner&) = delete;
ZoltanPartitioner& operator=(const ZoltanPartitioner&) = delete;
/*!
* @brief Destructor.
*/
~ZoltanPartitioner() { }
/*!
* @brief Create a Zoltan partitioner.
*
* @param comm MPI communicator.
* @param argc The number of arguments.
* @param argv The argument vector.
* @return A ZoltanPartitioner object.
*/
static ZoltanPartitioner* create(MPI_Comm comm, int argc, char** argv);
/*!
* @brief Partitions a 2D grid into rectangular boxes, one per process.
*
* Partitions a 2D grid into rectangular boxes, one per process, taking into
* account a land mask, if provided.
*/
void partition(Grid& grid) override;
protected:
// Constructor
ZoltanPartitioner(MPI_Comm comm, int argc, char** argv);
private:
std::unique_ptr<Zoltan> _zoltan = nullptr; // Zoltan object
};