@@ -98,22 +98,7 @@ InfUdDriver::InfUdDriver(Context* context, const ServiceLocator *sl,
9898 , qpn(0 )
9999 , localMac()
100100 , locatorString(" infud:" )
101- // As of 11/2018, the network bandwidth of our RC machines at Stanford is
102- // actually limited by the effective bandwidth of PCIe 2.0x4, which should
103- // be ~29Gbps when taking into account the overhead of PCIe headers.
104- // For example, suppose the HCA's MTU is 256B and the PCIe headers are 24B
105- // in total, the effective bandwidth of PCIe 2.0x4 is
106- // 32Gbps * 256 / (256 + 24) = 29.25Gbps
107- // Unfortunately, it appears that our ConnextX-2 HCA somehow cannot fully
108- // utilize the 29Gbps PCIe bandwidth when sending UD packets. This can be
109- // verified by running one or more ib_send_bw programs on two machines.
110- // The maximum outgoing bandwidth we can achieve in practice is ~3020MB/s,
111- // or 23.6Gbps. Note that we need to set the outgoing bandwidth slightly
112- // higher than 24Gbps in order to saturate the 23.6Gbps outgoing bandwidth.
113- // This is because the throughput of the HCA has non-negligible variation:
114- // when it's running faster than 24Gbps, we don't want the transport to
115- // throttle the throughput and leave the HCA idle.
116- , bandwidthGbps(26 ) // Default outgoing bandwidth in gbs
101+ , bandwidthGbps(~0u )
117102 , zeroCopyStart(NULL )
118103 , zeroCopyEnd(NULL )
119104 , zeroCopyRegion(NULL )
@@ -146,6 +131,27 @@ InfUdDriver::InfUdDriver(Context* context, const ServiceLocator *sl,
146131 } catch (ServiceLocator::NoSuchKeyException& e) {}
147132 }
148133 infiniband = realInfiniband.construct (ibDeviceName);
134+ #if 1
135+ bandwidthGbps = std::min (bandwidthGbps,
136+ static_cast <int >(infiniband->getBandwidthGbps (ibPhysicalPort)));
137+ #else
138+ // As of 11/2018, the network bandwidth of our RC machines at Stanford is
139+ // actually limited by the effective bandwidth of PCIe 2.0x4, which should
140+ // be ~29Gbps when taking into account the overhead of PCIe headers.
141+ // For example, suppose the HCA's MTU is 256B and the PCIe headers are 24B
142+ // in total, the effective bandwidth of PCIe 2.0x4 is
143+ // 32Gbps * 256 / (256 + 24) = 29.25Gbps
144+ // Unfortunately, it appears that our ConnextX-2 HCA somehow cannot fully
145+ // utilize the 29Gbps PCIe bandwidth when sending UD packets. This can be
146+ // verified by running one or more ib_send_bw programs on two machines.
147+ // The maximum outgoing bandwidth we can achieve in practice is ~3020MB/s,
148+ // or 23.6Gbps. Note that we need to set the outgoing bandwidth slightly
149+ // higher than 24Gbps in order to saturate the 23.6Gbps outgoing bandwidth.
150+ // This is because the throughput of the HCA has non-negligible variation:
151+ // when it's running faster than 24Gbps, we don't want the transport to
152+ // throttle the throughput and leave the HCA idle.
153+ bandwidthGbps = std::min(bandwidthGbps, 26);
154+ #endif
149155 mtu = infiniband->getMtu (ibPhysicalPort);
150156 queueEstimator.setBandwidth (1000 *bandwidthGbps);
151157 maxTransmitQueueSize = (uint32_t ) (static_cast <double >(bandwidthGbps)
0 commit comments