Ticket #507: fountain-fixzeros.patch

File fountain-fixzeros.patch, 6.6 kB (added by troy, 1 year ago)
  • source/server/InfinibandPort.cpp

    old new  
    527527    receivePacketsRate = (receivePacketsCurrent - receivePacketsLast) / queryInterval; 
    528528    symbolErrorsRate = (symbolErrorsCurrent - symbolErrorsLast) / queryInterval; 
    529529     
    530     //sanity check for expected values (ex: a rate above the theoretical peak probably means we screwed up somewhere in the calculation) 
    531     if (sendRate > (speed * 1000000000.0)) { 
    532         logger(QLOG_ERR) << "Calculated send rate " << sendRate << " greater than link speed of " << TypeConvert::toString(speed, 1); 
    533         logger(QLOG_ERR) << "node " << Node::getNodeName(remoteNodeGuid) << " port " << portNumber << " previous " << sendDataLast << " current " << sendDataCurrent << " delta " << TypeConvert::toString(queryInterval, 3); 
    534         sendRate = 0; 
     530    //sanity check for expected values (ex: a rate above the theoretical peak probably 
     531    //means we screwed up somewhere in the calculation) 
     532    if (sendRate > (get_capacity()*1e9)) { 
     533        logger(QLOG_ERR) << "Calculated send rate " << sendRate 
     534            << " greater than link capacity of " << TypeConvert::toString(get_capacity(), 1); 
     535        logger(QLOG_ERR) << "node " << Node::getNodeName(remoteNodeGuid) << " port "  
     536            << portNumber << " previous " << sendDataLast << " current " << sendDataCurrent  
     537            << " delta " << TypeConvert::toString(queryInterval, 3); 
     538        sendRate = get_capacity(); 
    535539    } 
    536     if (receiveRate > (speed * 1000000000.0)) { 
    537         logger(QLOG_ERR) << "Calculated receive rate " << receiveRate << " greater than link speed of " << TypeConvert::toString(speed, 1); 
    538         logger(QLOG_ERR) << "node " << Node::getNodeName(remoteNodeGuid) << " port " << portNumber << " previous " << receiveDataLast << " current " << receiveDataCurrent << " delta " << TypeConvert::toString(queryInterval, 3); 
    539         receiveRate = 0; 
     540    if (receiveRate > (get_capacity()*1e9)) { 
     541        logger(QLOG_ERR) << "Calculated receive rate " << receiveRate 
     542            << " greater than link capacity of " << TypeConvert::toString(get_capacity(), 1); 
     543        logger(QLOG_ERR) << "node " << Node::getNodeName(remoteNodeGuid) << " port "  
     544            << portNumber << " previous " << receiveDataLast << " current " << receiveDataCurrent  
     545            << " delta " << TypeConvert::toString(queryInterval, 3); 
     546        receiveRate = get_capacity(); 
    540547    } 
    541     if (sendPacketsRate > (speed * 1000000000.0)) { 
    542         sendPacketsRate = 0; 
     548    if (sendPacketsRate > (speed*1e9)) { 
     549        logger(QLOG_ERR) << "Calculated send Packets rate " << sendPacketsRate 
     550            << " greater than link speed of " << TypeConvert::toString(speed, 1); 
     551        logger(QLOG_ERR) << "node " << Node::getNodeName(remoteNodeGuid) << " port " 
     552            << portNumber << " previous " << sendPacketsLast << " current " << sendPacketsCurrent  
     553            << " delta " << TypeConvert::toString(queryInterval, 3); 
     554        sendPacketsRate = speed; 
    543555    } 
    544     if (receivePacketsRate > (speed * 1000000000.0)) { 
    545         receivePacketsRate = 0; 
     556    if (receivePacketsRate > (speed*1e9)) { 
     557        logger(QLOG_ERR) << "Calculated receive Packets rate " << receivePacketsRate  
     558            << " greater than link speed of " << TypeConvert::toString(speed, 1); 
     559        logger(QLOG_ERR) << "node " << Node::getNodeName(remoteNodeGuid) << " port "  
     560            << portNumber << " previous " << receivePacketsLast << " current " << receivePacketsCurrent  
     561            << " delta " << TypeConvert::toString(queryInterval, 3); 
     562        receivePacketsRate = speed; 
    546563    } 
    547     if (symbolErrorsRate > (speed * 1000000000.0)) { 
    548         symbolErrorsRate = 0; 
     564    if (symbolErrorsRate > (speed*1e9)) { 
     565        logger(QLOG_ERR) << "Calculated Symbol Errors rate " << symbolErrorsRate 
     566            << " greater than link speed of " << TypeConvert::toString(speed, 1); 
     567        logger(QLOG_ERR) << "node " << Node::getNodeName(remoteNodeGuid) << " port " 
     568            << portNumber << " previous " << symbolErrorsLast << " current " << symbolErrorsCurrent 
     569            << " delta " << TypeConvert::toString(queryInterval, 3); 
     570        symbolErrorsRate = speed; 
    549571    } 
    550572     
    551573    return; 
     
    641663                stringstream linkSpeedString; 
    642664                linkSpeedString << speed; 
    643665                XMLElement* speedElement = portElement->addChildElement("Speed", linkSpeedString.str().c_str()); 
    644                 speedElement->addAttribute("units", "Gigabits/sec"); 
     666                speedElement->addAttribute("units", "GigaBits/sec"); 
    645667        //Add a data payload capacity element 
    646668        //The capacity is simply the speed adjusted for the 8/10 bit encoding 
    647669        stringstream cap; 
    648         cap << (speed*width*8/10); 
     670        cap << get_capacity(); 
    649671                XMLElement* capElement = portElement->addChildElement("Capacity", cap.str().c_str()); 
    650                 capElement->addAttribute("units", "Gigabits/sec"); 
     672                capElement->addAttribute("units", "GigaBits/sec"); 
    651673        } 
    652674} 
  • source/server/InfinibandNetwork.cpp

    old new  
    604604 
    605605    //report on total time it took to update all the port counters 
    606606    totalPortCounterTime.stop(); 
    607     DebugMessageStream(QLOG_DEBUG) << "Done with Infiniband::DataSource::update() elapsed time " << totalPortCounterTime.getDiffSeconds(); 
     607    DebugMessageStream(QLOG_INFO) << "Done with Infiniband::DataSource::update() elapsed time " << totalPortCounterTime.getDiffSeconds(); 
    608608 
    609609    return; 
    610610} 
  • source/server/InfinibandPort.h

    old new  
    209209            int width; 
    210210             
    211211            /*! 
    212              * The maximum speed of this port, eg 2.5 Gbps, 5.0 Gbps, 10.0 Gbps, 12.0 Gbps 
     212             * The maximum speed of this port, eg 2.5 Gbps, 5.0 Gbps, 10.0 Gbps, 
     213             * 12.0 Gbps, in units of GigaBits per Second 
    213214             */ 
    214215            double speed; 
    215216             
     217 
    216218            /*! 
     219             * The data rate capacity of this port, GigaBits/sec 
     220             */ 
     221            inline double get_capacity(void){ 
     222                return ((speed*width*8)/10); 
     223            } 
     224             
     225            /*! 
    217226             * The time between calls to update, used for both send and receive bandwidth calculation 
    218227             */ 
    219228            Timer queryTime;