MR-MPI WWW Site -MR-MPI Documentation - OINK Documentation - OINK Commands

2. OINK Commands

This section describes OINK input scripts and what commands are used to define an OINK calculation.

2.1 Input script operation
2.2 Parsing rules
2.3 Input script commands

2.1 Input script operation

OINK executes by reading commands from a input script (text file), one line at a time. When the input script ends, OINK exits. Each command causes OINK to take some action. It may set an internal variable, read in a file, or perform a MapReduce operation. Most commands have default settings, which means you only need to use the command if you wish to change the default.

Note that OINK does not read your entire input script and then perform a calculation with all the settings. Rather, the input script is read one line at a time and each command takes effect when it is read. Thus this sequence of commands:

set verbosity 1 
mr foo 

does something different than this sequence:

mr foo
set verbosity 1 

In the first case, the MR object created will have its verbosity set to 1. In the latter case it will have the default verbosity of 0, since the set command was not used until after the MR object was created.

Many input script errors are detected by OINK and an ERROR or WARNING message is printed. This section gives more information on what errors mean. The documentation for each command gives additional information.


2.2 Parsing rules

Each non-blank line in the input script is treated as a command. OINK commands are case sensitive. Pre-defined command names are lower-case, as are specified command arguments. Upper case letters may be used in file names or user-chosen ID strings.

Here is how each line in the input script is parsed by OINK:

(1) If the last printable character on the line is a "&" character (with no surrounding quotes), the command is assumed to continue on the next line. The next line is concatenated to the previous line by removing the "&" character and newline. This allows long commands to be continued across two or more lines.

(2) All characters from the first "#" character onward are treated as comment and discarded. See an exception in (6). Note that a comment after a trailing "&" character will prevent the command from continuing on the next line. Also note that for multi-line commands a single leading "#" will comment out the entire command.

(3) The line is searched repeatedly for $ characters, which indicate variables that are replaced with a text string. See an exception in (6). If the $ is followed by curly brackets, then the variable name is the text inside the curly brackets. If no curly brackets follow the $, then the variable name is the single character immediately following the $. Thus ${myTemp} and $x refer to variable names "myTemp" and "x". See the variable command for details of how strings are assigned to variables and how they are substituted for in input script commands.

(4) The line is broken into "words" separated by whitespace (tabs, spaces). Note that words can thus contain letters, digits, underscores, or punctuation characters.

(5) The first word is the command name. All successive words in the line are arguments.

(6) If you want text with spaces to be treated as a single argument, it can be enclosed in either double or single quotes. E.g.

print "Value = $t"
print 'Value = $t' 

The quotes are removed when the single argument is stored internally. See the if commands for examples. A "#" or "$" character that is between quotes will not be treated as a comment indicator in (2) or substituted for as a variable in (3).

IMPORTANT NOTE: If the argument is itself a command that requires a quoted argument (e.g. using a print command as part of an if command), then the double and single quotes can be nested in the usual manner. See the doc pages for those commands for examples. Only one of level of nesting is allowed, but that should be sufficient for most use cases.


2.3 Input script commands

There are 4 kinds of OINK commands:

(1) Set command to alter parameters:

(2) MR-MPI library commands:

(3) Named commands:

(4) Miscellaneous commands that are part of the scripting language:


Here is a list of all OINK input script commands alphabetically:

clearechoifincludeinputjump
labellogmrlibrary commandsnamed commandsnext
outputprintsetshellvariable

These are the named commands currently included in OINK. We will add to this list from time to time. If you write a useful new command, send it to us and we can include it in the distribution.

cc_findcc_stats
degreedegree_stats
degree_weightedge_upper
histoluby_find
neigh_trineighbor
rmatrmat2
ssspsssp2
tri_findvertex_extract
wordfreq

Here is a link to the MR-MPI library commands that can be invoked directly from an OINK input script:

MR-MPI library commands