mirror of https://github.com/BOINC/boinc.git
73 lines
2.3 KiB
HTML
73 lines
2.3 KiB
HTML
<title>Generating work</title>
|
|
<body bgcolor=ffffff>
|
|
<h2>Generating work</h2>
|
|
<p>
|
|
Workunits and results can be created using either a utility program
|
|
or a C++ function.
|
|
<p>
|
|
The utility program is
|
|
<pre>
|
|
create_work
|
|
-appname name // application name
|
|
-wu_name name // workunit name
|
|
-wu_template filename // WU template filename
|
|
-result_template filename // result template filename
|
|
-nresults n // # of results to create
|
|
-db_name x // database name
|
|
-db_passwd x // database password
|
|
-upload_url x // URL for output file upload
|
|
-download_url x // base URL for input file download
|
|
-download_dir x // where to move input files
|
|
-rsc_fpops x // est. # floating-point ops
|
|
-rsc_iops x // est. # integer ops
|
|
-rsc_memory x // est. RAM working set size, bytes
|
|
-rsc_disk x // est. disk space required
|
|
-keyfile x // path of upload private key
|
|
-delay_bound x // delay bound for result completion
|
|
infile_1 ... infile_m // input files
|
|
</pre>
|
|
<p>
|
|
The workunit template file is macro-substituted as follows:
|
|
<ul>
|
|
<li>
|
|
<INFILE_n/> is replaced with the name of the nth input
|
|
file.
|
|
<li>
|
|
<MD5_n/> is replaced with the MD5 checksum of the nth
|
|
input file.
|
|
<li>
|
|
<DOWNLOAD_URL/> is replaced with the download URL.
|
|
</ul>
|
|
<p>
|
|
The result file template is macro-substituted as follows:
|
|
<ul>
|
|
<li>
|
|
<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, ...).
|
|
<li>
|
|
<UPLOAD_URL> is replaced with the upload URL.
|
|
</ul>
|
|
<p>
|
|
<hr>
|
|
<p>
|
|
The C++ library (backend_lib.C,h) provides the function:
|
|
<pre>
|
|
int create_work(
|
|
WORKUNIT&,
|
|
char* wu_template,
|
|
char* result_template_filename,
|
|
int nresults,
|
|
char* infile_dir,
|
|
char** infiles,
|
|
int ninfiles
|
|
R_RSA_PRIVATE_KEY& key,
|
|
char* upload_url,
|
|
char* download_url
|
|
);
|
|
</pre>
|
|
<p>
|
|
This 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.
|