Skip to content

Commit fd2b653

Browse files
committed
apply clang-format
1 parent 9241d1d commit fd2b653

File tree

22 files changed

+244
-281
lines changed

22 files changed

+244
-281
lines changed

apps/test_suite_runner/StringToScheduler/run_bsp_scheduler.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ ReturnStatus RunBspScheduler(const ConfigParser &parser,
182182
BspSchedule<GraphT> &schedule) {
183183
using VertexTypeTOrDefault = std::conditional_t<isComputationalDagTypedVerticesV<GraphT>, VTypeT<GraphT>, unsigned>;
184184
using EdgeCommwTOrDefault = std::conditional_t<hasEdgeWeightsV<GraphT>, ECommwT<GraphT>, VCommwT<GraphT>>;
185-
using BoostGraphT
186-
= BoostGraph<VWorkwT<GraphT>, VCommwT<GraphT>, VMemwT<GraphT>, VertexTypeTOrDefault, EdgeCommwTOrDefault>;
185+
using BoostGraphT = BoostGraph<VWorkwT<GraphT>, VCommwT<GraphT>, VMemwT<GraphT>, VertexTypeTOrDefault, EdgeCommwTOrDefault>;
187186

188187
const std::string id = algorithm.get_child("id").get_value<std::string>();
189188

include/osp/auxiliary/math/divisors.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ std::vector<IntegralType> DivisorsList(IntegralType num) {
6262
}
6363
}
6464
const std::size_t beginIndx = divs.back() * divs.back() == num ? divs.size() - 2U : divs.size() - 1U;
65-
for (std::size_t indx = beginIndx;
66-
indx != std::numeric_limits<std::size_t>::max();
67-
--indx) {
65+
for (std::size_t indx = beginIndx; indx != std::numeric_limits<std::size_t>::max(); --indx) {
6866
divs.emplace_back(num / divs[indx]);
6967
}
7068

include/osp/auxiliary/misc.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ struct Pair {
5151

5252
explicit Pair(const T1 a = T1(), const T2 b = T2()) : a_(a), b_(b) {}
5353

54-
bool operator<(const Pair<T1, T2> &other) const {
55-
return (a_ < other.a_ || (a_ == other.a_ && b_ < other.b_));
56-
}
54+
bool operator<(const Pair<T1, T2> &other) const { return (a_ < other.a_ || (a_ == other.a_ && b_ < other.b_)); }
5755

5856
std::ostream &operator<<(std::ostream &os) const {
5957
return os << ("(" + std::to_string(a_) + ", " + std::to_string(b_) + ")");

include/osp/bsp/scheduler/GreedySchedulers/BspToMaxBspConverter.hpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ MaxBspScheduleCS<GraphT> GreedyBspToMaxBspConverter<GraphT>::Convert(const BspSc
6161
std::vector<double> priorities;
6262
std::vector<std::vector<std::deque<VertexIdx>>> procList = CreateSuperstepLists(schedule, priorities);
6363
std::vector<std::vector<CostType>> workRemainingProcSuperstep(schedule.GetInstance().NumberOfProcessors(),
64-
std::vector<CostType>(schedule.NumberOfSupersteps(), 0));
64+
std::vector<CostType>(schedule.NumberOfSupersteps(), 0));
6565
std::vector<VertexIdx> nodesRemainingSuperstep(schedule.NumberOfSupersteps(), 0);
6666

6767
MaxBspScheduleCS<GraphT> scheduleMax(schedule.GetInstance());
@@ -73,9 +73,9 @@ MaxBspScheduleCS<GraphT> GreedyBspToMaxBspConverter<GraphT>::Convert(const BspSc
7373
}
7474

7575
std::vector<std::vector<CostType>> sendCommRemainingProcSuperstep(schedule.GetInstance().NumberOfProcessors(),
76-
std::vector<CostType>(schedule.NumberOfSupersteps(), 0));
77-
std::vector<std::vector<CostType>> recCommRemainingProcSuperstep(schedule.GetInstance().NumberOfProcessors(),
7876
std::vector<CostType>(schedule.NumberOfSupersteps(), 0));
77+
std::vector<std::vector<CostType>> recCommRemainingProcSuperstep(schedule.GetInstance().NumberOfProcessors(),
78+
std::vector<CostType>(schedule.NumberOfSupersteps(), 0));
7979

8080
std::vector<std::set<std::pair<KeyTriple, unsigned>>> freeCommStepsForSuperstep(schedule.NumberOfSupersteps());
8181
std::vector<std::vector<std::pair<KeyTriple, unsigned>>> dependentCommStepsForNode(schedule.GetInstance().NumberOfVertices());
@@ -84,7 +84,7 @@ MaxBspScheduleCS<GraphT> GreedyBspToMaxBspConverter<GraphT>::Convert(const BspSc
8484
dependentCommStepsForNode[std::get<0>(key)].emplace_back(key, val);
8585

8686
CostType commCost = dag.VertexCommWeight(std::get<0>(key))
87-
* schedule.GetInstance().GetArchitecture().SendCosts(std::get<1>(key), std::get<2>(key));
87+
* schedule.GetInstance().GetArchitecture().SendCosts(std::get<1>(key), std::get<2>(key));
8888
sendCommRemainingProcSuperstep[std::get<1>(key)][val] += commCost;
8989
recCommRemainingProcSuperstep[std::get<2>(key)][val] += commCost;
9090
} else {
@@ -156,8 +156,8 @@ MaxBspScheduleCS<GraphT> GreedyBspToMaxBspConverter<GraphT>::Convert(const BspSc
156156
for (const std::pair<KeyTriple, unsigned> &entry : dependentCommStepsForNode[node]) {
157157
newlyFreedCommSteps.push_back(entry);
158158
CostType commCost = dag.VertexCommWeight(node)
159-
* schedule.GetInstance().GetArchitecture().SendCosts(std::get<1>(entry.first),
160-
std::get<2>(entry.first));
159+
* schedule.GetInstance().GetArchitecture().SendCosts(std::get<1>(entry.first),
160+
std::get<2>(entry.first));
161161
sendSumOfNewlyFreeOnProc[std::get<1>(entry.first)] += commCost;
162162
recSumOfNewlyFreeOnProc[std::get<2>(entry.first)] += commCost;
163163
}
@@ -194,10 +194,10 @@ MaxBspScheduleCS<GraphT> GreedyBspToMaxBspConverter<GraphT>::Convert(const BspSc
194194
maxWorkRemaining = std::max(maxWorkRemaining, workRemainingProcSuperstep[proc][step]);
195195
maxCommRemaining = std::max(maxCommRemaining, sendCommRemainingProcSuperstep[proc][step]);
196196
maxCommRemaining = std::max(maxCommRemaining, recCommRemainingProcSuperstep[proc][step]);
197-
commAfterReduction = std::max(
198-
commAfterReduction, sendCommRemainingProcSuperstep[proc][step] - sendSumOfNewlyFreeOnProc[proc]);
199-
commAfterReduction = std::max(
200-
commAfterReduction, recCommRemainingProcSuperstep[proc][step] - recSumOfNewlyFreeOnProc[proc]);
197+
commAfterReduction
198+
= std::max(commAfterReduction, sendCommRemainingProcSuperstep[proc][step] - sendSumOfNewlyFreeOnProc[proc]);
199+
commAfterReduction
200+
= std::max(commAfterReduction, recCommRemainingProcSuperstep[proc][step] - recSumOfNewlyFreeOnProc[proc]);
201201
}
202202
CostType commReduction
203203
= (maxCommRemaining - commAfterReduction) * schedule.GetInstance().GetArchitecture().CommunicationCosts();
@@ -219,8 +219,8 @@ MaxBspScheduleCS<GraphT> GreedyBspToMaxBspConverter<GraphT>::Convert(const BspSc
219219
freeCommStepsForSuperstep[step].insert(entry);
220220

221221
CostType commCost = dag.VertexCommWeight(std::get<0>(entry.first))
222-
* schedule.GetInstance().GetArchitecture().SendCosts(std::get<1>(entry.first),
223-
std::get<2>(entry.first));
222+
* schedule.GetInstance().GetArchitecture().SendCosts(std::get<1>(entry.first),
223+
std::get<2>(entry.first));
224224
sendCommRemainingProcSuperstep[std::get<1>(entry.first)][step] -= commCost;
225225
recCommRemainingProcSuperstep[std::get<2>(entry.first)][step] -= commCost;
226226
}
@@ -290,7 +290,7 @@ MaxBspScheduleCS<GraphT> GreedyBspToMaxBspConverter<GraphT>::Convert(const BspSc
290290

291291
CostType workLimit = maxCommAfter;
292292
if (maxCommTogether + maxWorkDone <= maxCommAfter + std::max(maxWorkDone, maxCommCurrent)
293-
+ schedule.GetInstance().GetArchitecture().SynchronisationCosts()) {
293+
+ schedule.GetInstance().GetArchitecture().SynchronisationCosts()) {
294294
workLimit = maxCommTogether;
295295
for (const std::pair<KeyTriple, unsigned> &entry : commInCurrentStep) {
296296
if (currentStep - 1 >= scheduleMax.NumberOfSupersteps()) {
@@ -323,8 +323,7 @@ MaxBspScheduleCS<GraphT> GreedyBspToMaxBspConverter<GraphT>::Convert(const BspSc
323323
}
324324

325325
if (schedule.AssignedProcessor(node) == schedule.AssignedProcessor(parent)
326-
&& schedule.AssignedSuperstep(parent) == step + 1
327-
&& broughtForward.find(parent) == broughtForward.end()) {
326+
&& schedule.AssignedSuperstep(parent) == step + 1 && broughtForward.find(parent) == broughtForward.end()) {
328327
hasDependency = true;
329328
}
330329
}

include/osp/bsp/scheduler/GreedySchedulers/EtfScheduler.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ class EtfScheduler : public Scheduler<GraphT> {
202202
* @return A triple containing the best EST, the node index, and the processor index.
203203
*/
204204
TvPair GetBestESTforNodes(const BspInstance<GraphT> &instance,
205-
CSchedule<GraphT> &schedule,
206-
const std::vector<VertexIdxT<GraphT>> &nodeList,
207-
const std::vector<VWorkwT<GraphT>> &procAvailableFrom,
208-
std::vector<VWorkwT<GraphT>> &send,
209-
std::vector<VWorkwT<GraphT>> &rec,
210-
unsigned &bestProc) const {
205+
CSchedule<GraphT> &schedule,
206+
const std::vector<VertexIdxT<GraphT>> &nodeList,
207+
const std::vector<VWorkwT<GraphT>> &procAvailableFrom,
208+
std::vector<VWorkwT<GraphT>> &send,
209+
std::vector<VWorkwT<GraphT>> &rec,
210+
unsigned &bestProc) const {
211211
VWorkwT<GraphT> bestEST = std::numeric_limits<VWorkwT<GraphT>>::max();
212212
VertexIdxT<GraphT> bestNode = 0;
213213
std::vector<VWorkwT<GraphT>> bestSend, bestRec;

include/osp/bsp/scheduler/GreedySchedulers/GreedyRecomputer.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ ReturnStatus GreedyRecomputer<GraphT>::ComputeRecompSchedule(BspScheduleCS<Graph
127127

128128
// check how much comm cost we save by removing comm schedule entry
129129
CostType commInduced = g.VertexCommWeight(node)
130-
* initialSchedule.GetInstance().GetArchitecture().CommunicationCosts(fromProc, toProc);
130+
* initialSchedule.GetInstance().GetArchitecture().CommunicationCosts(fromProc, toProc);
131131

132132
CostType newMaxComm = 0;
133133
for (unsigned proc = 0; proc < p; ++proc) {
@@ -161,8 +161,8 @@ ReturnStatus GreedyRecomputer<GraphT>::ComputeRecompSchedule(BspScheduleCS<Graph
161161
for (unsigned compStep = firstComputable[node][toProc]; compStep <= *neededOnProc[node][toProc].begin();
162162
++compStep) {
163163
CostType increase = workCost[toProc][compStep] + g.VertexWorkWeight(node) > maxWork[compStep]
164-
? workCost[toProc][compStep] + g.VertexWorkWeight(node) - maxWork[compStep]
165-
: 0;
164+
? workCost[toProc][compStep] + g.VertexWorkWeight(node) - maxWork[compStep]
165+
: 0;
166166

167167
if (increase < smallestIncrease) {
168168
bestStep = compStep;

include/osp/bsp/scheduler/GreedySchedulers/GreedyVarianceSspScheduler.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,11 @@ class GreedyVarianceSspScheduler : public MaxBspScheduler<GraphT> {
608608
if (free > (p * maxPercentIdleProcessors_)
609609
&& ((!increaseParallelismInNewSuperstep_)
610610
|| GetNrParallelizableNodes(instance,
611-
stale,
612-
nrOldReadyNodesPerType,
613-
nrReadyStaleNodesPerType[(supstepIdx + 1) % stale],
614-
procReady[(supstepIdx + 1) % stale],
615-
nrProcsPerType)
611+
stale,
612+
nrOldReadyNodesPerType,
613+
nrReadyStaleNodesPerType[(supstepIdx + 1) % stale],
614+
procReady[(supstepIdx + 1) % stale],
615+
nrProcsPerType)
616616
>= std::min(std::min(p, static_cast<unsigned>(1.2 * (p - free))),
617617
p - free + static_cast<unsigned>(0.5 * free)))) {
618618
endSupStep = true;

include/osp/bsp/scheduler/GreedySchedulers/GrowLocalAutoCoresParallel.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,7 @@ class GrowLocalAutoCoresParallel : public Scheduler<GraphT> {
565565
if constexpr (hasVerticesInTopOrderV<GraphT>) {
566566
IncrementScheduleSupersteps(schedule, startNodes[thr], startNodes[thr + 1], supstepIncr[thr]);
567567
} else {
568-
IncrementScheduleSuperstepsTopOrder(
569-
schedule, topOrder, startNodes[thr], startNodes[thr + 1], supstepIncr[thr]);
568+
IncrementScheduleSuperstepsTopOrder(schedule, topOrder, startNodes[thr], startNodes[thr + 1], supstepIncr[thr]);
570569
}
571570
}
572571
}

include/osp/bsp/scheduler/LoadBalanceScheduler/LightEdgeVariancePartitioner.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ class LightEdgeVariancePartitioner : public VariancePartitioner<GraphT, Interpol
258258
}
259259
}
260260

261-
for (auto vertexPriorPairIter = procReadyPrior[proc].begin();
262-
vertexPriorPairIter != procReadyPrior[proc].end();
261+
for (auto vertexPriorPairIter = procReadyPrior[proc].begin(); vertexPriorPairIter != procReadyPrior[proc].end();
263262
vertexPriorPairIter++) {
264263
if (assignedANode) {
265264
break;
@@ -280,8 +279,7 @@ class LightEdgeVariancePartitioner : public VariancePartitioner<GraphT, Interpol
280279
assignedANode = true;
281280
}
282281
}
283-
for (auto vertexPriorPairIter = allReady.begin(); vertexPriorPairIter != allReady.cend();
284-
vertexPriorPairIter++) {
282+
for (auto vertexPriorPairIter = allReady.begin(); vertexPriorPairIter != allReady.cend(); vertexPriorPairIter++) {
285283
if (assignedANode) {
286284
break;
287285
}

0 commit comments

Comments
 (0)