Overview

SystemML has the concept of Sets on the input and output interfaces of a Process, allowing inputs and outputs to be grouped semantically. One set (the Default Set) always exists on each interface (input and output); it is this set that the template Process uses for its input and output port (implicitly, see the overloaded calls on SystemMLInterface). You can add more Sets if your Process needs them, but if you're not sure if you need Sets, you probably don't.

Adding Sets

Additional sets, above and beyond the Default Set, are created for you by the framework whilst creating your Process, based on the specification given in the node.xml file. A process always has the same Sets, regardless of whether it is using them or not. This is because the Sets are part of the SystemML specification of the Process, which is immutable.

SystemML Syntax

Systems, Processes, Sets and Ports are referred to in SystemML documents using their SystemML Absolute Identifier. Full details of the SystemML Identifier syntax are available in the SystemML Documentation (at SystemML Systems), but we will run over parts of it below quickly, for convenience.

A process is written, simply, process, where "process" is its SystemML Name. We can then refer to an output set on that process as process>>set (or an input set as process<<set). To refer to a port on that output set, we use process>>set>port (or an input port as process<<set<port).

The default set has the SystemML Name "", that is, the empty string. Therefore, to refer to a port on the default set of this process, we would use the identifier process>>>port (two chevrons, empty set name, one chevron, making three chevrons). For the default set only, we can abbreviate by leaving out the set specification, and use the identifier process>port, which is the form of identifier you will have come across already. It is only, thus, when using Sets that you will see these more complex SystemML Identifiers.

Example

This node.xml file specifies some additional input and output sets. Any part of the specification can be left out (<InputSets> or <OutputSets> can be left out, or the whole <Specification> tag can be left out).

XML File or Snippet
<?xml version="1.0" encoding="UTF-8"?> <!-- This is a standard process node descriptor file --> <Node> <Type>Process</Type> <Specification> <Connectivity> <InputSets> <Set>double</Set> <Set>round</Set> <Set>invert</Set> </InputSets> <OutputSets> <Set>double</Set> <Set>round</Set> <Set>invert</Set> </OutputSets> </Connectivity> </Specification> </Node>

Example

This example uses the 1199 interface to interact with Sets.

Warnings
  • This example uses a deprecated inteface - I need to rewrite it. To see how to use sets, see the interface defined in data.h for the relevant data object.
C++ Source Code (against 1199)
case EVENT_STATE_SET: { ... // get a handle to the default input set Symbol hDefaultInputSet = iif.getDefaultSet(); // get a handle to an additional input set Symbol hAnotherInputSet = iif.addSet("myInputSet"); // the following two calls do exactly the same thing, // accessing a port called "myProcess>myInputPort" (on // the Default Set) Symbol hPort1 = iif.getPort("myInputPort"); Symbol hPort2 = iif.getPort(hDefaultInputSet, "myInputPort"); if (hPort1 != hPort2) berr << E_INTERNAL; // but this call access a port on the new input set, // called "myProcess>>myInputSet>myInputPort" Symbol hPort3 = iif.getPort(hAnotherInputSet, "myInputPort"); if (hPort3 == hPort1) berr << E_INTERNAL; ... // accessing an output set is similar Symbol hAnotherOutputSet = oif.addSet("myOutputSet"); ... }