Changes between Version 1 and Version 2 of AppIntro


Ignore:
Timestamp:
Jun 9, 2008, 12:20:58 PM (16 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppIntro

    v1 v2  
    1 3) application structure options
    2                 runtime environment (disk)
    3                 simple/compound
    4                 wrapper
    5                 FORTRAN
    6                 Java, Python, Lisp
     1= BOINC applications =
     2
     3BOINC lets you distribute pretty much any existing application program,
     4written in any language.
     5However, there are a few details you need to know.
     6First, it's helpful to understand the environment in which
     7BOINC executes applications.
     8This has two aspects:
     9
     10'''Directory structure'''
     11
     12On a given volunteer host, each project has a separate '''project directory'''.
     13All the files for that project - application files,
     14input files, output files - are stored in the project directory.
     15
     16Each job runs in a separate '''slot directory''',
     17which contains '''links''' to all the files needed by that job
     18(these are like UNIX symbolic links; since Windows NTFS doesn't support
     19symbolic links, BOINC implements them as XML files).
     20The names of the link files are called '''logical names''',
     21and the files they point to have '''physical names'''.
     22
     23The BOINC client expects each application to create a specially-named "finish file"
     24when it is done; this lets it reliably detect when the application has finished
     25(rather than, e.g., being killed).
     26
     27'''Control and communication'''
     28
     29The BOINC client interacts with running applications in two ways:
     30
     31 * The client tells the application when to suspend, resume, and quit.
     32 * The application tells the client its current CPU time, and when it has checkpointed.
     33
     34This communication is implemented using a share-memory structure.
     35There is a separate shared-memory structure for each running application.
     36
     37== The BOINC runtime library ==
     38
     39Suppose you tried to run an existing, unmodified program under BOINC.
     40There would be two problems:
     41
     42 * 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.
     43 * When the program finishes, it wouldn't create a finish file, so the BOINC client would restart it repeatedly.
     44 * The BOINC client wouldn't know the application's CPU time; it would display zero, and volunteers would be confused.
     45
     46The easiest way to solve these problems is to modify your program as follows:
     47 * Add calls to BOINC initialization and finalization routines.
     48 * Precede with fopen() call with a BOINC function that maps logical to physical names.
     49 * Link it with the BOINC runtime library.
     50
     51== The BOINC wrapper ==
     52
     53Suppose you have a program that is difficult or impossible to modify
     54to use the BOINC runtime library (e.g., source code is not available).
     55You can run it under BOINC, using the '''BOINC wrapper'''.
     56The wrapper acts as a main program,
     57managing communication with the BOINC client,
     58and running your program as a subprocess.
     59
     60== Language alternatives ==
     61
     62The BOINC runtime library is implemented in C++
     63and is easiest to use from C/C++ programs.
     64However, it also has a FORTRAN binding,
     65and it is possible to run Java and Lisp programs under BOINC as well.