Skip to content

Commit

Permalink
linux+API: Remove support for Intel Xeon Phi (MIC, Knights Corner) co…
Browse files Browse the repository at this point in the history
…-processors

Closes #368

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Oct 4, 2019
1 parent 7e9767c commit 05a5055
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 395 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -112,7 +112,6 @@ test-suite.log
/tests/hwloc/hwloc_iodevs
/tests/hwloc/xmlbuffer
/tests/hwloc/gl
/tests/hwloc/intel-mic
/tests/hwloc/linux-libnuma
/tests/hwloc/glibc-sched
/tests/hwloc/openfabrics-verbs
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Expand Up @@ -16,6 +16,11 @@ bug fixes (and other actions) for each version of hwloc since version
0.9.


Version 2.2.0
-------------
* Remove support for Intel Xeon Phi (MIC, Knights Corner) co-processors.


Version 2.1.0
-------------
* API
Expand Down
6 changes: 1 addition & 5 deletions doc/Makefile.am
Expand Up @@ -80,7 +80,6 @@ dox_inputs = $(DOX_CONFIG) \
$(hwloc_include_dir)/hwloc/cudart.h \
$(hwloc_include_dir)/hwloc/nvml.h \
$(hwloc_include_dir)/hwloc/gl.h \
$(hwloc_include_dir)/hwloc/intel-mic.h \
$(hwloc_include_dir)/hwloc/openfabrics-verbs.h \
$(srcdir)/netloc.doxy \
$(hwloc_include_dir)/netloc.h
Expand Down Expand Up @@ -716,10 +715,7 @@ man3_cuda_DATA = \
$(DOX_MAN_DIR)/man3/hwlocality_gl.3 \
$(DOX_MAN_DIR)/man3/hwloc_gl_get_display_osdev_by_port_device.3 \
$(DOX_MAN_DIR)/man3/hwloc_gl_get_display_osdev_by_name.3 \
$(DOX_MAN_DIR)/man3/hwloc_gl_get_display_by_osdev.3 \
$(DOX_MAN_DIR)/man3/hwlocality_intel_mic.3 \
$(DOX_MAN_DIR)/man3/hwloc_intel_mic_get_device_cpuset.3 \
$(DOX_MAN_DIR)/man3/hwloc_intel_mic_get_device_osdev_by_index.3
$(DOX_MAN_DIR)/man3/hwloc_gl_get_display_by_osdev.3

man3_glibc_scheddir = $(man3dir)
man3_glibc_sched_DATA = \
Expand Down
3 changes: 1 addition & 2 deletions doc/doxygen-config.cfg.in
@@ -1,4 +1,4 @@
# Copyright © 2010-2017 Inria. All rights reserved.
# Copyright © 2010-2019 Inria. All rights reserved.
# Copyright © 2009 Cisco Systems, Inc. All rights reserved.
# See COPYING in top-level directory.

Expand All @@ -23,7 +23,6 @@ INPUT = \
@top_srcdir@/include/hwloc/cudart.h \
@top_srcdir@/include/hwloc/nvml.h \
@top_srcdir@/include/hwloc/gl.h \
@top_srcdir@/include/hwloc/intel-mic.h \
@top_srcdir@/include/hwloc/openfabrics-verbs.h \
@top_srcdir@/include/hwloc/diff.h \
@top_srcdir@/include/hwloc/shmem.h \
Expand Down
49 changes: 0 additions & 49 deletions doc/hwloc.doxy
Expand Up @@ -1470,9 +1470,6 @@ components when I/O discovery is enabled and supported.
(OpenCL component)</li>
<li><em>cuda0</em> for the first NVIDIA CUDA device
(CUDA component, using the NVIDIA CUDA Library)</li>
<li><em>mic0</em> for the first Intel Xeon Phi (MIC) coprocessor
(Linux component)</li>
</ul>
</li>
<li>DMA engine channel (::HWLOC_OBJ_OSDEV_DMA)
<ul>
Expand Down Expand Up @@ -1888,23 +1885,6 @@ and SectorSize (in bytes).
and size of the shared memory in each multiprocessor of a CUDA device.
Sizes are in kB.
</dd>
<dt>MICSerialNumber (MIC coprocessor OS device)</dt>
<dd>
The serial number of an Intel Xeon Phi (MIC) coprocessor.
hwloc may run either inside the coprocessor itself, or on the host processor.
That attribute is set in both cases, so that the exact same coprocessor may be
identified from both point of views, even if there are multiple nodes with
multiple MICs.
When running hwloc on the host, each hwloc OS device object that
corresponds to a Xeon Phi gets such an attribute.
When running hwloc inside a Xeon Phi coprocessor, the root of the topology
(Machine object) gets this attribute.
</dd>
<dt>MICFamily, MICSKU, MICActiveCores, MICMemorySize (MIC coprocessor OS device)</dt>
<dd>The family, SKU (model),
number of active cores, and memory size (in kB)
of an Intel Xeon Phi (MIC) coprocessor.
</dd>
<dt>Address, Port (Network interface OS devices)</dt>
<dd>The MAC address and the port number of a software network
interface, such as <tt>eth4</tt> on Linux.
Expand Down Expand Up @@ -2301,14 +2281,6 @@ enabled for the current topology.
information (if I/O device discovery is enabled).
</dd>

