Ufo.TaskGraph

g GObject.Object GObject.Object Ufo.Graph Ufo.Graph GObject.Object->Ufo.Graph Ufo.TaskGraph Ufo.TaskGraph Ufo.Graph->Ufo.TaskGraph

Subclasses:

None

Methods

Inherited:

Ufo.Graph (19), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

error_quark ()

class

new ()

connect_nodes (n1, n2)

connect_nodes_full (n1, n2, input)

expand (resources, n_gpus)

fuse ()

get_json_data ()

get_partition (index, total)

is_alright ()

map (gpu_nodes)

read_from_data (manager, json)

read_from_file (manager, filename)

save_to_json (filename)

set_partition (index, total)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Ufo.Graph

r

Class Details

class Ufo.TaskGraph(**kwargs)
Bases:

Ufo.Graph

Abstract:

No

Structure:

Ufo.TaskGraphClass

Main object for organizing filters. The contents of the Ufo.TaskGraph structure are private and should only be accessed via the provided API.

classmethod error_quark()
Return type:

int

classmethod new()
Returns:

A Ufo.Graph that can be upcast to a Ufo.TaskGraph.

Return type:

Ufo.Graph

Create a new task graph without any nodes.

connect_nodes(n1, n2)
Parameters:

Connect n1 with n2 using n2's default input port. To specify any other port, use Ufo.TaskGraph.connect_nodes_full().

connect_nodes_full(n1, n2, input)
Parameters:

Connect n1 with n2 using n2's input port.

expand(resources, n_gpus)
Parameters:
Raises:

GLib.Error

Expands self in a way that most of the resources in self can be occupied. In the simple pipeline case, the longest possible GPU paths are duplicated as much as there are GPUs in arch_graph.

fuse()

Fuses task nodes to increase data locality.

Note: This is not implemented and a no-op right now.

get_json_data()
Raises:

GLib.Error

Returns:

A JSON string describing self

Return type:

str

Serialize self to a JSON string.

get_partition(index, total)
Parameters:
  • index (int) – Location to store index

  • total (int) – Location to store the total number of partitions

Get the partition structure of self.

is_alright()
Raises:

GLib.Error

Returns:

True if everything is alright, False else.

Return type:

bool

Check if nodes int the task graph are properly connected.

map(gpu_nodes)
Parameters:

gpu_nodes ([Ufo.GpuNode]) – List of Ufo.GpuNode objects

Map task nodes of self to the list of gpu_nodes.

read_from_data(manager, json)
Parameters:
Raises:

GLib.Error

Read a JSON configuration file to fill the structure of self.

read_from_file(manager, filename)
Parameters:
Raises:

GLib.Error

Read a JSON configuration file to fill the structure of self.

save_to_json(filename)
Parameters:

filename (str) – Path and filename to the JSON file

Raises:

GLib.Error

Save a JSON configuration file with the filter structure of self.

set_partition(index, total)
Parameters:
  • index (int) – index of total partitions - 1

  • total (int) – total number of partitions

Set the partition of this task graph.