API Documentation

ClustervizConfig

This class reads in and stores all config data needed to visualize the clusters load or job status

class pbsclusterviz.clusterviz_config.ClustervizConfig

Class to hold configuration data for the cluster visualisation

find_config_files()

Determines configuration file locations as well as base configuration directory and sets the relevant values in the ClustervizConfig object

Configuration files: nodes, clusterviz.conf

get_config_file()
Returns the current config filename
get_config_parser()
Returns the configuration parser object
get_display_mode()
Returns the current display mode setting
get_log_file()
Returns the current log filename
get_nodes_file()
Returns the filename of the current nodes file
get_output_file(display_mode)
Returns the output file name depending upon the display mode
get_window_height()
Returns the currently configured render window height
get_window_width()
Returns the currently configured render window width
get_xml_file()
Returns the name of the pbsnodes xml file
is_interactive()
Returns true if interactive mode is set
is_syscalling()
Return true if a system call should be used for every update
is_updating()
Return true when the display is updating
read_config()
Reads the configuration file for pbsclusterviz and stores configuration information in the config object
set_config_file(fname)

Sets the config file to the given filename

Parameter:fname (string) – filename of the config file
set_display_mode(display_mode)

Sets the display mode to the given value

Parameter:display_mode (string) – the display mode; either ‘job’ or ‘load’
set_interactive_mode(mode)

Sets interactive mode on or off

Parameter:mode (boolean) – mode for interactive display (either True or False)
set_log_file(fname)

Sets the log file to the given filename

Parameter:fname (string) – filename of the log file
set_nodes_file(fname)

Sets the nodes file to the given filename

Parameter:fname (string) – filename of the nodes file
set_output_file(fname)

Sets the output file to the given filename

Parameter:fname (string) – filename of the output image file
set_syscalling(syscalling)
Set the syscalling flag
set_updating(updating)
Set the updating flag
set_xml_file(fname)

Sets the name of the pbsnodes xml file to the given filename

Parameter:fname (string) – pbsnodes xml filename

Node

File containing the Node class

class pbsclusterviz.node.Node(text_log)

The Node class. Every node contains information about its name, capabilities, status and position in the grid. This information can be updated and visualized.

flat()
Utility function to help restore coplanarity of node boxes in display
get_balloon_text()
Generate and return the text used in the node’s balloon
get_box_actor()
Returns the actor (for display) of a box
get_grey_square()
Creates and returns a grey square in order to denote “down” nodes
get_grid_location()
Return the node’s x,y position in the grid
get_load_avg()
Return a node’s load average
get_name()
Return the name of the node
get_num_processors()
Return the number of processors in the given node
init_box()
Routine to create an actor, which visualizes the load or the job status.
init_label()
Initialises the label for a box
set_grid_location(x_pos, y_pos)
Set the node’s x,y position in the grid
set_name(node_name)
Set the name of the node
update_box(display_mode, node_grid_display)
Updates the box describing the load/job status of a node
update_label()
Updates the label of a box

NodeGrid

File containing the NodeGrid class

class pbsclusterviz.node_grid.NodeGrid(text_log)

The NodeGrid class

add_new_node(node_name)
Creates an empty Node object with the given name and adds it to the node list
flatten()
Restore coplanarity after modifying box height
get_job_utilisation()
Return the system utilisation in the job display mode
get_load_utilisation()
Return the system utilisation in the load display mode
get_node_by_name(name)
Returns an instance of Node with the name ‘name’ if it is in the list
get_node_list()
Return the list of nodes currently in the node grid
init_balloons()
Initialise the balloon widget with text for each node and return the balloon widget
init_boxes()
Initialises each box in the node list and returns the box list
init_labels()
Initialises all box labels for nodes in the node list and returns the label list
read_nodes_file(nodes_file, text_log)
Read the nodes file and populate the node grid with Node objects
update(xml_file, display_mode, node_grid_display)

The main update routine for the visualization

Parameters:
  • xml_file (string) – filename of the output of pbsnodes -x
  • display_mode (string) – specifies what to visualize (load or job)

NodeGridDisplay

The NodeGridDisplay class

Controls various display aspects of a node grid

class pbsclusterviz.node_grid_display.NodeGridDisplay

The NodeGridDisplay class

get_default_text_prop()
Sets up and returns the default text properties for text display
get_lookup_table(display_mode)
Sets up and returns the lookup table depending upon the display mode
get_scalar_bar()
Return the scalar bar object
get_scalar_bar_title(display_mode)
Returns the scalar bar’s title dependent upon the display mode
get_title_actor()
Return the actor containing the title text
get_title_text(clusterviz_config)
Returns the title text depending upon display mode
get_utilisation_actor()
Return the actor holding the utilisation text
get_utilisation_text(display_mode, node_grid)
Return the utilisation text depending upon display mode
save_render_window(render_window, clusterviz_config, display_mode)
Save the current render window to file
set_scalar_bar(display_mode)
Sets up the scalar bar display actor
set_title_actor(clusterviz_config)
Sets up and returns the display actor for the title text
set_utilisation_actor(display_mode, node_grid)
Sets up and returns the display actor for the utilisation text

NodeGridXMLHandler

The handler for the output of pbsnodes -x. The parsed file is in XML-Format.

class pbsclusterviz.node_grid_xml_handler.NodeGridXMLHandler(node_grid)

The XML handler class for processing pbsnodes XML output

characters(content)

Process the characters in the XML data

Parameter:content (string) – the current character(s) (i.e. content) to be processed
endElement(name)

Method to call at the end of an XML element

Parameter:name (string) – the element name
save_node_data(property_dict)
Collects the data in the property dictionary and stores it in the node
startElement(name, attrs)

Method to call at the beginning of an XML element

Parameters:
  • name (string) – the element name
  • attrs (string) – the attribute name

TextLog

An object of this class stores various messages from other modules and shows them according to configuration.

class pbsclusterviz.text_log.TextLog(clusterviz_config)

Holds data and functions for the text log.

add_to_log(log_message)
Takes all messages from other modules and decides which timestamp to show. :param log_message: new message to add :type fname: string
get_log_actor()
Provides the log actor for the main program to display. Be aware that this might not be the latest version.
get_log_txt()
This function returnes a well formatted text log as one string.
synch()
Refreshes the vtk actor with latest text output.

Table Of Contents

Previous topic

Development

This Page