Version 3 (modified by 16 years ago) (diff) | ,
---|
BOINC applications
BOINC lets you distribute pretty much any existing application program, written in any language. However, there are a few details you need to know. First, it's helpful to understand the environment in which BOINC executes applications. This has two aspects:
Directory structure
On a given volunteer host, each project has a separate project directory. All the files for that project - application files, input files, output files - are stored in the project directory.
Each job runs in a separate slot directory, which contains links to all the files needed by that job (these are like UNIX symbolic links; since Windows NTFS doesn't support symbolic links, BOINC implements them as XML files). The names of the link files are called logical names, and the files they point to have physical names.
The BOINC client expects each application to create a specially-named "finish file" when it is done; this lets it reliably detect when the application has finished (rather than, e.g., being killed).
Control and communication
The BOINC client interacts with running applications in two ways:
- The client tells the application when to suspend, resume, and quit.
- The application tells the client its current CPU time, and when it has checkpointed.
This communication is implemented using a share-memory structure. There is a separate shared-memory structure for each running application.
The BOINC runtime library
Suppose you tried to run an existing, unmodified program under BOINC. There would be two problems:
- When the program opens and reads its input files, it would get the contents of the XML link files - not what it expects. Similarly, the output would be written to the wrong directory.
- When the program finishes, it wouldn't create a finish file, so the BOINC client would restart it repeatedly.
- The BOINC client wouldn't know the application's CPU time; it would display zero, and volunteers would be confused.
The easiest way to solve these problems is to modify your program as follows:
- Add calls to BOINC initialization and finalization routines.
- Precede with fopen() call with a BOINC function that maps logical to physical names.
- Link it with the BOINC runtime library.
The BOINC wrapper
Suppose you have a program that is difficult or impossible to modify to use the BOINC runtime library (e.g., source code is not available). You can run it under BOINC, using the BOINC wrapper. The wrapper acts as a main program, managing communication with the BOINC client, and running your program as a subprocess.
Language alternatives
The BOINC runtime library is implemented in C++ and is easiest to use from C/C++ programs. However, it also has a FORTRAN binding, and it is possible to run Java and Lisp programs under BOINC as well.
Attachments (2)
- client_dir.png (6.0 KB) - added by 16 years ago.
- client_msgs.png (4.7 KB) - added by 16 years ago.
Download all attachments as: .zip