2006-06-19 01:27:33 +00:00
|
|
|
<?php
|
|
|
|
require_once("docutil.php");
|
|
|
|
page_head("Legacy applications");
|
|
|
|
echo "
|
2006-11-26 02:06:30 +00:00
|
|
|
A <b>legacy application</b> is one for which an executable is available,
|
2006-06-19 01:27:33 +00:00
|
|
|
but not the source code.
|
|
|
|
Therefore it cannot use the BOINC API and runtime system.
|
2006-11-26 02:06:30 +00:00
|
|
|
However, such applications can be run using BOINC.
|
|
|
|
Here's an example:
|
2006-06-19 01:27:33 +00:00
|
|
|
<ul>
|
2006-11-26 02:06:30 +00:00
|
|
|
<li>
|
|
|
|
Compile the program 'worker' from the
|
|
|
|
<a href=example.php>boinc_samples</a> tree,
|
|
|
|
producing (say) 'worker_5.10_windows_intelx86.exe'.
|
|
|
|
This is the legacy app.
|
|
|
|
If reads from stdin and writes to stdout;
|
|
|
|
it also opens and reads a file 'in',
|
|
|
|
and opens and writes a file 'out'.
|
|
|
|
It takes one command-line argument:
|
|
|
|
the number of CPU seconds to use.
|
|
|
|
|
2006-06-19 01:27:33 +00:00
|
|
|
<li>
|
|
|
|
Compile the program 'wrapper' from the
|
2006-06-27 19:38:22 +00:00
|
|
|
<a href=example.php>boinc_samples</a> tree,
|
2006-06-19 01:27:33 +00:00
|
|
|
producing (say) 'wrapper_5.10_windows_intelx86.exe'.
|
2006-11-26 02:06:30 +00:00
|
|
|
This program executes your legacy application,
|
|
|
|
and acts as a proxy for it (to report CPU time etc.).
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<a href=app.php>Create an application</a> named 'worker',
|
|
|
|
and a corresponding directory 'project/apps/worker'.
|
|
|
|
In this directory, create
|
|
|
|
a directory 'wrapper_5.10_windows_intelx86.exe'.
|
|
|
|
Put the files 'wrapper_5.10_windows_intelx86.exe',
|
|
|
|
and 'worker_5.10_windows_intelx86.exe' there.
|
2006-06-19 01:27:33 +00:00
|
|
|
|
2006-11-26 02:06:30 +00:00
|
|
|
<li> In the same directory,
|
|
|
|
create a file 'job.xml=job_1.12.xml' (1.12 is a version number) containing
|
2006-06-19 01:27:33 +00:00
|
|
|
".html_text("
|
|
|
|
<job_desc>
|
|
|
|
<task>
|
|
|
|
<application>worker_5.10_windows_intelx86.exe</application>
|
2006-11-26 02:06:30 +00:00
|
|
|
<stdin_filename>stdin</stdin_filename>
|
|
|
|
<stdout_filename>stdout</stdout_filename>
|
|
|
|
<command_line>10</command_line>
|
2006-06-19 01:27:33 +00:00
|
|
|
</task>
|
|
|
|
</job_desc>
|
|
|
|
")."
|
2006-11-26 02:06:30 +00:00
|
|
|
This file is read by 'wrapper';
|
|
|
|
it tells it the name of the legacy program,
|
|
|
|
what files to connect to its stdin/stdout, and a command-line argument.
|
2006-06-19 01:27:33 +00:00
|
|
|
<li>
|
2006-11-26 02:06:30 +00:00
|
|
|
Create a workunit template file
|
|
|
|
".html_text("
|
|
|
|
<file_info>
|
|
|
|
<number>0</number>
|
|
|
|
</file_info>
|
|
|
|
<file_info>
|
|
|
|
<number>1</number>
|
|
|
|
</file_info>
|
|
|
|
<workunit>
|
|
|
|
<file_ref>
|
|
|
|
<file_number>0</file_number>
|
|
|
|
<open_name>in</open_name>
|
|
|
|
<copy_file/>
|
|
|
|
</file_ref>
|
|
|
|
<file_ref>
|
|
|
|
<file_number>1</file_number>
|
|
|
|
<open_name>stdin</open_name>
|
|
|
|
</file_ref>
|
|
|
|
<rsc_fpops_bound>1000000000000</rsc_fpops_bound>
|
|
|
|
<rsc_fpops_est>1000000000000</rsc_fpops_est>
|
|
|
|
</workunit>
|
|
|
|
")."
|
|
|
|
and a result template file
|
|
|
|
".html_text("
|
|
|
|
<file_info>
|
|
|
|
<name><OUTFILE_0/></name>
|
|
|
|
<generated_locally/>
|
|
|
|
<upload_when_present/>
|
|
|
|
<max_nbytes>5000000</max_nbytes>
|
|
|
|
<url><UPLOAD_URL/></url>
|
|
|
|
</file_info>
|
|
|
|
<file_info>
|
|
|
|
<name><OUTFILE_1/></name>
|
|
|
|
<generated_locally/>
|
|
|
|
<upload_when_present/>
|
|
|
|
<max_nbytes>5000000</max_nbytes>
|
|
|
|
<url><UPLOAD_URL/></url>
|
|
|
|
</file_info>
|
|
|
|
<result>
|
|
|
|
<file_ref>
|
|
|
|
<file_name><OUTFILE_0/></file_name>
|
|
|
|
<open_name>out</open_name>
|
|
|
|
<copy_file/>
|
|
|
|
</file_ref>
|
|
|
|
<file_ref>
|
|
|
|
<file_name><OUTFILE_1/></file_name>
|
|
|
|
<open_name>stdout</open_name>
|
|
|
|
</file_ref>
|
|
|
|
</result>
|
|
|
|
")."
|
|
|
|
Note that the files opened directly by the legacy program
|
|
|
|
must have the <copy_file> tag.
|
2006-06-19 01:27:33 +00:00
|
|
|
<li>
|
|
|
|
Run <a href=tool_update_versions.php>update_versions</a>
|
|
|
|
to create an app version.
|
|
|
|
|
|
|
|
<li>
|
2006-11-26 02:06:30 +00:00
|
|
|
Run a script like
|
|
|
|
".html_text("
|
|
|
|
cp download/input `bin/dir_hier_path input`
|
|
|
|
cp download/input2 `bin/dir_hier_path input2`
|
2006-06-19 01:27:33 +00:00
|
|
|
|
2006-11-26 02:06:30 +00:00
|
|
|
bin/create_work -appname worker -wu_name worker_nodelete -wu_template templates/worker_wu -result_template templates/worker_result input input2
|
|
|
|
")."
|
|
|
|
to generate a workunit.
|
2006-06-19 01:27:33 +00:00
|
|
|
|
2006-11-26 02:06:30 +00:00
|
|
|
</ul>
|
2006-06-19 01:27:33 +00:00
|
|
|
|
|
|
|
<p>
|
|
|
|
Notes:
|
|
|
|
<ul>
|
|
|
|
<li> This requires version 5.5 or higher of the BOINC core client.
|
2006-11-26 02:06:30 +00:00
|
|
|
<li> Multiple tasks per job is not implemented yet.
|
|
|
|
Future versions of wrapper may allow you to
|
|
|
|
run multiple applications in sequence
|
|
|
|
(as specified in the job.xml file).
|
2006-06-19 01:27:33 +00:00
|
|
|
<li> TODO: provide a way for projects to supply an animated GIFF
|
|
|
|
which is shown (with user/team credit text) as screensaver graphics.
|
|
|
|
</ul>
|
|
|
|
|
2006-11-26 02:06:30 +00:00
|
|
|
To understand how all this works:
|
|
|
|
at the beginning of execution, the file layout is:
|
|
|
|
";
|
|
|
|
list_start();
|
|
|
|
list_heading_array(array("Project directory", "slot directory"));
|
|
|
|
list_item_array(array(
|
|
|
|
"job_1.12.xml
|
|
|
|
<br>input
|
|
|
|
<br>input2
|
|
|
|
<br>worker_5.10_windows_intelx86.exe
|
|
|
|
<br>wrapper_5.10_windows_intelx86.exe
|
|
|
|
",
|
|
|
|
"
|
|
|
|
in (copy of project/input)
|
|
|
|
<br>job.xml (link to project/job_1.12.xml)
|
|
|
|
<br>stdin (link to project/input2)
|
|
|
|
<br>stdout (link to project/worker_nodelete_0)
|
|
|
|
<br>worker_5.10_windows_intelx86.exe
|
|
|
|
(link to project/worker_5.10_windows_intelx86.exe)
|
|
|
|
<br>wrapper_5.10_windows_intelx86.exe
|
|
|
|
(link to project/wrapper_5.10_windows_intelx86.exe)
|
|
|
|
"
|
|
|
|
));
|
|
|
|
list_end();
|
|
|
|
|
|
|
|
echo "
|
|
|
|
The wrapper program executes the worker,
|
|
|
|
connecting its stdin to project/input2
|
|
|
|
and its stdout to project/worker_nodelete_0.
|
|
|
|
The worker program opens 'in' for reading and 'out' for writing.
|
|
|
|
<p>
|
|
|
|
When the worker program finishes, the wrapper sees this and exits.
|
|
|
|
Then the the BOINC core client copies
|
|
|
|
slot/out to project/worker_nodelete_1.
|
2006-06-19 01:27:33 +00:00
|
|
|
";
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
?>
|