|
7 | 7 | namespace hipo { |
8 | 8 |
|
9 | 9 | FormatHandler::FormatHandler(const Symbolic& S, Int sn, const Regul& regul, |
10 | | - std::vector<double>& frontal) |
| 10 | + std::vector<double>& frontal, |
| 11 | + std::vector<double>& clique, |
| 12 | + std::vector<Int>& swaps, |
| 13 | + std::vector<double>& pivot_2x2) |
11 | 14 | : S_{&S}, |
12 | 15 | regul_{regul}, |
13 | 16 | sn_{sn}, |
14 | 17 | nb_{S_->blockSize()}, |
15 | 18 | sn_size_{S_->snStart(sn_ + 1) - S_->snStart(sn_)}, |
16 | 19 | ldf_{S_->ptr(sn_ + 1) - S_->ptr(sn_)}, |
17 | 20 | ldc_{ldf_ - sn_size_}, |
18 | | - frontal_{frontal} { |
19 | | - local_reg_.resize(sn_size_); |
20 | | - swaps_.resize(sn_size_); |
21 | | - pivot_2x2_.resize(sn_size_); |
| 21 | + frontal_{frontal}, |
| 22 | + clique_{clique}, |
| 23 | + swaps_{swaps}, |
| 24 | + pivot_2x2_{pivot_2x2} { |
| 25 | + local_reg_.assign(sn_size_, 0.0); |
| 26 | + swaps_.assign(sn_size_, 0); |
| 27 | + pivot_2x2_.assign(sn_size_, 0.0); |
22 | 28 | } |
23 | 29 |
|
24 | | -void FormatHandler::terminate(std::vector<double>& clique, |
25 | | - std::vector<double>& total_reg, |
26 | | - std::vector<Int>& swaps, |
27 | | - std::vector<double>& pivot_2x2) { |
28 | | - // Move local copies of data into their final position. |
29 | | - // In this way, the shared objects sn_columns_ and schur_contribution_ are |
30 | | - // accessed only here, while a local copy is used for the assembly and dense |
31 | | - // factorisation. This should avoid the problem of false sharing. |
32 | | - |
33 | | - clique = std::move(clique_); |
34 | | - swaps = std::move(swaps_); |
35 | | - pivot_2x2 = std::move(pivot_2x2_); |
36 | | - |
| 30 | +void FormatHandler::terminate(std::vector<double>& total_reg) { |
37 | 31 | // Move local regularisation into total regularisation. |
38 | 32 | for (Int i = 0; i < sn_size_; ++i) |
39 | 33 | total_reg[S_->snStart(sn_) + i] = local_reg_[i]; |
|
0 commit comments