dragon.native.machine

The Dragon native machine interface provides hardware related functionality.

These calls return various hardware properties of the system(s), like the number of processors or a list of all nodes.

Functions

cpu_count()

Return the number of CPUs in this system.

current()

Return a node object for this process.

Classes

Node

System

cpu_count() int

Return the number of CPUs in this system.

Returns:

integer representing the number of cpus

class Node

Bases: object

__init__(ident: str)

A class abstracting the current hardware node.

Parameters:

ident (str or int) – name or h_uid of the node to request.

property name: str

Return the Dragon name of this node. Use Node.hostname for the hostname.

Returns:

The name of the node

Return type:

str

property h_uid: int

The unique global identifier of this node.

Returns:

the h_uid

Return type:

in

property ip: str

Return the IPv4 address of this node

Returns:

The addres

Return type:

str

property num_cpus: int

Return the number of CPUs of this node.

Returns:

The number of CPUs

Return type:

int

property num_gpus: int

Return a the number of GPUs on this node

Returns:

The number of GPUs

Return type:

list[int]

property physical_mem: int

Return the physical memory of this node.

Returns:

Physical memory in bytes

Return type:

int

property gpus: list[int]

Return a list of GPU visible devices on this node

Returns:

list of GPU visible devices

Return type:

list[int]

property gpu_vendor: str

Return the name of the GPU Vendor on this node

Returns:

GPU vendor name

Return type:

str

property cpus: list[int]

Return the CPUs available on this node

Returns:

list of CPUs

Return type:

list[int]

property hostname: str

Host name of the node in the network.

This is not the Dragon internal name (Node.name) for this node.

Returns:

The hostname

Return type:

str

current() Node

Return a node object for this process.

Returns:

Node object

Return type:

Node

class System

Bases: object

__init__()

A stub of a system abstraction

property nodes
property nnodes: int