Jord Volunteer tester Help desk expert

Send message Joined: 29 Aug 05 Posts: 15588
|
From the EAH forums, this thread:
A nice advantage of the "separate graphics" Apps is that the computation is completely independent of the graphics, which are now a separate program instead of a thread. Nothing that happens to the graphics (error, crash, etc.) could affect the computation, and the graphics code doesn't even have to be linked (in a technical sense) to the rest of the program.
Therefore we (as the project) simply don't care about what program runs as a graphics program (if at all), and what code it is. This gives you, the participants, the opportunity to code your own graphics for Einstein@home and run it, share it with your friends, customize it for your team etc. You can make one that suits the graphical power of your computer better than the standard one does (in either direction).
A lot of the fun in running BOINC is due to some kind of competition. So let's have an open competition for the best Einstein@home graphics. Write it, publish and announce it in the forum (here in this thread) and the whole community can and will take a look. Maybe at some point we'll chose a new "official" one, or give a list to choose from (in project preferences).
Here are some technical graphics/project-specific hints and instructions that will help you writing an Einstein@home graphics program (How to get, compile and link the BOINC library is out of the scope of this description):
* The only mandantory requirement for a BOINC graphics program is that it understands and honors a comand-line option "--fullscreen". If it gets passed this option, it should display graphics on the whole (main) screen and terminate on mouse movements or key presses. If it gets called without that option, it should open a window showing the same or different graphics and might react on keys and mouse movents in its own way.
* You will probably want to display some project-related information in any way. For this purpose you will need to use some functions of the BOINC library.
(void*)boinc_graphics_get_shmem("EinsteinHS") returns a pointer to a shared memory segment into which the main Einstein@home application writes a XML document describing its current status. In current Apps (S5R3 4.25-4.27) this looks like:
<graphics_info>
<skypos_rac>%f</skypos_rac>
<skypos_dec>%f</skypos_dec>
<fraction_done>%f</fraction_done>
<cpu_time>%f</cpu_time>
<update_time>%f</update_time>
</graphics_info>
All the values (%f) are floats. The sky position is given in rad.
Future Apps will pass additional information:
<graphics_info>
<skypos_rac>%f</skypos_rac> (float) right ascension current sky-position [rad]
<skypos_dec>%f</skypos_dec> (float) declination of current sky-position [rad]
<fraction_done>%f</fraction_done> (float) progress done so far, [0.0...1.0]
<cpu_time>%f</cpu_time> (float) CPU time spent so far [sec]
<update_time>%f</update_time> (float) timestamp of this XML
<frequency>%f</frequency> (float) base frequency of the current search [Hz]
<bandwidth>%f</bandwidth> (float) frequency bandwidth [Hz] - search will range
from frequency to frequency+bandwidth
<candidate> One of current "top candidates" for a GW pulsar signal in this WU
<frequency>%f<frequency> (float) base frequency
<spindown>%f<spindown> (float) spindown
<rac>%f<rac> (float) right ascension
<dec>%f<dec> (float) declination
<hough_sig>%f<hough_sig> (float) hough significance (kind of rating)
</candidate>
<boinc_status> The current BOINC status of the task / App
<no_heartbeat>%d<no_heartbeat> (see boinc/api/boinc_api.h)
<suspended>%d<suspended>
<quit_request>%d<quit_request>
<reread_init_data_file>%d<reread_init_data_file>
<abort_request>%d<abort_request>
<working_set_size>%f<working_set_size>
<max_working_set_size>%f<max_working_set_size>
</boinc_status>
</graphics_info>,
The information contained in the XML may be extended in the future (e.g. on request) - that's why we chose XML.
A lot of data you probably want to show is passed to the App from the BOINC Core Client in a file init_data.xml. You could use BOINC functions to read and parse it:
Call boinc_parse_init_data_file() once at the beginning of your program, then
boinc_get_init_data(/*APP_INIT_DATA*/ app_init_data) will get you a copy of the BOINC-internal APP_INIT_DATA structure in your variable app_init_data. The full definition of APP_INIT_DATA is in boinc/lib/app_ipc.h, it lists things like user- and teamname, total credit and RAC for host and user account etc., but also some technical stuff like the path to the project and slot directories on your disk.
A GLUT-based OpenGL event-loop is provided by BOINC as boinc_graphics_loop(argc,argv). When using this it will take care of the command-line parsing (i.e. "--fullscreen" disticntion), termination in fullscreen mode etc. Some documentation can be found in the BOINC Wiki at http://boinc.berkeley.edu/trac/wiki/GraphicsApi . The current Einstein@home starsphere uses this loop, but mainly because it's the way things were done previously and it required only minimal changes to the code. For new implementations I'd rather drop GLUT, partly because it's incompatible with the "virtual root window"-concept of xscreensaver. I'd use SDL or some other portable library to manage windows and interaction for OpenGL graphics. You could use DirectX, too, but then your graphics program is limited to MS Windows.
All the current "separate graphics Apps" 4.25-4.27 come with an app_info.xml. To let your graphics program run with BOINC, place the program in the project directory and replace the einstein_S5R3_*_graphics_* entry in app_info.xml with your program filename (and restart the client). If all goes well, pressing "Show graphics" in the manager will fire up the graphics in a window, and the BOINC Screensaver will start it in fullscreen mode.
I intend to publish the Einstein@home starsphere sourcecode as an example soon.
Looking forward to hearing from you!
BM
ID: 15204 ·  |