docs:rtlib:advancedrecipes

In this tutorial, we will transform the results from the previous study into a recipe.

  1. One CPU: <t=1, A=5, B=1, CPUQuota=~100%>
  2. Two CPUs: <t=2, A=5, B=1, CPUQuota=~194%>
  3. Three CPUs: <t=3, A=3, B=1, CPUQuota=~272%>, <t=3, A=4, B=1, CPUQuota=~288%>
  4. Four CPUs: <t=8, A=3, B=1, CPUQuota=~393%>, <t=7, A=3, B=1, CPUQuota=~370%>
  5. Five CPUs: <t=8, A=4, B=1, CPUQuota=~424%>, <t=8, A=5, B=1, CPUQuota=~412%>

You could write a script to create the recipe. However, a from scratch solution will do for an eight-AWMs recipe.

Advanced recipe creation

Let us see some advanced recipe xml sections.

Parameters

This section comprehends all the parameters. The parameters can be accessed by the application during runtime, to configure the application each time the AWM is changed. You can define custom parameters. In this case, we have threads, parameter-A and parameter-B.

<!-- in each AWM>
<parameters>
     <parameter name="threads" value="1"/>
     <parameter name="param-a" value="1"/>
     <parameter name="param-b" value="5"/>
</parameters>

System Metrics

This section is not really needed in this tutorial. Just for fun, we will insert the mSPJ metric (milliseconds per job) associated with the AWM. We profiled the application computing 200 jobs and we have the execution time values, so it is not difficult to compute the mSPJ.

<!-- in each AWM>
<system_metrics>
     <system_metric name="mspj" value="150"/>
</system_metrics>

At the time being, if you insert parameters into a recipe, you also need to insert metrics. That's related to the parsing of the recipe. If you don't need metrics, just insert dummy ones like in this example.

Filling the recipe

You already know the recipe structure from a previous tutorial that surely you have already read. Once filled with all the information, the recipe looks like this:

  • We don't perform memory usage limitation in this tutorial. Thus, each AWM will have, say, 200MB at its disposal. Surely the application will need far less than that.
  • Metrics and parameters are saved as strings. Thus, in the application code you must cast the entries into integer, float or whatever you need.
  • Save the recipe in the contrib/user/BbqTutorials/recipes, replacing the template recipe you already have there. Then rebuild the application.

<?xml version="1.0"?>
<BarbequeRTRM recipe_version="0.8">
    <application priority="1">
        <platform id="org.linux.cgroup">
            <awms>
                <awm id="0" name="BbqTutorial" value="49">
                    <resources>
                        <cpu>
                            <pe qty="100"/>
                            <mem units="Mb" qty="200"/>
                        </cpu>
                    </resources>
                    <parameters>
                        <parameter name="threads" value="1"/>
                        <parameter name="param-a" value="5"/>
                        <parameter name="param-b" value="1"/>
                    </parameters>
                    <system_metrics>
                        <system_metric name="mspj" value="9"/>
                    </system_metrics>
                </awm>
                <awm id="1" name="BbqTutorial" value="57">
                    <resources>
                        <cpu>
                            <pe qty="194"/>
                            <mem units="Mb" qty="200"/>
                        </cpu>
                    </resources>
                    <parameters>
                        <parameter name="threads" value="2"/>
                        <parameter name="param-a" value="5"/>
                        <parameter name="param-b" value="1"/>
                    </parameters>
                    <system_metrics>
                        <system_metric name="mspj" value="5"/>
                    </system_metrics>
                </awm>
                <awm id="2" name="BbqTutorial" value="73">
                    <resources>
                        <cpu>
                            <pe qty="272"/>
                            <mem units="Mb" qty="200"/>
                        </cpu>
                    </resources>
                    <parameters>
                        <parameter name="threads" value="3"/>
                        <parameter name="param-a" value="3"/>
                        <parameter name="param-b" value="1"/>
                    </parameters>
                    <system_metrics>
                        <system_metric name="mspj" value="3"/>
                    </system_metrics>
                </awm>
                <awm id="3" name="BbqTutorial" value="71">
                    <resources>
                        <cpu>
                            <pe qty="288"/>
                            <mem units="Mb" qty="200"/>
                        </cpu>
                    </resources>
                    <parameters>
                        <parameter name="threads" value="3"/>
                        <parameter name="param-a" value="4"/>
                        <parameter name="param-b" value="1"/>
                    </parameters>
                    <system_metrics>
                        <system_metric name="mspj" value="3"/>
                    </system_metrics>
                </awm>
                <awm id="4" name="BbqTutorial" value="72">
                    <resources>
                        <cpu>
                            <pe qty="393"/>
                            <mem units="Mb" qty="200"/>
                        </cpu>
                    </resources>
                    <parameters>
                        <parameter name="threads" value="8"/>
                        <parameter name="param-a" value="3"/>
                        <parameter name="param-b" value="1"/>
                    </parameters>
                    <system_metrics>
                        <system_metric name="mspj" value="3"/>
                    </system_metrics>
                </awm>
                <awm id="5" name="BbqTutorial" value="65">
                    <resources>
                        <cpu>
                            <pe qty="370"/>
                            <mem units="Mb" qty="200"/>
                        </cpu>
                    </resources>
                    <parameters>
                        <parameter name="threads" value="7"/>
                        <parameter name="param-a" value="3"/>
                        <parameter name="param-b" value="1"/>
                    </parameters>
                    <system_metrics>
                        <system_metric name="mspj" value="3"/>
                    </system_metrics>
                </awm>
                <awm id="6" name="BbqTutorial" value="72">
                    <resources>
                        <cpu>
                            <pe qty="424"/>
                            <mem units="Mb" qty="200"/>
                        </cpu>
                    </resources>
                    <parameters>
                        <parameter name="threads" value="8"/>
                        <parameter name="param-a" value="4"/>
                        <parameter name="param-b" value="1"/>
                    </parameters>
                    <system_metrics>
                        <system_metric name="mspj" value="3"/>
                    </system_metrics>
                </awm>
                <awm id="7" name="BbqTutorial" value="65">
                    <resources>
                        <cpu>
                            <pe qty="412"/>
                            <mem units="Mb" qty="200"/>
                        </cpu>
                    </resources>
                    <parameters>
                        <parameter name="threads" value="8"/>
                        <parameter name="param-a" value="5"/>
                        <parameter name="param-b" value="1"/>
                    </parameters>
                    <system_metrics>
                        <system_metric name="mspj" value="4"/>
                    </system_metrics>
                </awm>
            </awms>
        </platform>
    </application>
</BarbequeRTRM>
<!-- vim: set tabstop=4 filetype=xml : -->

You are ready for the last tutorial.

docs/rtlib/advancedrecipes.txt ยท Last modified: 2015/11/17 14:17 by slibutti

Page Tools