<dt>Intel Xeon Phi (MIC)</dt>
<dd>
hwloc/intel-mic.h helps interoperability with Intel Xeon Phi (MIC)
coprocessors by returning the list of processors near these devices.
It may also return the corresponding OS device hwloc object for further
information (if I/O device discovery is enabled).
</dd>

<dt>OpenCL</dt>
<dd>
hwloc/opencl.h enables interoperability with the OpenCL interface.
Expand Down Expand Up @@ -3564,27 +3536,6 @@ See <tt>HWLOC_DUMPED_HWDATA_DIR</tt> in \ref envvar for details
about the location of dumped files.


\subsection faq_phi How do I build for Intel Xeon Phi coprocessor?

\note This section does not apply to standalone Intel Xeon Phi processors (Knights Landing and Knights Mill).

Intel Xeon Phi coprocessors (Knights Corner) usually runs a Linux environment
but cross-compiling from the host is required.
hwloc uses standard autotools options for cross-compiling.

If building with <tt>icc</tt>:
\verbatim
./configure CC="icc -mmic" --host=x86_64-k1om-linux --build=x86_64-unknown-linux-gnu
\endverbatim

If building with the Xeon Phi-specific GCC that comes with the MPSS environment,
for instance <tt>/usr/linux-k1om-4.7/bin/x86_64-k1om-linux-gcc</tt>:
\verbatim
export PATH=$PATH:/usr/linux-k1om-4.7/bin/
./configure --host=x86_64-k1om-linux --build=x86_64-unknown-linux-gnu
\endverbatim


\subsection faq_bgq How do I build hwloc for BlueGene/Q?

