100 likes | 274 Views
d ds -topology. Andrey Lebedev, Anar Manafov GSI Darmstadt 25/04/2014. Elements of the topology. #### Task * A task is a single entity of the system. * A task can be an executable or a script. * A task is defined by a user with a set of props and rules.
E N D
dds-topology Andrey Lebedev, AnarManafov GSI Darmstadt 25/04/2014
Elements of the topology #### Task * A task is a single entity of the system. * A task can be an executable or a script. * A task is defined by a user with a set of props and rules. * Each task will have a dedicated DDS watchdog process. #### Collection * A set of tasks that have to be executed on the same physical computing node. #### Group * A container for tasks and collections. * Only main group can contain other groups. * Only group define multiplication factor for all its daughter elements.
<topology name="myTopology"> [... Definition of tasks, properties, and collections ...] <main name="main"> [... Definition of the topology itself, where also groups can be defined ...] </main> </topology>
MAIN TASK_1 COLLECTION_1 GROUP_1 N=10 TASK_1 TASK_2 TASK_5 TASK_6 TASK_5 TASK_3 TASK_4 COLLECTION_2 TASK_2 TASK_7
EXAMPLE 1 <topology name="my_PROOF_Topology"> <port name="srv_port"min="20000"max="22000"type="server"/> <port name="wn_port"min="20000"max="22000"type="client"/> <task name="server"exec="proof.exe"> <port name="wn_port"/> <port name="srv_port"/> </task> <task name="worker"exec="proof.exe"arg="-w"> <port name="wn_port"/> </task> <main name="proof_cluster"> <task name="server"/> <group name="group1"n="100"> <task name="worker"/> </group> </main> </topology>
EXAMPLE 2 <topology name="myTopology”> <port name="port1"min="20000"max="22000"type="server"/> <port name="port2"min="20000"max="22000"type="client"/> <task name="task1"exec="app1"> <port name="port1"/> </task> <task name="task2"exec="app2"> <port name="port1"/> <port name="port2"/> </task> <collection name="collection1"> <task name="task1"/> <task name="task2"/> <task name="task2"/> </collection> <main name="main"n="1"> <task name="task1"/> <collection name="collection1"/> <group name="group1"n="10"> <task name="task1"/> <collection name="collection1"/> </group> <group name="group2"n="15"> <task name="task2"/> <collection name="collection1"/> </group> </main> </topology>
Why XML? • Validation against XSD schema • xmllint– a command line XML tool • BOOST property_tree is used for XML parsing • No problem to use different input file format, especially if it is supported by PT: XML, INI, JSON, INFO
Implementation details TopoBase TopoElement TopoProperty Port Task TaskContainer TaskGroup TaskCollection
DDSTopology API DDSTopologytopology; topology.init("topology_test_1.xml"); //Get Main group from topology DDSTaskGroupPtr_t main = topology.getMainGroup(); //Get topology elements by index DDSTopoElementPtr_t element = topology.getTopoElementByIndex( DDSIndex(”main/group1/task2")); DDSGroup API main->getNofTasks(); //Number of tasks w/o N factor main->getTotalNofTasks(); //Number of tasks with N factor main->getName(); //Name main->getNofElements(); //Number of daughter elements main->getParent(); //Pointer to parent element main->getPath(); //Absolute path // Get daughter element DDSTopoElementPtr_t element1 = main->getElement(0); […]