Skip to content

Conversation

@lifflander
Copy link
Collaborator

@lifflander lifflander commented Jul 2, 2025

Fixes #2452

@lifflander lifflander linked an issue Jul 2, 2025 that may be closed by this pull request
1 task
@github-actions
Copy link

github-actions bot commented Jul 2, 2025

clang-format output for this changeset:

diff --git a/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc b/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc
index 4b4906754..be4791e1c 100644
--- a/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc
+++ b/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc
@@ -522,15 +522,16 @@ std::tuple<std::string, int, int> TemperedLB::getNodeRank() {
   MPI_Get_processor_name(hostname, &hostname_len);
 
   MPI_Comm shared_comm;
-  MPI_Comm_split_type(world_comm, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL, &shared_comm);
+  MPI_Comm_split_type(
+    world_comm, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL, &shared_comm
+  );
 
   int shared_rank = -1, shared_size = -1;
   MPI_Comm_rank(shared_comm, &shared_rank);
   MPI_Comm_size(shared_comm, &shared_size);
 
   vt_debug_print(
-    verbose, temperedlb,
-    "hostname: {}, global rank: {}, local rank: {}\n",
+    verbose, temperedlb, "hostname: {}, global rank: {}, local rank: {}\n",
     hostname, world_rank, shared_rank
   );
 
@@ -558,10 +559,8 @@ void TemperedLB::readAlphaFromFile() {
         if (file_hostname == hostname and shared_rank == file_shared_rank) {
           alpha = rank_alpha;
           vt_debug_print(
-            verbose, temperedlb,
-            "For rank {}, setting alpha to {}\n",
-            theContext()->getNode(),
-            alpha
+            verbose, temperedlb, "For rank {}, setting alpha to {}\n",
+            theContext()->getNode(), alpha
           );
           break;
         }
@@ -1236,8 +1235,12 @@ void TemperedLB::doLBStages(LoadType start_imb) {
           // Perform the reduction for Rank_load_modeled -> processor load only
           proxy_.allreduce<&TemperedLB::workStatsHandler, collective::PlusOp>(
             std::vector<balance::LoadData>{
-              {balance::LoadData{Statistic::Rank_load_modeled, this_new_load_ * alpha}},
-              {balance::LoadData{Statistic::Rank_strategy_specific_load_modeled, this_new_work_}}
+              {balance::LoadData{
+                Statistic::Rank_load_modeled, this_new_load_ * alpha
+              }},
+              {balance::LoadData{
+                Statistic::Rank_strategy_specific_load_modeled, this_new_work_
+              }}
             }
           );
         });
@@ -1367,8 +1370,12 @@ void TemperedLB::doLBStages(LoadType start_imb) {
           // Perform the reduction for Rank_load_modeled -> processor load only
           proxy_.allreduce<&TemperedLB::loadStatsHandler, collective::PlusOp>(
             std::vector<balance::LoadData>{
-              {balance::LoadData{Statistic::Rank_load_modeled, this_new_load_ * alpha}},
-              {balance::LoadData{Statistic::Rank_strategy_specific_load_modeled, this_new_work_}}
+              {balance::LoadData{
+                Statistic::Rank_load_modeled, this_new_load_ * alpha
+              }},
+              {balance::LoadData{
+                Statistic::Rank_strategy_specific_load_modeled, this_new_work_
+              }}
             }
           );
         });
@@ -1702,9 +1709,12 @@ void TemperedLB::propagateRound(uint8_t k_cur, bool sync, EpochType epoch) {
       }
       NodeInfo info{
         alpha,
-        this_new_load_, this_new_work_,
-        this_new_breakdown_.inter_send_vol, this_new_breakdown_.inter_recv_vol,
-        this_new_breakdown_.intra_send_vol, this_new_breakdown_.intra_recv_vol,
+        this_new_load_,
+        this_new_work_,
+        this_new_breakdown_.inter_send_vol,
+        this_new_breakdown_.inter_recv_vol,
+        this_new_breakdown_.intra_send_vol,
+        this_new_breakdown_.intra_recv_vol,
         this_new_breakdown_.shared_vol
       };
       msg->addNodeInfo(this_node, info);
@@ -1722,9 +1732,12 @@ void TemperedLB::propagateRound(uint8_t k_cur, bool sync, EpochType epoch) {
       }
       NodeInfo info{
         alpha,
-        this_new_load_, this_new_work_,
-        this_new_breakdown_.inter_send_vol, this_new_breakdown_.inter_recv_vol,
-        this_new_breakdown_.intra_send_vol, this_new_breakdown_.intra_recv_vol,
+        this_new_load_,
+        this_new_work_,
+        this_new_breakdown_.inter_send_vol,
+        this_new_breakdown_.inter_recv_vol,
+        this_new_breakdown_.intra_send_vol,
+        this_new_breakdown_.intra_recv_vol,
         this_new_breakdown_.shared_vol
       };
       msg->addNodeInfo(this_node, info);
@@ -2345,9 +2358,12 @@ void TemperedLB::considerSwapsAfterLock(MsgSharedPtr<LockedInfoMsg> msg) {
 
   NodeInfo this_info{
     alpha,
-    this_new_load_, this_new_work_,
-    this_new_breakdown_.inter_send_vol, this_new_breakdown_.inter_recv_vol,
-    this_new_breakdown_.intra_send_vol, this_new_breakdown_.intra_recv_vol,
+    this_new_load_,
+    this_new_work_,
+    this_new_breakdown_.inter_send_vol,
+    this_new_breakdown_.inter_recv_vol,
+    this_new_breakdown_.intra_send_vol,
+    this_new_breakdown_.intra_recv_vol,
     this_new_breakdown_.shared_vol
   };
 
@@ -2677,9 +2693,12 @@ void TemperedLB::satisfyLockRequest() {
 
     NodeInfo this_info{
       alpha,
-      this_new_load_, this_new_work_,
-      this_new_breakdown_.inter_send_vol, this_new_breakdown_.inter_recv_vol,
-      this_new_breakdown_.intra_send_vol, this_new_breakdown_.intra_recv_vol,
+      this_new_load_,
+      this_new_work_,
+      this_new_breakdown_.inter_send_vol,
+      this_new_breakdown_.inter_recv_vol,
+      this_new_breakdown_.intra_send_vol,
+      this_new_breakdown_.intra_recv_vol,
       this_new_breakdown_.shared_vol
     };
 
@@ -2701,9 +2720,12 @@ void TemperedLB::swapClusters() {
 
   NodeInfo this_info{
     alpha,
-    this_new_load_, this_new_work_,
-    this_new_breakdown_.inter_send_vol, this_new_breakdown_.inter_recv_vol,
-    this_new_breakdown_.intra_send_vol, this_new_breakdown_.intra_recv_vol,
+    this_new_load_,
+    this_new_work_,
+    this_new_breakdown_.inter_send_vol,
+    this_new_breakdown_.inter_recv_vol,
+    this_new_breakdown_.intra_send_vol,
+    this_new_breakdown_.intra_recv_vol,
     this_new_breakdown_.shared_vol
   };
 

@lifflander lifflander marked this pull request as ready for review August 25, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rank-based alpha to TemperedLB

2 participants