2002-11-07 19:31:34 +00:00
|
|
|
<title>Generating work</title>
|
2002-08-20 23:54:17 +00:00
|
|
|
<body bgcolor=ffffff>
|
2002-11-07 19:31:34 +00:00
|
|
|
<h2>Generating work</h2>
|
2002-05-24 04:29:10 +00:00
|
|
|
<p>
|
2002-08-19 18:43:10 +00:00
|
|
|
Workunits and results can be created using either a utility program
|
2002-11-07 19:31:34 +00:00
|
|
|
or a C++ function.
|
2002-05-24 04:29:10 +00:00
|
|
|
<p>
|
2002-11-07 19:31:34 +00:00
|
|
|
The utility program is
|
2002-05-24 04:29:10 +00:00
|
|
|
<pre>
|
|
|
|
create_work
|
2002-11-07 19:31:34 +00:00
|
|
|
-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>
|
2002-05-24 04:29:10 +00:00
|
|
|
<p>
|
2002-11-07 19:31:34 +00:00
|
|
|
The workunit template file is macro-substituted as follows:
|
2002-05-24 04:29:10 +00:00
|
|
|
<ul>
|
2002-08-19 18:43:10 +00:00
|
|
|
<li>
|
2002-11-07 19:31:34 +00:00
|
|
|
<INFILE_n/> is replaced with the name of the nth input
|
2002-07-29 19:01:38 +00:00
|
|
|
file.
|
2002-08-19 18:43:10 +00:00
|
|
|
<li>
|
2002-11-07 19:31:34 +00:00
|
|
|
<MD5_n/> is replaced with the MD5 checksum of the nth
|
2002-07-29 19:01:38 +00:00
|
|
|
input file.
|
2002-08-19 18:43:10 +00:00
|
|
|
<li>
|
2002-11-07 19:31:34 +00:00
|
|
|
<DOWNLOAD_URL/> is replaced with the download URL.
|
2002-05-24 04:29:10 +00:00
|
|
|
</ul>
|
|
|
|
<p>
|
2002-11-07 19:31:34 +00:00
|
|
|
The result file template is macro-substituted as follows:
|
2002-05-24 04:29:10 +00:00
|
|
|
<ul>
|
2002-08-19 18:43:10 +00:00
|
|
|
<li>
|
2002-11-07 19:31:34 +00:00
|
|
|
<OUTFILE_n> is replaced with a string of the form
|
2002-07-29 19:01:38 +00:00
|
|
|
"wuname_resultnum_n" where wuname is the workunit name and resultnum is
|
|
|
|
the ordinal number of the result (0, 1, ...).
|
2002-08-19 18:43:10 +00:00
|
|
|
<li>
|
2002-11-07 19:31:34 +00:00
|
|
|
<UPLOAD_URL> is replaced with the upload URL.
|
2002-05-24 04:29:10 +00:00
|
|
|
</ul>
|
|
|
|
<p>
|
|
|
|
<hr>
|
|
|
|
<p>
|
2002-11-07 19:31:34 +00:00
|
|
|
The C++ library (backend_lib.C,h) provides the function:
|
2002-05-24 04:29:10 +00:00
|
|
|
<pre>
|
|
|
|
int create_work(
|
2002-11-07 19:31:34 +00:00
|
|
|
WORKUNIT&,
|
2002-05-24 04:29:10 +00:00
|
|
|
char* wu_template,
|
2002-11-07 19:31:34 +00:00
|
|
|
char* result_template_filename,
|
2002-05-24 04:29:10 +00:00
|
|
|
int nresults,
|
|
|
|
char* infile_dir,
|
|
|
|
char** infiles,
|
|
|
|
int ninfiles
|
2002-11-07 19:31:34 +00:00
|
|
|
R_RSA_PRIVATE_KEY& key,
|
|
|
|
char* upload_url,
|
|
|
|
char* download_url
|
2002-05-24 04:29:10 +00:00
|
|
|
);
|
2002-11-07 19:31:34 +00:00
|
|
|
</pre>
|
2002-05-24 04:29:10 +00:00
|
|
|
<p>
|
2002-08-19 18:43:10 +00:00
|
|
|
This creates a workunit and one or more results.
|
2002-11-07 19:31:34 +00:00
|
|
|
The arguments are similar to those of the utility program;
|
|
|
|
some of the information is passed in the WORKUNIT structure.
|