Categories: BOINC

BOINC Client Communication Infrastructure, Part III

Parsing Responses

When I mentioned earlier about the BOINC XML parser assuming a line-by-line parse what I meant by that the XML responses are relatively flat and is parsed in one pass. This has some interesting ramifications, for instance the relationship between XML elements is determined by what was parsed before it.

For an example of what I mean I’m going to use the uber GUI RPC <get_state> which dumps the BOINC Daemons entire state and should be called at the beginning of any session. Most of the mini update RPC’s do not contain any relational information so you have to run a quick query against the <get_state> results to map a workunit to a project for instance.

Here would be the request:


<boinc_gui_rpc_request>
   <major_version>5</major_version>
   <minor_version>5</minor_version>
   <release>15</release>
   <get_state/>
</boinc_gui_rpc_request>

Here is a simplified version of the response:


<boinc_gui_rpc_reply>
    <major_version>5</major_version>
    <minor_version>5</minor_version>
    <release>13</release>
    …
    <project>
        <name>Alpha Project</name>
        …
    </project>
    <app>
        <name>alphaapp</name>
        <user_friendly_name>Alpha Application</user_friendly_name>
        …
    </app>
    <file_info>
        <name>aapp_5.24_windows_intelx86.exe</name>
        …
    </file_info>
    <app_version>
        <name>alphaapp</name>
        <version_num>524</version_num>
        <file_ref>
            <file_name>aapp_5.24_windows_intelx86.exe</file_name>
            <main_program/>
        </file_ref>
        …
    </app_version>
    <workunit>
        <name>Test1</name>
        <app_name>alphaapp</app_name>
        <version_num>524</version_num>
        …
    </workunit>
    <result>
        <name>Test1_0</name>
        <wu_name>Test1</wu_name>
    </result>
    <project>
        <name>Beta Project</name>
        …
    </project>
    <app>
        <name>betaapp</name>
        <user_friendly_name>Beta Application</user_friendly_name>
        …
    </app>
    <file_info>
        <name>bapp_5.24_windows_intelx86.exe</name>
        …
    </file_info>
    <app_version>
        <name>betaapp</name>
        <version_num>524</version_num>
        <file_ref>
            <file_name>bapp_5.24_windows_intelx86.exe</file_name>
            <main_program/>
        </file_ref>
        …
    </app_version>
    <workunit>
        <name>Test1</name>
        <app_name>betaapp</app_name>
        <version_num>524</version_num>
        …
    </workunit>
    <result>
        <name>Test1_0</name>
        <wu_name>Test1</wu_name>
    </result>
</boinc_gui_rpc_reply>

So in this example you can see that there is no explicit reference to a project in any of the app, app_version, file_info, workunit, and result elements because it is assumed that they all belong to the same project until the next project element is parsed.

This example illustrates what I mean by a relatively flat XML structure. XPath and XQuery would have a hard time trying to return results that are not in a hierarchical in nature.

—– Rom

This post was last modified on December 13, 2020 9:56 am

Rom Walton

Share
Published by
Rom Walton

Recent Posts

ROMWNET Upgrades (2020)

2020 turns out to be a hardware refresh year for ROMWNET.   I've upgraded the network…

3 years ago

Blog Migration (Cont’d)

After a bit of research and experimentation, I figured out how to fix my permalink…

3 years ago

Blog Migration

After a seriously long time, I've finally upgraded my blogging platform to WordPress. Dasblog was…

3 years ago

FOLLOWUP: New BOINC Manager Design

Original post: New BOINC Manager Design Project: BOINC Sentinels Some time back, I started BOINC…

10 years ago

New project name needed

So I have been working on a little side project on and off for a…

14 years ago

BOINC Screen Saver Issue

Well I believe I have found and fixed the screen saver issue that has been…

15 years ago