@@ -233,7 +233,8 @@ ucs_status_t ucp_proto_multi_init(const ucp_proto_multi_init_params_t *params,
233233 double max_bandwidth , max_frag_ratio , min_bandwidth ;
234234 ucp_lane_index_t i , lane , num_lanes , num_fast_lanes ;
235235 ucp_proto_multi_lane_priv_t * lpriv ;
236- size_t max_frag , min_length , min_end_offset , min_chunk ;
236+ size_t max_frag , min_end_offset , min_chunk ;
237+ size_t UCS_V_UNUSED min_length ;
237238 ucp_proto_lane_selection_t selection ;
238239 ucp_md_map_t reg_md_map ;
239240 uint32_t weight_sum ;
@@ -374,7 +375,6 @@ ucs_status_t ucp_proto_multi_init(const ucp_proto_multi_init_params_t *params,
374375 mpriv -> max_frag_sum = 0 ;
375376 mpriv -> align_thresh = 1 ;
376377 perf .max_frag = 0 ;
377- perf .min_length = 0 ;
378378 weight_sum = 0 ;
379379 min_end_offset = 0 ;
380380
@@ -448,7 +448,6 @@ ucs_status_t ucp_proto_multi_init(const ucp_proto_multi_init_params_t *params,
448448 lpriv -> weight ;
449449 ucs_assert (ucp_proto_multi_scaled_length (lpriv -> weight , min_length ) >=
450450 lane_perf -> min_length );
451- perf .min_length = ucs_max (perf .min_length , min_length );
452451
453452 weight_sum += lpriv -> weight ;
454453 min_end_offset += min_chunk ;
@@ -464,6 +463,9 @@ ucs_status_t ucp_proto_multi_init(const ucp_proto_multi_init_params_t *params,
464463 }
465464 ucs_assert (mpriv -> num_lanes == ucs_popcount (selection .lane_map ));
466465
466+ /* Multi-lane protocols with non-zero min_frag pad length if needed */
467+ perf .min_length = mpriv -> min_frag ;
468+
467469 if (mpriv -> num_lanes == 1 ) {
468470 perf .node = lanes_perf [ucs_ffs64 (selection .lane_map )].node ;
469471 ucp_proto_perf_node_ref (perf .node );
0 commit comments