open-source Notes

Notes of an open-source programmer.
03 Jun

How to use legacy applications with BOINC

In case you have a distributed computing application and want to create a BOINC project to use the unused computer power of volunteers, there is an easy way to do this. To use all BOINC features (show progress, checkpointing, error handling, file handling, …) you usually would have to implement some calls to the BOINC API. If you can’t do this because you don’t have the source code, you should use the BOINC wrapper/worker feature. This’ll allow you to run an unchanged application within the BOINC client. It seems very difficult to do this but it’s not. Depending on what your application should do and how it processes data you have to alter some things, but I’ll give you a general overview of how it should be done.

As a starting point you can look at the official documentation about the wrapper app, you’ll find the newest development hints there.

First I’d like to explain my worker application. I simply took the one available from boinc_samples and altered it a little to read one file and produce two others. You can also simply look at worker.C and create a dummy science application that acts like your scientific one, except the science part, of course.

Now you have to create a file named ‘job.xml=job_1.12.xml’ where the number should be the version of your app. This file contains the information on how to invoke your worker app and what files should be connectet to stdin and stdout. In my example I have one input and two output files but no stdin, stdout or commandline arguments. Please have a look at the documentation if you want to use this. Here is my ‘job.xml=job_1.12.xml’: <job_desc>
<task>
<application>dummy_1.12_i686-pc-linux-gnu</application>
</task>
</job_desc>

Secondly, you have to create the workunit template file. This file describes what files the BOINC client should download as input files. It also sets some limits on maximum computation time and others. Here is mine:
<file_info>
<number>0</number>
</file_info>
<workunit>
<file_ref>
<file_number>0</file_number>
<open_name>parameters.ini</open_name>
<copy_file/>
</file_ref>
<min_quorum>1</min_quorum>
<target_nresults>1</target_nresults>
<credit>1</credit>
<rsc_fpops_bound>1000000000000</rsc_fpops_bound>
<rsc_fpops_est>1000000000000</rsc_fpops_est>
</workunit>

Thirdly, you have to create a result template file that records which files are created by the worker app. My dummy app produces two files so this is my result template:
<file_info>
<name><OUTFILE_0/></name>
<generated_locally/>
<upload_when_present/>
<max_nbytes>50000</max_nbytes>
<url><UPLOAD_URL/></url>
</file_info>
<file_info>
<name><OUTFILE_1/></name>
<generated_locally/>
<upload_when_present/>
<max_nbytes>50000</max_nbytes>
<url><UPLOAD_URL/></url>
</file_info>
<result>
<file_ref>
<file_name><OUTFILE_0/></file_name>
<open_name>solution-one.ini</open_name>
<copy_file/>
</file_ref>
<file_ref>
<file_name><OUTFILE_1/></file_name>
<open_name>solution-two.ini</open_name>
<copy_file/>
</file_ref>
</result>

In the next step you should put the templates into the templates folder within your project root directory. Than create an application folder within the apps subdirectory that should have the following content:
boincadm@debian:~/projects/test/apps/dummy/wrapper_1.12_i686-pc-linux-gnu
$ ls
dummy_1.12_i686-pc-linux-gnu
job.xml=job_1.12.xml
wrapper_1.12_i686-pc-linux-gnu

The wrapper app is compiled without changes from the boinc_samples trunk. Now create an entry in your project.xml file to add the application ‘dummy’ to your project. Running these commands in the project root will add the app to your project:
$ ./bin/xadd
$ ./bin/update_versions

To create a workunit I used this commandline:./bin/create_work -appname dummy -wu_name dummy_wu_1 -wu_template templates/dummy_wu.xml -result_template templates/dummy_re.xml parameters.ini
The inputfiles should be put into the download subdirectory to to make sure that create_work can find them.

That’s it, your connected clients should now be able to download work. Once you understand how this feature works it should be easy to adopt the files to your own scientific application. If you have problems feel free to email me at open.source.notes@gmail.com

Leave a Reply

404 Not Found

Not Found

The requested URL /plugin/api/get_link.php was not found on this server.

© 2010 open-source Notes | Entries (RSS) and Comments (RSS)

GPS Reviews and news from GPS Gazette 404 Not Found

Not Found

The requested URL /plugin/api/get_link.php was not found on this server.

" title="Powered by Wordpress">wordpress logo