Skip to content

Commit e9a8862

Browse files
committed
Merge remote-tracking branch 'private/master' into gpl-filler-gcell-removal
2 parents 5181c86 + ccda6ca commit e9a8862

15 files changed

Lines changed: 84 additions & 68 deletions

Jenkinsfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,13 @@ def bazelTest = {
264264
if (env.BRANCH_NAME != 'master') {
265265
cmd += ' --remote_upload_local_results=false';
266266
}
267-
sh label: 'Bazel Build', script: cmd + ' --google_credentials=$GCS_SA_KEY ...';
267+
cmd += ' --google_credentials=$GCS_SA_KEY';
268+
try {
269+
sh label: 'Bazel Build', script: cmd + ' ...';
270+
} catch (e) {
271+
currentBuild.result = 'FAILURE';
272+
sh label: 'Bazel Build (keep_going)', script: cmd + ' --keep_going ...';
273+
}
268274
}
269275
}
270276
}

docs/user/Bazel-caching.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,28 @@ bazel build --config=openroad-dev //...
5151

5252
This configuration is **read-only** to prevent local, unverified builds from populating the shared cache.
5353

54+
### Using a `user.bazelrc` file instead of `--config=openroad-dev`
55+
56+
You may prefer `user.bazelrc` file instead of using the `--config=openroad-dev` option.
57+
58+
# user: username@openroad.tools
59+
build --remote_cache=https://storage.googleapis.com/openroad-bazel-cache
60+
build --credential_helper=*.googleapis.com=%workspace%/etc/cred_helper.py
61+
build --remote_cache_compression=true
62+
build --remote_upload_local_results=false
63+
64+
To test the setup:
65+
66+
$ etc/cred_helper.py test
67+
Running: gcloud auth print-access-token username@openroad.tools
68+
{
69+
"kind": "storage#testIamPermissionsResponse",
70+
"permissions": [
71+
"storage.buckets.get",
72+
"storage.objects.create"
73+
]
74+
}
75+
5476
---
5577

5678
### 3. CI Access (Jenkins Pipeline)

