@@ -1761,13 +1761,14 @@ class test_ucp_address_v2 : public test_ucp_wireup {
1761
1761
" tag,unified" );
1762
1762
}
1763
1763
1764
- void check_fp_values (double unpacked, double original)
1764
+ void
1765
+ check_fp_values (const std::string &name, double unpacked, double original)
1765
1766
{
1766
1767
double max_error = original / pow (2 , _UCS_FP8_MANTISSA_BITS);
1767
- EXPECT_NEAR (original, unpacked, max_error);
1768
+ EXPECT_NEAR (original, unpacked, max_error) << name ;
1768
1769
}
1769
1770
1770
- const uct_iface_attr_t * get_iface_attr (const ucp_address_entry_t *ae)
1771
+ const ucp_worker_iface_t * get_wiface (const ucp_address_entry_t *ae)
1771
1772
{
1772
1773
ucp_worker_h worker = sender ().worker ();
1773
1774
ucp_context_h context = worker->context ;
@@ -1789,7 +1790,7 @@ class test_ucp_address_v2 : public test_ucp_wireup {
1789
1790
ae->tl_name_csum ) &&
1790
1791
uct_iface_is_reachable_v2 (wiface->iface , ¶ms)) {
1791
1792
EXPECT_EQ (ae->md_index , context->tl_rscs [rsc_index].md_index );
1792
- return & wiface-> attr ;
1793
+ return wiface;
1793
1794
}
1794
1795
}
1795
1796
@@ -1825,20 +1826,22 @@ UCS_TEST_SKIP_COND_P(test_ucp_address_v2, pack_iface_attrs,
1825
1826
1826
1827
const ucp_address_entry_t *ae;
1827
1828
ucp_unpacked_address_for_each (ae, &unpacked_address) {
1828
- auto attr = get_iface_attr (ae);
1829
- ASSERT_NE (nullptr , attr );
1829
+ auto wiface = get_wiface (ae);
1830
+ ASSERT_NE (nullptr , wiface );
1830
1831
1831
1832
// Segment size is packed as a multiplicator of
1832
1833
// UCP_ADDRESS_IFACE_SEG_SIZE_FACTOR, thus the unpacked value may be
1833
1834
// smaller than the original value by up to 64 bytes.
1834
- EXPECT_LT (ucp_address_iface_seg_size (attr) - ae->iface_attr .seg_size ,
1835
+ EXPECT_LT (ucp_address_iface_seg_size (&wiface->attr ) -
1836
+ ae->iface_attr .seg_size ,
1835
1837
UCP_ADDRESS_IFACE_SEG_SIZE_FACTOR);
1836
- check_fp_values (ae->iface_attr .overhead , attr->overhead );
1837
- check_fp_values (ae->iface_attr .lat_ovh ,
1838
- ucp_tl_iface_latency (worker->context , &attr->latency ));
1839
- check_fp_values (
1840
- ae->iface_attr .bandwidth ,
1841
- ucp_tl_iface_bandwidth (worker->context , &attr->bandwidth ));
1838
+
1839
+ check_fp_values (" overhead" , ae->iface_attr .overhead ,
1840
+ wiface->attr .overhead );
1841
+ check_fp_values (" latency" , ae->iface_attr .lat_ovh ,
1842
+ ucp_wireup_iface_lat_distance_v2 (wiface, 0 ));
1843
+ check_fp_values (" bandwidth" , ae->iface_attr .bandwidth ,
1844
+ ucp_wireup_iface_bw_distance (wiface));
1842
1845
}
1843
1846
1844
1847
ucs_free (unpacked_address.address_list );
0 commit comments