Workunits and results are described by template files, with placeholders for their input and output files.

Workunit template files

A WU template file has the form

",htmlspecialchars("

    0
    [ , other attributes]

[ ... ]

    
        0
        NAME
    
    [ ... ]
    [ -flags xyz ]
    [ x ]
    [ x ]
    [ x ]
    [ x ]
    [ x ]
    [ x ]
    [ x ]
    [ x ]
    [ x ]
    [ x ]

"), "
The components are: "; list_start(); list_item(htmlspecialchars(", "), "Each pair describes an input file"); list_item(htmlspecialchars(""), "The command-line arguments to be passed to the main program."); list_item("Other elements", "Work unit attributes" ); list_end(); echo" When a workunit is created, the template file is processed as follows:
  • Within a <file_info> element, <number>x</number> identifies the order of the file. It is replaced with elements giving the filename, download URL, MD5 checksum, and size.
  • Within a <file_ref> element, <file_number>x</file_number> is replaced with an element giving the filename.

Result template files

A result template file has the form

", htmlspecialchars("

    
    
    
    32768
    


    
        
        result.sah
    

"), "

The result file template is macro-substituted as follows:

  • <OUTFILE_n> is replaced with a string of the form 'wuname_resultnum_n' where wuname is the workunit name and resultnum is the ordinal number of the result (0, 1, ...).
  • <UPLOAD_URL> is replaced with the upload URL.

Command-line interface

The utility program is

create_work
    -appname name                       // application name
    -wu_name name                       // workunit name
    -wu_template filename               // WU template filename
                                        // relative to project root
    -result_template filename           // result template filename
                                        // relative to project root
    [ -config_dir path ]                // where 'config.xml' is;
                                        // default = '.'
    [ -batch n ]
    [ -priority n ]

    // The following are normally supplied in the WU template:
    [ -rsc_fpops_est x ]
    [ -rsc_fpops_bound x ]
    [ -rsc_memory_bound x ]
    [ -rsc_disk_bound x ]
    [ -delay_bound x ]
    [ -min_quorum x ]
    [ -target_nresults x ]
    [ -max_error_results x ]
    [ -max_total_results x ]
    [ -max_success_results x ]

    infile_1 ... infile_m           // input files
The workunit parameters are documented
here. If the -config_dir option is not used, the program must be run in the project root directory; it looks for config.xml there, and uses its contents.

C++ function interface

The C++ library (crypt.C, backend_lib.C,h) provides the functions:

int read_key_file(char* path, R_RSA_PRIVATE_KEY& key);

int create_work(
    DB_WORKUNIT&,
    const char* wu_template,                  // contents, not path
    const char* result_template_filename,     // relative to project root
    const char* result_template_filepath,    // absolute,
        // or relative to current dir
    const char* infile_dir,                   // where input files are
    const char** infiles,                     // array of input file names
    int ninfiles
    R_RSA_PRIVATE_KEY& key,             // upload authentication key
    SCHED_CONFIG&
);

read_key_file() reads a private key from a file. Use this to read the file upload authentication key.

create_work() creates a workunit and one or more results. The arguments are similar to those of the utility program; some of the information is passed in the WORKUNIT structure, namely the following fields:

name
appid
batch
rsc_fpops
rsc_iops
rsc_memory
rsc_disk
delay_bound
All other fields should be zeroed.

Make_work

The daemon program

make_work -wu_name name -cushion N
can be used to create an endless supply of work. It will create copies of the given work unit as needed to maintain a supply of at least N unsent results. "; page_tail(); ?>