machine_list#

A module used to provide abstract machine objects for queue system interfaces.

This module provides two objects that help with interfacing Python scripts with job scheduler environments:

Machine#

This is used to represent a single machine allocated by the queue system and query details about it.

MachineList#

This is used to load and query a queue system machine file. Instances of this object hold a collection of Machine objects that are initialized when the machine file is loaded.

Classes:

Machine(hostName, numberOfCores[, ...])

Provides an interface for a single machine allocated by a queue system.

MachineList([machinesIn])

Provides an interface to list of machines allocated by a queue system.

class ansys.fluent.core.scheduler.machine_list.Machine(hostName, numberOfCores, queueName=None, coreList=None)#

Bases: object

Provides an interface for a single machine allocated by a queue system.

Methods:

__init__(hostName, numberOfCores[, ...])

Constructs a machine from the information provided.

Attributes:

core_list

Returns a list of core IDs allocated on the machine.

host_name

Returns the hostname listed in the machine file.

number_of_cores

Returns the number of cores allocated on the machine.

queue_name

Returns the name of the queue the machine is allocated in.

__init__(hostName, numberOfCores, queueName=None, coreList=None)#

Constructs a machine from the information provided.

Parameters:
hostNamestr

Host name of the machine

numberOfCoresint

The number of cores allocated on the machine

queueNamestr

Optionally specifies the queue the machine is executing in.

coreListlist[int]

Optionally provides the list of allocated core IDs.

property core_list#

Returns a list of core IDs allocated on the machine.

property host_name#

Returns the hostname listed in the machine file.

property number_of_cores#

Returns the number of cores allocated on the machine.

property queue_name#

Returns the name of the queue the machine is allocated in.

class ansys.fluent.core.scheduler.machine_list.MachineList(machinesIn=[])#

Bases: object

Provides an interface to list of machines allocated by a queue system.

Methods:

__init__([machinesIn])

Constructs and initializes an empty machine file object.

add(m)

Add to machine list.

move_local_host_to_front()

Moves the local host machine to the front of the machine list, creating it if it does not exist.

remove(m)

Remove from machine list.

remove_empty_machines()

Removes all machines with 0 cores.

reset()

Resets the machine file data to the initial values.

sort_by_core_count()

Sorts the machines by core count, reordering the existing data.

sort_by_core_count_ascending()

Sorts the machines by core count, reordering the existing data.

Attributes:

machines

Returns the entire list of machines.

max_cores

Returns the maximum number of cores.

min_cores

Returns the minimum number of cores.

num_machines

Returns the total number of machines.

number_of_cores

Returns the total number of cores.

__init__(machinesIn=[])#

Constructs and initializes an empty machine file object.

add(m)#

Add to machine list.

property machines#

Returns the entire list of machines.

property max_cores#

Returns the maximum number of cores.

property min_cores#

Returns the minimum number of cores.

move_local_host_to_front()#

Moves the local host machine to the front of the machine list, creating it if it does not exist.

property num_machines#

Returns the total number of machines.

property number_of_cores#

Returns the total number of cores.

remove(m)#

Remove from machine list.

remove_empty_machines()#

Removes all machines with 0 cores.

reset()#

Resets the machine file data to the initial values.

sort_by_core_count()#

Sorts the machines by core count, reordering the existing data.

sort_by_core_count_ascending()#

Sorts the machines by core count, reordering the existing data.