LPD-EPFL / mctop

MCTOP: A Multi-Core Topology Abstraction
http://lpd.epfl.ch/site/mctop
MIT License
7 stars 2 forks source link

mctop

multi-core topology tool

Compilation

Invoke make. libnuma is required.

make install (requires root priviledges) installs the library and the description of the machine in /usr/... under Linux.

Usage

Using mctop to harvest the topology of a machine

mctop is used to infer the topology of the machine. Invoke mctop -h for details on the parameters that mctop accepts. By default, mctop stores the topology of the machine in a .mct file, so that applications can later use it.

To load and plot a graph you can use the ./scripts/load_and_plot.sh script. If you do not pass any parameters, then it plots topology of the current machine. Otherwise, you can pass the hostname of the target machine (the corresponding mct file should exist in the desc folder). This script accepts a second parameter to fix the maximum latency level that you want to print as a direct cross-socket link. For instance, on a 4-socket processor, you might have the following direct links (0,1), (0,2), (1,3), (2,3). In this case, 0 with 3 and 1 with 2 communicate over 2 hops, thus you might want to not represent those links on the graph.

Using libmctop in your application

To use the mctop library for scheduling threads (libmctop.a), you can simply include mctop.h in your software and link with -lmctop.

The data structures

In mctop.h you can find the data structures that describe the topology of a machine. The main data structures are:

Querying the topology / Thread and memory placement

Inside the header file you will find the API for querying the topology (see topo getters, socket getters, and below), as well as the API for running on specific nodes/sockets (see MCTOP Scheduling). Inuding the mctop_alloc.h will enable you to use the policies we have created on top of mctop (see mctop_alloc_policy), as well as various functions for pininng threads (see mctop_alloc_pin), getting the core/context that the current thread is running on (see mctop_alloc_thread_id/mctop_alloc_tread_incore_id), as well as the merge tree we used in mctop_sort (see Node merge tree).

Examples and applications

For examples on how to use the API, look at run_on_node0.c, sort.c and node_tree.c.

DVFS

Note that DVFS is the worst enemy of mctop. In case mctop fails to infer the topology of a processor, even after tuning its parameters, you can try disabling DVFS from the BIOS settings of the processor.