Child pages
  • Developing Algorithms for the HTRC Framework

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Algorithm name
  • Short name for the algorithm (at most 8 characters in length)
  • Version
  • Brief text description
  • Authors
  • User input parameters, name, type, label, brief description
  • Name of the shell script wrapper
  • Name of the property file expected
  • Key-value pairs for each property to be written to the property file
    • Bash-style variables are used to refer to input parameters and system-provided values
  • Names and types of result files, and whether they are optional

An example algorithm XML file is provided below.

Code Block
titleExample of an algorithm XML file
 <algorithm>

  <info>
    <name>TestAlgorithm</name>
    <short_name>TestAlgo</short_name>
    <version>1.0</version>
    <description>TestAlgorithm performs ABC analysis and produces XYZ results.</description>
    <authors>
        <author name="Htrc Superuser"/>
    </authors>
    <supportUrl>http://help.me/please</supportUrl>
 
    <parameters>
        <param
            name="input_collection"
            type="collection"
            required="true"
            size_limit="3000"
			defaultValue="default_collection">
            <label>Please select a collection for analysis</label>
            <description>A collection argument example.</description>
        </param>
        <param
            name="n"
            type="integer"
            required="true"
			defaultValue="10">
            <label>Select a number</label>
            <description>An example of a non-collection argument.</description>
        </param>
    </parameters>
  </info> 

  <!-- walltime should have the form hhh:mm:ss or hh:mm:ss -->
  <execution_info>
    <input_size min="0" max="500">
      <number_of_nodes>1</number_of_nodes>
      <number_of_processors_per_node>8</number_of_processors_per_node>
      <walltime>03:00:00</walltime>
      <java_max_heap_size>10g</java_max_heap_size>
    </input_size>
    <input_size min="501" max="3000">
      <number_of_nodes>1</number_of_nodes>
      <number_of_processors_per_node>16</number_of_processors_per_node>
      <walltime>05:00:00</walltime>
      <java_max_heap_size>28g</java_max_heap_size>
    </input_size>
  </execution_info>

  <run_script>run_TestAlgorithm.sh</run_script>
  <properties_file_name>TestAlgorithm.properties</properties_file_name>

  <system_properties>
      <e key="volume_id">$input_collection</e>
      <e key="num">$n</e>
      <e key="max_volumes">2000</e>
      <e key="token">$auth_token</e>
      <e key="data_api_url">$data_api_url</e>
      <e key="output_folder">$output_dir</e>
  </system_properties>

  <results>
      <result type="text/html" name="output.html"/>
      <!-- if the "optional" attribute is true, then the result may or may not be produced in a successful job run; "optional" name="output.html is false by default -->
      <result type="text/plain" name="volume_errors.txt" optional="true"/>
  </results>

</algorithm>

...

The <results> element describes all the result files produced by the algorithm. It also Each <result> element specifies the name and MIME type of each the result file. In addition, an "optional" attribute may also be specified. If "optional" is true, then the result may or may not be produced in a successful job run. "optional" is false by default. A value of false indicates that the result is produced in successful job runs.