wiki:TorqueUsage/DataTypes/Attropl

Version 8 (modified by bas, 18 years ago) (diff)

--

Attropl data type

Attropl is a structure which is defined in pbs_ifl.h as:

struct attropl {
  struct attropl *next;
  char           *name;
  char           *resource;
  char           *value;
  enum batch_op   op;
  };

Python Usage

If a function requires this data type then use the following code:

# Values depend in which context we use it, eg for pbs_manager()
#
attropl = pbs.new_attropl(1)
attropl[0].name = 'properties'
attropl[0].value = 'gigabit'
attropl[0].op = pbs.INCR

This will add a node property gigabit

If some function the attropl.resource parameter is used to specify a resource in a group of resources, eg (pbs_submit):

attropl[0].name     = pbs.ATTR_l     # define in pbs_ifl.h ( "Resource_List" )
attropl[0].resource = 'neednodes'
attropl[0].value    = '10'

Note: That the next pointer definition is not used in the Python code. The module will automatically convert a C linked list to a Python list a vice versa

Attachments (1)

Download all attachments as: .zip