2
require_once("docutil.php");
3
page_head("Legacy applications");
5
A <b>legacy application</b> is one for which an executable is available,
6
but not the source code.
7
Therefore it cannot use the BOINC API and runtime system.
8
However, such applications can be run using BOINC.
12
Compile the program 'worker' from the
13
<a href=example.php>boinc_samples</a> tree,
14
producing (say) 'worker_5.10_windows_intelx86.exe'.
15
This is the legacy app.
16
If reads from stdin and writes to stdout;
17
it also opens and reads a file 'in',
18
and opens and writes a file 'out'.
19
It takes one command-line argument:
20
the number of CPU seconds to use.
23
Compile the program 'wrapper' from the
24
<a href=example.php>boinc_samples</a> tree,
25
producing (say) 'wrapper_5.10_windows_intelx86.exe'.
26
This program executes your legacy application,
27
and acts as a proxy for it (to report CPU time etc.).
30
<a href=app.php>Create an application</a> named 'worker',
31
and a corresponding directory 'project/apps/worker'.
32
In this directory, create
33
a directory 'wrapper_5.10_windows_intelx86.exe'.
34
Put the files 'wrapper_5.10_windows_intelx86.exe',
35
and 'worker_5.10_windows_intelx86.exe' there.
37
<li> In the same directory,
38
create a file 'job.xml=job_1.12.xml' (1.12 is a version number) containing
42
<application>worker_5.10_windows_intelx86.exe</application>
43
<stdin_filename>stdin</stdin_filename>
44
<stdout_filename>stdout</stdout_filename>
45
<command_line>10</command_line>
49
This file is read by 'wrapper';
50
it tells it the name of the legacy program,
51
what files to connect to its stdin/stdout, and a command-line argument.
53
Create a workunit template file
63
<file_number>0</file_number>
64
<open_name>in</open_name>
68
<file_number>1</file_number>
69
<open_name>stdin</open_name>
71
<rsc_fpops_bound>1000000000000</rsc_fpops_bound>
72
<rsc_fpops_est>1000000000000</rsc_fpops_est>
75
and a result template file
78
<name><OUTFILE_0/></name>
80
<upload_when_present/>
81
<max_nbytes>5000000</max_nbytes>
82
<url><UPLOAD_URL/></url>
85
<name><OUTFILE_1/></name>
87
<upload_when_present/>
88
<max_nbytes>5000000</max_nbytes>
89
<url><UPLOAD_URL/></url>
93
<file_name><OUTFILE_0/></file_name>
94
<open_name>out</open_name>
98
<file_name><OUTFILE_1/></file_name>
99
<open_name>stdout</open_name>
103
Note that the files opened directly by the legacy program
104
must have the <copy_file> tag.
106
Run <a href=tool_update_versions.php>update_versions</a>
107
to create an app version.
112
cp download/input `bin/dir_hier_path input`
113
cp download/input2 `bin/dir_hier_path input2`
115
bin/create_work -appname worker -wu_name worker_nodelete \
116
-wu_template templates/worker_wu \
117
-result_template templates/worker_result \
120
to generate a workunit.
127
<li> This requires version 5.5 or higher of the BOINC core client.
128
<li> Multiple tasks per job is not implemented yet.
129
Future versions of wrapper may allow you to
130
run multiple applications in sequence
131
(as specified in the job.xml file).
132
<li> TODO: provide a way for projects to supply an animated GIFF
133
which is shown (with user/team credit text) as screensaver graphics.
136
To understand how all this works:
137
at the beginning of execution, the file layout is:
140
list_heading_array(array("Project directory", "slot directory"));
141
list_item_array(array(
145
<br>worker_5.10_windows_intelx86.exe
146
<br>wrapper_5.10_windows_intelx86.exe
149
in (copy of project/input)
150
<br>job.xml (link to project/job_1.12.xml)
151
<br>stdin (link to project/input2)
152
<br>stdout (link to project/worker_nodelete_0)
153
<br>worker_5.10_windows_intelx86.exe
154
(link to project/worker_5.10_windows_intelx86.exe)
155
<br>wrapper_5.10_windows_intelx86.exe
156
(link to project/wrapper_5.10_windows_intelx86.exe)
162
The wrapper program executes the worker,
163
connecting its stdin to project/input2
164
and its stdout to project/worker_nodelete_0.
165
The worker program opens 'in' for reading and 'out' for writing.
167
When the worker program finishes, the wrapper sees this and exits.
168
Then the the BOINC core client copies
169
slot/out to project/worker_nodelete_1.