Merge pull request #387 from nysal/issue-383
Fix cache line size detection on power
Этот коммит содержится в:
Коммит
b28e1d1b51
@ -88,13 +88,13 @@ libnbc_open(void)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
OBJ_CONSTRUCT(&mca_coll_libnbc_component.requests, opal_free_list_t);
|
OBJ_CONSTRUCT(&mca_coll_libnbc_component.requests, opal_free_list_t);
|
||||||
|
OBJ_CONSTRUCT(&mca_coll_libnbc_component.active_requests, opal_list_t);
|
||||||
ret = opal_free_list_init (&mca_coll_libnbc_component.requests,
|
ret = opal_free_list_init (&mca_coll_libnbc_component.requests,
|
||||||
sizeof(ompi_coll_libnbc_request_t), 8,
|
sizeof(ompi_coll_libnbc_request_t), 8,
|
||||||
OBJ_CLASS(ompi_coll_libnbc_request_t),
|
OBJ_CLASS(ompi_coll_libnbc_request_t),
|
||||||
0, 0, 0, -1, 8, NULL, 0, NULL, NULL, NULL);
|
0, 0, 0, -1, 8, NULL, 0, NULL, NULL, NULL);
|
||||||
if (OMPI_SUCCESS != ret) return ret;
|
if (OMPI_SUCCESS != ret) return ret;
|
||||||
|
|
||||||
OBJ_CONSTRUCT(&mca_coll_libnbc_component.active_requests, opal_list_t);
|
|
||||||
/* note: active comms is the number of communicators who have had
|
/* note: active comms is the number of communicators who have had
|
||||||
a non-blocking collective started */
|
a non-blocking collective started */
|
||||||
mca_coll_libnbc_component.active_comms = 0;
|
mca_coll_libnbc_component.active_comms = 0;
|
||||||
|
@ -211,27 +211,32 @@ int opal_hwloc_base_filter_cpus(hwloc_topology_t topo)
|
|||||||
|
|
||||||
static void fill_cache_line_size(void)
|
static void fill_cache_line_size(void)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0, cache_level = 2;
|
||||||
unsigned size;
|
unsigned size;
|
||||||
hwloc_obj_t obj;
|
hwloc_obj_t obj;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
/* Look for the smallest L2 cache size */
|
/* Look for the smallest L2 cache size */
|
||||||
size = 4096;
|
size = 4096;
|
||||||
while (1) {
|
while (cache_level > 0 && !found) {
|
||||||
obj = opal_hwloc_base_get_obj_by_type(opal_hwloc_topology,
|
i=0;
|
||||||
HWLOC_OBJ_CACHE, 2,
|
while (1) {
|
||||||
i, OPAL_HWLOC_LOGICAL);
|
obj = opal_hwloc_base_get_obj_by_type(opal_hwloc_topology,
|
||||||
if (NULL == obj) {
|
HWLOC_OBJ_CACHE, cache_level,
|
||||||
break;
|
i, OPAL_HWLOC_LOGICAL);
|
||||||
} else {
|
if (NULL == obj) {
|
||||||
found = true;
|
--cache_level;
|
||||||
if (NULL != obj->attr &&
|
break;
|
||||||
size > obj->attr->cache.linesize) {
|
} else {
|
||||||
size = obj->attr->cache.linesize;
|
if (NULL != obj->attr &&
|
||||||
|
obj->attr->cache.linesize > 0 &&
|
||||||
|
size > obj->attr->cache.linesize) {
|
||||||
|
size = obj->attr->cache.linesize;
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
++i;
|
||||||
}
|
}
|
||||||
++i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we found an L2 cache size in the hwloc data, save it in
|
/* If we found an L2 cache size in the hwloc data, save it in
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user