HAL-related tutorials
This page is the temporary home of
HAL-related tutorials.
HAL WebUI Tutorial
HAL _WebUI"> Starting HAL WebUI
- Start HAL by running HAL_[version].jar (
java -jar HAL_[version].jar [-p #port(default 8080)]
)
- The WebUI is available from http://[machineaddress]:[port]/hal (e.g. http://localhost:8080/hal
)
Installation and Configuration
Defining a New Algorithm
HAL objects"> Saving and Loading HAL objects
Matlab Builder JA Quick Start
See attached user guide
Hello World
A "Hello World" example is described below. We will describe how to call the following Matlab function from Java.
function hello
% Hello world example
% hello.m
fprintf(1, 'Hello World\n');
Exporting JAR
- MCR must be installed and its directory added to the system's path variable.
- Create a new deployment project by entering
deploytool
into the Matlab command window.
- In the Deployment Tool window, create the necessary classes by clicking [Add Class]. For each class, add the matlab function (*.m) files that belong to the class by selecting [Add files].
- Create the Java Package by selecting the build button. This will create src and distrib folders containing your [project].jar file. The name of the jar file may be specified from Settings.
Calling code from Eclipse
- Add [project].jar and javabuilder.jar to the build path. The javabuilder.jar should be located in
/toolbox/javabuilder/jar/javabuilder.jar
inside your Matlab folder.
- Any code that calls code from these java classes must also import
com.mathworks.toolbox.javabuilder.*
.
- Call the function like a normal Java method from an instance of the class. Conversion between Java and Matlab types may be handled either automatically or explicitly (see next section).
Data Types and Conversion
Data conversion classes are available in the following hierarchy:
- MWArray
- MWNumericArray
- MWLogicalArray
- MWCharArray
- MWCellArray
- MWStructArray
Matlab Builder will perform conversion from native types automatically, and constructors can be used with Java types and arrays.
Pass by reference is available with the MWJavaObjectRef wrapper, a subclass of MWArray.
HAL quick start guide
version 1.0b4 Nov. 29, 2010
NOTE: this quite is very much a work-in-progress. If you have any isses that aren't covered here, or any other comments or questions, please contact us at
cnell@csDELETEthisTEXT.ubc.ca
Super quick start (linux only):
- download full HAL 1.0 zip distribution; install using below instructions.
- download sample experiment package; import using the HAL 1.0 interface
- try configuring, analysing the provided sample algorithm (SPEAR)
HAL"> Installing HAL
- download the full zip package
- extract the zip to a working directory
- double click the HAL_
.jar file OR type "java -jar HAL_.jar" to start the webserver
- navigate to http://<machine address>:8080/hal (e.g. http://127.0.0.1:8080/hal
) to get the UI
Basic configuration
- after first start of HAL, a file called HAL.json will be created. Basic configuration settings can be modified by editing this file
- RECOMMENDED: if you have a MySQL server, use it instead of the default SQLite database. To do so, edit the HAL.json file; change:
"database":"jdbc:sqlite:hal.db" to something like "database":"jdbc:mysql://@<mysql.server.url>:/hal_db"
Plugin installation
- to install a new HAL plugin, copy the plugin .jar file into the /plugins/ folder and restart HAL.
Defining an algorithm
To add a new algorithm for use in HAL, use the "Define a new algorithm" wizard:
Algorithm specification
- The name+version combination must be unique in the database.
- Supported instance tag sets are used to restrict which algorithms can be run on particular instances. A tag set such as {cnf, 3sat} marks the algorithm as compatible with any instance with both "cnf" and "3sat" tags. An algorithm can have multiple instance tag sets; at least one of them must be satisfied by an instance in order for it to be considered compatible. If no tags are specified, the HAL will assume the algorithm is compatible with all instances.
- Advanced properties: deterministic: stgraightforward; note that if your algorithm has a seed as an input, mark it as NOT determinsitic, and explicitly identify the seed parameter (below).
- Advanced properties: exportable: An algorithm is exportable if and only if HAL can compress the entire directory tree rooted at the executable file, exctract it on a different machine, and the algorithm will work on that second machine.
- Advanced properties: cutoff-independence: Set this to true if the algorithm's behaviour will not change if cutoff inputs are changed but all other inputs remain the same. HAL uses this property to decide whether it can infer cutoffs or completions from previously-performed runs.
- Executable: should be the first command to run the algorithm; if the algorithm is an interpreted script this might be "python" or "ruby". Note that this path must exist ON THE SYSTEM RUNNING HAL, not the system running the browser that is interfacing with HAL (if the two differ).
- Command-line argument string: see example. Note that all input variables (specified like $name$ in the command string) will need to be further defined in later steps.
(NOTE: HAL does not currently support generating input files for target algorithms.)
- Algorithm output specification. Format is the same as the command-line argument specification; and as in that case, all identified output variables will require further specification. HAL will use this string to parse outputs from the standard output and error streams of the algorithm during execution.
Identify configurable parameters:
- a configurable parameter is a parameter whose value may be tuned by a configurator to optimize performance; all "other" settings will be left unchanged
Specify configurable parameter domains
- for every input parameter marked as configurable, the domain of valid values must be specified.
- conditionalities between parameters can be specified, where conditionality refers to "activation" of parameters. For example, parameter X can be marked as active only if parameter Y takes some particular value.
- prohibited parameter configurations can similarly be specified.
3.4: as 3.3, for "other" input settings
3.5: as 3.3, for output variables
Instance set specification
To specify an instance set, use the Create New InstanceDistribution wizard:
- distirbution name must be unique
- tags are used to filter compatible algorithms (see 3.1 above)
- An instance is exportable if it is fully-defined by a single file
- The directory path must be valid on the system runnign HAL, not the system running the web browser
---
Experiment specification
- Metrics: PAR1 and PAR10 rely on HAL-measured CPU time; Reported PAR1 and PAR10 rely on algorithm-reported CPU time
Topic revision: r5 - 2011-01-11
- mavc