netdetect

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDeviceAlias

func GetDeviceAlias(device string) (string, error)

GetDeviceAlias is a wrapper for getDeviceAliasWithSystemList. This interface specifies an empty additionalSystemDevices list which allows for the default behavior we want for normal use. Test functions can call getDeviceAliasWithSystemList() directly and specify an arbitrary additionalSystemDevice list as necessary.

func GetDeviceNames

func GetDeviceNames() ([]string, error)

GetDeviceNames examines the network interfaces and returns a []string identifying them by name

func GetSupportedProviders

func GetSupportedProviders() []string

GetSupportedProviders returns a []string containing all supported Mercury providers

func SetLogger

func SetLogger(l logger)

SetLogger sets the package-level logger

func ValidateNUMAConfig

func ValidateNUMAConfig(device string, numaNode uint) error

ValidateNUMAConfig confirms that the given network device matches the NUMA ID given.

func ValidateNUMAStub

func ValidateNUMAStub(device string, numaNode uint) error

ValidateNUMAStub is used for most unit testing to replace ValidateNUMAConfig because the network configuration validation depends upon physical hardware resources and configuration on the target machine that are either not known or static in the test environment

func ValidateProviderConfig

func ValidateProviderConfig(device string, provider string) error

ValidateProviderConfig confirms that the given network device supports the chosen provider

func ValidateProviderStub

func ValidateProviderStub(device string, provider string) error

ValidateProviderStub is used for most unit testing to replace ValidateProviderConfig because the network configuration validation depends upon physical hardware resources and configuration on the target machine that are either not known or static in the test environment

Types

type DeviceAffinity

type DeviceAffinity struct {
	DeviceName string
	CPUSet     string
	NodeSet    string
	NUMANode   uint
}

DeviceAffinity describes the essential details of a device and its NUMA affinity

func GetAffinityForDevice

func GetAffinityForDevice(deviceScanCfg DeviceScan) (DeviceAffinity, error)

GetAffinityForDevice searches the system topology reported by hwloc for the device specified by netDeviceName and returns the corresponding name, cpuset, nodeset, and NUMA node ID information.

Call initDeviceScan() to initialize the hwloc library and then set the deviceScanCfg.targetDevice to a network device name prior to calling this function.

The input deviceScanCfg netDeviceName string specifies a network device to search for. Typical network device names are "eth0", "eth1", "ib0", etc. The name may also be a virtual network device name such as "hfi1_0" or a decorated virtual network device name such as "hfi1_0-dgram". These virtual network devices are valid hwloc device names, and are used by libfabric, but they are not valid network device names for libraries such as CART. CART requires one of the system device names. Therefore, virtual device names are converted to system device names when it can be determined.

The DeviceAffinity NUMANode describes the logical NUMA node that this device is closest to. Note that, if administrator cgroup settings exclude any NUMA Node resources that cover the particular network device, then the NUMA node ID may be inaccurate.

func GetAffinityForNetworkDevices

func GetAffinityForNetworkDevices(deviceNames []string) ([]DeviceAffinity, error)

GetAffinityForNetworkDevices searches the system topology reported by hwloc for the devices specified by deviceNames and returns the corresponding name, cpuset, nodeset and NUMA node information for each device it finds.

The input deviceNames []string specifies names of each network device to search for. Typical network device names are "eth0", "eth1", "ib0", etc.

The DeviceAffinity DeviceName matches the deviceNames strings and should be used to help match an input device with the output.

Network device names that are not found in the topology are ignored. The order of network devices in the return string depends on the natural order in the system topology and does not depend on the order specified by the input string.

func (*DeviceAffinity) String

func (da *DeviceAffinity) String() string

type DeviceScan

type DeviceScan struct {
	// contains filtered or unexported fields
}

DeviceScan caches initialization data for later hwloc usage

type FabricScan

type FabricScan struct {
	Provider   string
	DeviceName string
	NUMANode   uint
	Priority   int
}

FabricScan data encapsulates the results of the fabric scanning

func ScanFabric

func ScanFabric(provider string) ([]FabricScan, error)

ScanFabric examines libfabric data to find the network devices that support the given fabric provider.

func (FabricScan) String

func (fs FabricScan) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL