1
1

OMPI: btl openib: fix detection of max registarable memory

Deal with the case when mlx4 module is loaded but device
is not present

cmr=v1.8.3:reviewer=miked

This commit was SVN r32734.
Этот коммит содержится в:
Alex Mikheev 2014-09-15 12:17:23 +00:00
родитель fad4384463
Коммит 31d0724a08

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

@ -635,12 +635,17 @@ static uint64_t calculate_max_reg (void)
mtts_per_seg = 1 << read_module_param("/sys/module/mlx4_core/parameters/log_mtts_per_seg", 1);
num_mtt = 1 << read_module_param("/sys/module/mlx4_core/parameters/log_num_mtt", 20);
if (1 == num_mtt) {
/* NTH: is 19 a minimum? when log_num_mtt is set to 0 use 19 */
num_mtt = 1 << 20;
if (0 == stat("/sys/module/mlx5_core", &statinfo)) {
max_reg = 2 * mem_total;
} else {
/* NTH: is 19 a minimum? when log_num_mtt is set to 0 use 19 */
num_mtt = 1 << 19;
max_reg = (num_mtt - reserved_mtt) * opal_getpagesize () * mtts_per_seg;
}
} else {
max_reg = (num_mtt - reserved_mtt) * opal_getpagesize () * mtts_per_seg;
}
max_reg = (num_mtt - reserved_mtt) * opal_getpagesize () * mtts_per_seg;
} else if (0 == stat("/sys/module/ib_mthca/parameters/num_mtt", &statinfo)) {
mtts_per_seg = 1 << read_module_param("/sys/module/ib_mthca/parameters/log_mtts_per_seg", 1);
num_mtt = read_module_param("/sys/module/ib_mthca/parameters/num_mtt", 1 << 20);