IBM BlueGene/Q machines run a standard Linux on the login/frontend nodes
Expand Down
110 changes: 0 additions & 110 deletions hwloc/topology-linux.c
Expand Up @@ -5052,24 +5052,6 @@ hwloc_linux_free_cpuinfo(struct hwloc_linux_cpuinfo_proc * Lprocs, unsigned nump
****** Main Topology Discovery ******
*************************************/

static void
hwloc__linux_get_mic_sn(struct hwloc_topology *topology, struct hwloc_linux_backend_data_s *data)
{
char line[64], *tmp, *end;
if (hwloc_read_path_by_length("/proc/elog", line, sizeof(line), data->root_fd) < 0)
return;
if (strncmp(line, "Card ", 5))
return;
tmp = line + 5;
end = strchr(tmp, ':');
if (!end)
return;
*end = '\0';

if (tmp[0])
hwloc_obj_add_info(hwloc_get_root_obj(topology), "MICSerialNumber", tmp);
}

static void
hwloc_gather_system_info(struct hwloc_topology *topology,
struct hwloc_linux_backend_data_s *data)
Expand Down Expand Up @@ -5450,8 +5432,6 @@ hwloc_linuxfs_look_cpu(struct hwloc_backend *backend, struct hwloc_disc_status *
free(cpuset_name);
}

hwloc__linux_get_mic_sn(topology, data);

/* data->utsname was filled with real uname or \0, we can safely pass it */
hwloc_add_uname_info(topology, &data->utsname);

Expand Down Expand Up @@ -6136,95 +6116,6 @@ hwloc_linuxfs_lookup_infiniband_class(struct hwloc_backend *backend, unsigned os
return 0;
}

static void
hwloc_linuxfs_mic_class_fillinfos(int root_fd,
struct hwloc_obj *obj, const char *osdevpath)
{
char path[296]; /* osdevpath <= 256 */
char family[64];
char sku[64];
char sn[64];
char string[21];

obj->subtype = strdup("MIC");

snprintf(path, sizeof(path), "%s/family", osdevpath);
if (!hwloc_read_path_by_length(path, family, sizeof(family), root_fd)) {
char *eol = strchr(family, '\n');
if (eol)
*eol = 0;
hwloc_obj_add_info(obj, "MICFamily", family);
}

snprintf(path, sizeof(path), "%s/sku", osdevpath);
if (!hwloc_read_path_by_length(path, sku, sizeof(sku), root_fd)) {
char *eol = strchr(sku, '\n');
if (eol)
*eol = 0;
hwloc_obj_add_info(obj, "MICSKU", sku);
}

snprintf(path, sizeof(path), "%s/serialnumber", osdevpath);
if (!hwloc_read_path_by_length(path, sn, sizeof(sn), root_fd)) {
char *eol;
eol = strchr(sn, '\n');
if (eol)
*eol = 0;
hwloc_obj_add_info(obj, "MICSerialNumber", sn);
}

snprintf(path, sizeof(path), "%s/active_cores", osdevpath);
if (!hwloc_read_path_by_length(path, string, sizeof(string), root_fd)) {
unsigned long count = strtoul(string, NULL, 16);
snprintf(string, sizeof(string), "%lu", count);
hwloc_obj_add_info(obj, "MICActiveCores", string);
}

snprintf(path, sizeof(path), "%s/memsize", osdevpath);
if (!hwloc_read_path_by_length(path, string, sizeof(string), root_fd)) {
unsigned long count = strtoul(string, NULL, 16);
snprintf(string, sizeof(string), "%lu", count);
hwloc_obj_add_info(obj, "MICMemorySize", string);
}
}

static int
hwloc_linuxfs_lookup_mic_class(struct hwloc_backend *backend, unsigned osdev_flags)
{
struct hwloc_linux_backend_data_s *data = backend->private_data;
int root_fd = data->root_fd;
unsigned idx;
DIR *dir;
struct dirent *dirent;

dir = hwloc_opendir("/sys/class/mic", root_fd);
if (!dir)
return 0;

while ((dirent = readdir(dir)) != NULL) {
char path[256];
hwloc_obj_t obj, parent;

if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, ".."))
continue;
if (sscanf(dirent->d_name, "mic%u", &idx) != 1)
continue;

snprintf(path, sizeof(path), "/sys/class/mic/mic%u", idx);
parent = hwloc_linuxfs_find_osdev_parent(backend, root_fd, path, osdev_flags);
if (!parent)
continue;

obj = hwloc_linux_add_os_device(backend, parent, HWLOC_OBJ_OSDEV_COPROC, dirent->d_name);

hwloc_linuxfs_mic_class_fillinfos(root_fd, obj, path);
}

closedir(dir);

return 0;
}

static int
hwloc_linuxfs_lookup_drm_class(struct hwloc_backend *backend, unsigned osdev_flags)
{
Expand Down Expand Up @@ -6784,7 +6675,6 @@ hwloc_look_linuxfs(struct hwloc_backend *backend, struct hwloc_disc_status *dsta
hwloc_linuxfs_lookup_dax_class(backend, osdev_flags);
hwloc_linuxfs_lookup_net_class(backend, osdev_flags);
hwloc_linuxfs_lookup_infiniband_class(backend, osdev_flags);
hwloc_linuxfs_lookup_mic_class(backend, osdev_flags);
if (ofilter != HWLOC_TYPE_FILTER_KEEP_IMPORTANT) {
hwloc_linuxfs_lookup_drm_class(backend, osdev_flags);
hwloc_linuxfs_lookup_dma_class(backend, osdev_flags);
Expand Down
3 changes: 1 addition & 2 deletions include/Makefile.am
@@ -1,4 +1,4 @@
# Copyright © 2009-2018 Inria. All rights reserved.
# Copyright © 2009-2019 Inria. All rights reserved.
# Copyright © 2009-2010 Université Bordeaux
# Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved.
# Copyright © 2011 Oracle and/or its affiliates. All rights reserved.
Expand Down Expand Up @@ -30,7 +30,6 @@ include_hwloc_HEADERS = \
hwloc/nvml.h \
hwloc/plugins.h \
hwloc/gl.h \
hwloc/intel-mic.h \
hwloc/rename.h \
hwloc/deprecated.h
include_hwloc_autogendir = $(includedir)/hwloc/autogen
Expand Down

0 comments on commit 05a5055

Please sign in to comment.