1
1

Revert "Fix the logic for computing the different weights for each BTLs. This"

This reverts commit de118609eccfc9231f8c508fdc5edbed93d395b4.
Этот коммит содержится в:
George Bosilca 2015-02-26 17:54:31 -05:00
родитель 778ba0317e
Коммит 7f90cedf23

Просмотреть файл

@ -329,6 +329,8 @@ struct mca_pml_ob1_com_btl_t {
};
typedef struct mca_pml_ob1_com_btl_t mca_pml_ob1_com_btl_t;
int mca_pml_ob1_com_btl_comp(const void *v1, const void *v2);
/* Calculate what percentage of a message to send through each BTL according to
* relative weight */
static inline void
@ -344,21 +346,25 @@ mca_pml_ob1_calc_weighted_length( mca_pml_ob1_com_btl_t *btls, int num_btls, siz
return;
}
/* The list of BTLs must be already sorted by decreasing order of the bandwidth.
* This ensure that BTLs with smaller weight will not hijack all of the traffic */
/* sort BTLs according of their weights so BTLs with smaller weight will
* not hijack all of the traffic */
qsort( btls, num_btls, sizeof(mca_pml_ob1_com_btl_t),
mca_pml_ob1_com_btl_comp );
for(length_left = size, i = 0; (i < num_btls) && (0 != length_left); i++) {
for(length_left = size, i = 0; i < num_btls; i++) {
mca_bml_base_btl_t* bml_btl = btls[i].bml_btl;
size_t length = (length_left > bml_btl->btl->btl_eager_limit)?
((size_t)(size * (bml_btl->btl_weight / weight_total))) :
length_left;
size_t length = 0;
if( OPAL_UNLIKELY(0 != length_left) ) {
length = (length_left > bml_btl->btl->btl_eager_limit)?
((size_t)(size * (bml_btl->btl_weight / weight_total))) :
length_left;
if(length > length_left)
length = length_left;
length_left -= length;
if(length > length_left)
length = length_left;
length_left -= length;
}
btls[i].length = length;
}
for(; i < num_btls; btls[i].length = 0, i++); /* zero everything else */
/* account for rounding errors */
btls[0].length += length_left;