Changes between Version 25 and Version 26 of WrapperApp
- Timestamp:
- Jun 18, 2008, 11:51:55 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WrapperApp
v25 v26 1 1 = Legacy applications = 2 2 3 A ' ''legacy application''' is one which doesn't use the BOINC API3 A 'legacy application' is one which doesn't use the BOINC API 4 4 (for example, because the source code is not available). 5 Such applications can be run under BOINC using a 'wrapper application' supplied by BOINC. 6 The wrapper handles all communication with the core client, 7 and runs the legacy application as a subprocess: 5 Such applications can be run under BOINC using a '''wrapper''' program supplied by BOINC. 6 The wrapper runs legacy applications as subprocesses, 7 and handles all communication with the core client 8 (e.g., to report CPU time and fraction done). 8 9 9 10 [[Image(http://boinc.berkeley.edu/wrapper.png)]] 10 11 11 The wrapper program (called '''wrapper''')is in [ExampleApps boinc_samples].12 The '''wrapper''' program is in [ExampleApps boinc_samples]. 12 13 It reads a file with [BoincFiles logical name] 'job.xml'. 13 14 This file has the format: … … 28 29 }}} 29 30 30 The job file specifies a sequence of tasks.31 The job file describes a sequence of tasks. 31 32 The descriptor for each task includes: 32 33 33 34 '''application''':: The logical name of the application, or 'worker program'. 34 35 '''stdin_filename''', '''stdout_filename''', '''stderr_filename''':: The logical names of the files to which stdin, stdout, and stderr are to be connected (if any). 35 '''command_line''':: command-line arguments to be passed to the worker program. '''wrapper''' itself may be passed command-line arguments (specified in the workunit template); these are passed to each of the worker programsafter those specified in the job file.36 '''command_line''':: command-line arguments to be passed to the worker program. '''wrapper''' itself may be passed command-line arguments (specified in the [ WorkGeneration#templates input template); these are passed to each worker program after those specified in the job file. 36 37 '''weight''':: the contribution of each task to the overall fraction done is proportional to its weight (floating-point, default 1). For example, if your job has tasks A and B, and A uses 100 times more CPU time than B, set A.weight=100 and B.weight=1. 37 38 '''checkpoint_filename''':: the name of the checkpoint file used by the app, if any. When this is modified, the wrapper assumes that a checkpoint has been completed and notifies the core client. 38 39 Worker programs must exit with zero status; nonzero values are interpreted as error codes by the wrapper.40 39 41 40 The job file can specify multiple tasks. … … 47 46 Notes: 48 47 49 * In the following example, the job file is part of the application version (it's the same between workunits). Alternatively, it can be part of the workunit (e.g. if its command line elements differ between workunits). This requires that you use the same worker program namesfor all platforms.48 * Normally the job file is part of the application version (it's the same between workunits). Alternatively, it can be part of the workunit (e.g. if its command line elements differ between workunits). This requires that you use the same worker program logical names for all platforms. 50 49 * Files opened directly by a worker program must have the <copy_file/> tag. This requires version 5.5 or higher of the BOINC core client (you can specify this limit at either the [AppVersion application] or [ProjectOptions#Clientcontrol project] level. 51 * If you run wrapper in standalone mode (while debugging), you must provide input files with the proper logical, not physical, names. 50 * Worker programs must exit with zero status; nonzero values are interpreted as errors by the wrapper. 51 * If you run '''wrapper''' in standalone mode (while debugging), you must provide input files with the proper logical, not physical, names. 52 53 == Physical file management == 54 55 You can use the wrapper together with [PhysicalFileManagement physical file management], 56 where you directly access files in your project directory. 57 For example, you could create a job whose first task unpacks a zip file 58 into the project directory, 59 and whose subsequent tasks access these files. 60 61 The support for this is: 62 63 * If a worker program name begins with "$PROJECT_DIR", that substring is replaced with the project directory, and the name is treated as a physical name. 64 * In task command lines, "$PROJECT_DIR" is replaced with the project directory. 52 65 53 66 == Example == 54 67 55 Here's an example that shows how to use th ismechanism.68 Here's an example that shows how to use the legacy application mechanism. 56 69 We assume that you have already [MakeProject created a project] with root directory PROJECT/. 57 70 58 * Compile the program 'worker' from the [ExampleApps boinc_samples] tree, producing (say) 'worker_5.10_windows_intelx86.exe'. This is the legacy app. I freads 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.59 * Compile the program 'wrapper' from the [ExampleApps boinc_samples] tree, producing (say) 'wrapper_5.10_windows_intelx86.exe'. This program executes your legacy application, and acts as a proxy for it (to report CPU time etc.).71 * Compile the program 'worker' from the [ExampleApps boinc_samples] tree, producing (say) 'worker_5.10_windows_intelx86.exe'. This is the legacy app. It 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. 72 * Compile the program 'wrapper' from the [ExampleApps boinc_samples] tree, producing (say) 'wrapper_5.10_windows_intelx86.exe'. 60 73 * [AppVersion Create an application] 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. Rename the latter file to 'worker=worker_5.10_windows_intelx86.exe' (this gives it the logical name 'worker'). 61 74 * In the same directory, create a file 'job.xml=job_1.12.xml' (1.12 is a version number) containing … … 70 83 </job_desc> 71 84 }}} 72 This file (which has logical name 'job.xml' and physical name 'job_1.12.xml') is read by 'wrapper'; it tells it the name of the legacyprogram, what files to connect to its stdin/stdout, and a command line.85 This file (which has logical name 'job.xml' and physical name 'job_1.12.xml') is read by 'wrapper'; it tells it the name of the worker program, what files to connect to its stdin/stdout, and a command line. 73 86 * In the 'PROJECT/templates' directory create a workunit template file called 'worker_wu': 74 87 {{{ … … 146 159 ||wrapper_5.10_windows_intelx86.exe||wrapper_5.10_windows_intelx86.exe (link to project/wrapper_5.10_windows_intelx86.exe) || 147 160 148 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. 161 The wrapper program executes the worker, connecting its stdin to project/input2 and its stdout to project/worker_nodelete_0. 162 The worker program opens 'in' for reading and 'out' for writing. 149 163 150 When the worker program finishes, the wrapper sees this and exits. Then the BOINC core client copies slot/out to project/worker_nodelete_1. 164 When the worker program finishes, the wrapper sees this and exits. 165 Then the BOINC core client copies slot/out to project/worker_nodelete_1. 151 166