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
Return the number of CPUs in this system. |
|
|
Return a node object for this process. |
Classes
System abstraction representing the collection of nodes in the Dragon runtime. |
- cpu_count() int[source]
Return the number of CPUs in this system.
- Returns:
integer representing the number of cpus
- class Node[source]
Bases:
object- property name: str
Return the Dragon name of this node. Use Node.hostname for the hostname.
- Returns:
The name of the node
- Return type:
- property num_cpus: int
Return the number of CPUs of this node.
- Returns:
The number of CPUs
- Return type:
- property physical_mem: int
Return the physical memory of this node.
- Returns:
Physical memory in bytes
- Return type:
- property gpu_vendor: str
Return the name of the GPU Vendor on this node
- Returns:
GPU vendor name
- Return type:
- property gpu_env_str: str
Return the environment variable used by GPU Vendor to define GPU affinity
- Returns:
GPU environment variable string
- Return type:
- current() Node[source]
Return a node object for this process.
current() can be imported from the top-level Dragon or
dragon.native.machinemodules.from dragon import current
or
from dragon.native.machine import current
- Returns:
Node object
- Return type:
- class System[source]
Bases:
objectSystem abstraction representing the collection of nodes in the Dragon runtime. Provides access to node information, primary node, and policies for CPU and GPU placement.
System can be imported from the top-level Dragon or
dragon.native.machinemodules.from dragon import System
or
from dragon.native.machine import System
- property nodes
- property restarted: bool
Helper function to check environment and determine if the runtime was previously restarted
- Returns:
true if the runtime was restarted
- Return type:
- hostname_policies() list[Policy][source]
Generate a list of policies that use all of the nodes in the allocation specified by hostname