Suggestions for Application Debugging
From Unofficial BOINC Wiki
Contents |
[edit] General
Here are some suggestions for debugging applications:
[edit] Standalone Mode
When you have built your application and linked it with the BOINC Libraries, you can run it in 'standalone mode' (without a BOINC Daemon present). To do this, put instances of all of the Work Unit Data Files in the same directory. (with the proper logical, not physical, names). The Science Application should run and produce Result Data Files (also with their logical names). You can run the program under a debugger.
When you run a Science Application in standalone mode, the BOINC API will recognize this and take it into account. A couple of things to note:
- If your application does graphics, it will open a graphics window. Closing this window will exit your application.
- boinc_time_to_checkpoint() will always return false, so your Application will never checkpoint.
[edit] Using the Anonymous Platform Mechanism
Once your Application works in standalone mode you'll want to run it from the BOINC Daemon. This will exercise the various forms of interaction with the BOINC Daemon.
To get this process started, create a Test Project, add an application version and some work, then run the BOINC Daemon. It will download everything and run your Application, which will possibly crash.
At this point you'll want to start experimenting with your Application. It would be very tedious to create a new Application Version for each change. It's far easier to use the BOINC Anonymous Platform Mechanism. To do this:
- Following the directions given in the "BOINC Anonymous Platform Mechanism", create a file 'app_info.xml' in the "projects" sub-directory of the BOINC Directory (named as the Project URL), with the appropriate name and Version Number of your Application.
- Each time your build a new version of your Application, copy the executable into the project_* directory, making sure it has the appropriate name. Then restart the BOINC Daemon.
On Unix, it's possible to attach a debugger to a running process. Use 'ps' to find the process ID of your Application, then something like
gdb exec_filename PID
to attach a debugger to it.
[edit] UCB Source
[edit] Copyright ©
- 2005 University of California
- 2005 Paul D. Buck
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.