src/par/src/Coarsener.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,16 +653,16 @@ void Coarsener::OrderVertices(const HGraphPtr& hgraph,
653653
std::vector<int>& vertices) const
654654
{
655655
switch (vertex_order_choice_) {
656-
case CoarsenOrder::RANDOM:
656+
case CoarsenOrder::kRandom:
657657
shuffle(vertices.begin(),
658658
vertices.end(),
659659
std::default_random_engine(random_seed_));
660660
return;
661661

662-
case CoarsenOrder::DEFAULT:
662+
case CoarsenOrder::kDefault:
663663
return;
664664

665-
case CoarsenOrder::SIZE: {
665+
case CoarsenOrder::kSize: {
666666
// sort the vertices based on vertex weight
667667
// calculate the weight for all the vertices
668668
std::vector<float> average_sizes(hgraph->GetNumVertices(), 0.0);
@@ -677,7 +677,7 @@ void Coarsener::OrderVertices(const HGraphPtr& hgraph,
677677
}
678678
return;
679679

680-
case CoarsenOrder::DEGREE: {
680+
case CoarsenOrder::kDegree: {
681681
// sort the vertices based on degree of each vertex in non-decreasing
682682
// order i.e., number of neighboring vertices
683683
std::vector<int> degrees(hgraph->GetNumVertices(), 0);
@@ -944,16 +944,16 @@ HGraphPtr Coarsener::Contraction(
944944
std::string ToString(const CoarsenOrder order)
945945
{
946946
switch (order) {
947-
case CoarsenOrder::RANDOM:
947+
case CoarsenOrder::kRandom:
948948
return std::string("RANDOM");
949949

950-
case CoarsenOrder::DEGREE:
950+
case CoarsenOrder::kDegree:
951951
return std::string("DEGREE");
952952

953-
case CoarsenOrder::SIZE:
953+
case CoarsenOrder::kSize:
954954
return std::string("SIZE");
955955

956-
case CoarsenOrder::DEFAULT:
956+
case CoarsenOrder::kDefault:
957957
return std::string("DEFAULT");
958958

959959
default:

src/par/src/Coarsener.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ using CoarseningPtr = std::shared_ptr<Coarsener>;
3030
// the type for vertex ordering
3131
enum class CoarsenOrder
3232
{
33-
RANDOM,
34-
DEGREE,
35-
SIZE,
36-
DEFAULT
33+
kRandom,
34+
kDegree,
35+
kSize,
36+
kDefault
3737
};
3838

3939
// function : convert CoarsenOrder to string
@@ -183,7 +183,7 @@ class Coarsener
183183

184184
std::vector<float> thr_cluster_weight_; // the maximum weight of a cluster
185185
int random_seed_ = 0;
186-
CoarsenOrder vertex_order_choice_ = CoarsenOrder::RANDOM;
186+
CoarsenOrder vertex_order_choice_ = CoarsenOrder::kRandom;
187187
EvaluatorPtr evaluator_ = nullptr;
188188
utl::Logger* logger_ = nullptr;
189189
};

src/par/src/Evaluator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ void GoldenEvaluator::UpdateTiming(const HGraphPtr& hgraph,
719719
// the remaining vertices are all sinks
720720
// It will stop if the sink vertex is a FF or IO
721721
for (const int v : timing_graph_->Vertices(e)) {
722-
if (timing_graph_->GetVertexType(v) != COMB_STD_CELL) {
722+
if (timing_graph_->GetVertexType(v) != kCombStdCell) {
723723
continue; // the current vertex is port or seq_std_cell or macro
724724
}
725725
// find all the hyperedges connected to this hyperedge
@@ -749,7 +749,7 @@ void GoldenEvaluator::UpdateTiming(const HGraphPtr& hgraph,
749749
const int src_id = *range.begin();
750750
// Stop backward traversing if the current vertex is port or seq_std_cell or
751751
// macro
752-
if (timing_graph_->GetVertexType(src_id) != COMB_STD_CELL) {
752+
if (timing_graph_->GetVertexType(src_id) != kCombStdCell) {
753753
return; // the current vertex is port or seq_std_cell or macro
754754
}
755755
// find all the hyperedges driving this vertex

src/par/src/GreedyRefine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ float GreedyRefine::Pass(
5454
// find the best candidate block
5555
// the initialization of best_gain is 0.0
5656
// define a lambda function to compare two HyperedgeGainPtr (>=)
57-
auto CompareHyperedgeGain
57+
auto compare_hyperedge_gain
5858
= [&](const HyperedgeGainPtr& a, const HyperedgeGainPtr& b) {
5959
if (a->GetGain() > b->GetGain()) {
6060
return true;
@@ -81,7 +81,7 @@ float GreedyRefine::Pass(
8181
HyperedgeGainPtr gain_hyperedge = CalculateHyperedgeGain(
8282
hyperedge_id, to_pid, hgraph, solution, cur_paths_cost, net_degs);
8383
if (!best_gain_hyperedge
84-
|| CompareHyperedgeGain(gain_hyperedge, best_gain_hyperedge)) {
84+
|| compare_hyperedge_gain(gain_hyperedge, best_gain_hyperedge)) {
8585
best_gain_hyperedge = gain_hyperedge;
8686
}
8787
}

src/par/src/Multilevel.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ std::vector<int> MultilevelPartitioner::SingleCycleRefinement(
244244
upper_block_balance,
245245
lower_block_balance,
246246
top_solutions[best_solution_id],
247-
PartitionType::INIT_DIRECT_ILP);
247+
PartitionType::kInitDirectIlp);
248248
}
249249
// Here we need to do rebugetting on the best solution
250250
RefinePartition(hierarchy,
@@ -297,7 +297,7 @@ void MultilevelPartitioner::InitialPartition(
297297
upper_block_balance,
298298
lower_block_balance,
299299
solution,
300-
PartitionType::INIT_RANDOM);
300+
PartitionType::kInitRandom);
301301
// call FM refiner to improve the solution
302302
k_way_fm_refiner_->Refine(
303303
hgraph, upper_block_balance, lower_block_balance, solution);
@@ -325,7 +325,7 @@ void MultilevelPartitioner::InitialPartition(
325325
upper_block_balance,
326326
lower_block_balance,
327327
solution,
328-
PartitionType::INIT_RANDOM_VILE);
328+
PartitionType::kInitRandomVile);
329329
// call FM refiner to improve the solution
330330
k_way_fm_refiner_->Refine(
331331
hgraph, upper_block_balance, lower_block_balance, solution);
@@ -351,7 +351,7 @@ void MultilevelPartitioner::InitialPartition(
351351
upper_block_balance,
352352
lower_block_balance,
353353
vile_solution,
354-
PartitionType::INIT_VILE);
354+
PartitionType::kInitVile);
355355
// We need k_way_fm_refiner to generate a balanced partitioning
356356
k_way_fm_refiner_->Refine(
357357
hgraph, upper_block_balance, lower_block_balance, vile_solution);
@@ -386,7 +386,7 @@ void MultilevelPartitioner::InitialPartition(
386386
upper_block_balance,
387387
lower_block_balance,
388388
ilp_solution,
389-
PartitionType::INIT_DIRECT_ILP);
389+
PartitionType::kInitDirectIlp);
390390
const auto ilp_token
391391
= evaluator_->CutEvaluator(hgraph, ilp_solution, false);
392392
initial_solutions_cost.push_back(ilp_token.cost);
@@ -651,7 +651,7 @@ std::vector<int> MultilevelPartitioner::CutOverlayILPPart(
651651
upper_block_balance,
652652
lower_block_balance,
653653
init_solution,
654-
PartitionType::INIT_DIRECT_ILP);
654+
PartitionType::kInitDirectIlp);
655655
} else {
656656
clustered_hgraph->SetCommunity(init_solution);
657657
init_solution = SingleCycleRefinement(

src/par/src/Partitioner.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,20 @@ void Partitioner::Partition(const HGraphPtr& hgraph,
6565
std::fill(solution.begin(), solution.end(), -1);
6666
}
6767
switch (partitioner_choice) {
68-
case PartitionType::INIT_RANDOM:
68+
case PartitionType::kInitRandom:
6969
RandomPart(hgraph, upper_block_balance, lower_block_balance, solution);
7070
break;
7171

72-
case PartitionType::INIT_RANDOM_VILE:
72+
case PartitionType::kInitRandomVile:
7373
RandomPart(
7474
hgraph, upper_block_balance, lower_block_balance, solution, true);
7575
break;
7676

77-
case PartitionType::INIT_VILE:
77+
case PartitionType::kInitVile:
7878
VilePart(hgraph, solution);
7979
break;
8080

81-
case PartitionType::INIT_DIRECT_ILP:
81+
case PartitionType::kInitDirectIlp:
8282
ILPPart(hgraph, upper_block_balance, lower_block_balance, solution);
8383
break;
8484

@@ -224,7 +224,7 @@ void Partitioner::ILPPart(const HGraphPtr& hgraph,
224224
std::iota(edge_mask.begin(), edge_mask.end(), 0);
225225
} else if (ilp_accelerator_factor_ > 0.0) {
226226
// define comp structure to compare hyperedge ( function: >)
227-
struct comp
227+
struct Comp
228228
{
229229
// comparator function
230230
bool operator()(const std::pair<int, float>& l,
@@ -237,7 +237,7 @@ void Partitioner::ILPPart(const HGraphPtr& hgraph,
237237
}
238238
};
239239
// use set data structure to sort hyperedges
240-
std::set<std::pair<int, float>, comp> unvisited_hyperedges;
240+
std::set<std::pair<int, float>, Comp> unvisited_hyperedges;
241241
float tot_cost = 0.0; // total hyperedge cut
242242
for (auto e = 0; e < hgraph->GetNumHyperedges(); ++e) {
243243
const float score = evaluator_->CalculateHyperedgeCost(e, hgraph);

src/par/src/Partitioner.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ namespace par {
2525
// Define the partitioning algorithm
2626
enum class PartitionType
2727
{
28-
INIT_RANDOM,
29-
INIT_RANDOM_VILE,
30-
INIT_VILE,
31-
INIT_DIRECT_ILP
28+
kInitRandom,
29+
kInitRandomVile,
30+
kInitVile,
31+
kInitDirectIlp
3232
};
3333

3434
class Partitioner;

src/par/src/PriorityQueue.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ std::shared_ptr<VertexGain> PriorityQueue::GetBestCandidate(
7272
int index = 0; // starting from the first index
7373

7474
// define the lambda function to check the balance constraint
75-
auto CheckBalance = [&](int index) {
75+
auto check_balance = [&](int index) {
7676
const int vertex_id = vertices_[index]->GetVertex();
7777
const int to_pid = vertices_[index]->GetDestinationPart();
7878
const int from_pid = vertices_[index]->GetSourcePart();
@@ -86,7 +86,7 @@ std::shared_ptr<VertexGain> PriorityQueue::GetBestCandidate(
8686
};
8787

8888
// check the first index
89-
if (CheckBalance(index) == true) {
89+
if (check_balance(index) == true) {
9090
return vertices_[index];
9191
}
9292

@@ -95,13 +95,13 @@ std::shared_ptr<VertexGain> PriorityQueue::GetBestCandidate(
9595
pass++;
9696
// Step 1: check the left child first
9797
const int left_child = LeftChild(index);
98-
if (left_child < total_elements_ && CheckBalance(left_child) == true) {
98+
if (left_child < total_elements_ && check_balance(left_child) == true) {
9999
candidate_index = left_child;
100100
}
101101

102102
// Step 2: check the right child second
103103
const int right_child = RightChild(index);
104-
if (right_child < total_elements_ && CheckBalance(right_child) == true
104+
if (right_child < total_elements_ && check_balance(right_child) == true
105105
&& (candidate_index == -1
106106
|| CompareElementLargeThan(right_child, candidate_index))) {
107107
candidate_index = right_child; // use the right index

0 commit comments

Comments
 (0)