-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathops_mpi.hpp
More file actions
38 lines (28 loc) · 1.26 KB
/
ops_mpi.hpp
File metadata and controls
38 lines (28 loc) · 1.26 KB
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
#pragma once
#include <cstdint>
#include <vector>
#include "task/include/task.hpp"
#include "volkov_a_radix_batcher/common/include/common.hpp"
namespace volkov_a_radix_batcher {
class VolkovARadixBatcherMPI : public BaseTask {
public:
static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() {
return ppc::task::TypeOfTask::kMPI;
}
explicit VolkovARadixBatcherMPI(const InType &in);
private:
bool ValidationImpl() override;
bool PreProcessingImpl() override;
bool RunImpl() override;
bool PostProcessingImpl() override;
static void RadixSortDouble(std::vector<double> &data);
static uint64_t DoubleToOrderedInt(double d);
static double OrderedIntToDouble(uint64_t k);
static void CalculateDistribution(int world_size, int total_elements, std::vector<int> &counts,
std::vector<int> &displs);
static void ParallelMergeSort(int rank, int world_size, const std::vector<int> &counts,
std::vector<double> &local_vec);
static void ExchangeAndMerge(int rank, int neighbor, const std::vector<int> &counts, std::vector<double> &local_vec,
std::vector<double> &buffer_recv, std::vector<double> &buffer_merge);
};
} // namespace volkov_a_radix_batcher