-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPartitionDummy.h
55 lines (45 loc) · 1.39 KB
/
PartitionDummy.h
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
// SPDX-FileCopyrightText: 2019-2023 Technical University of Munich
//
// SPDX-License-Identifier: BSD-3-Clause
/**
* @file
* This file is part of PUML
*
* For conditions of distribution and use, please see the copyright
* notice in the file 'COPYING' at the root directory of this package
* and the copyright notice at https://github.com/TUM-I5/PUMGen
*
* @copyright 2019-2023 Technische Universitaet Muenchen
* @author David Schneller <[email protected]>
*/
#ifndef PUML_PARTITIONDUMMY_H
#define PUML_PARTITIONDUMMY_H
#include "PartitionTarget.h"
#ifdef USE_MPI
#include <mpi.h>
#endif // USE_MPI
#include "PartitionBase.h"
#include "PartitionGraph.h"
#include "Topology.h"
namespace PUML {
template <TopoType Topo>
class PartitionDummy : public PartitionBase<Topo> {
public:
using PartitionBase<Topo>::PartitionBase;
#ifdef USE_MPI
virtual auto partition(int* partition,
const PartitionGraph<Topo>& graph,
const PartitionTarget& target,
int seed = 1) -> PartitioningResult {
// all data stays where it is (i.e. where it was read)
int rank = 0;
MPI_Comm_rank(graph.comm(), &rank);
for (unsigned long i = 0; i < graph.localVertexCount(); ++i) {
partition[i] = rank;
}
return PartitioningResult::SUCCESS;
}
#endif // USE_MPI
};
} // namespace PUML
#endif // PUML_PARTITIONPARMETIS_H