Changes between Version 4 and Version 5 of BasicApi


Ignore:
Timestamp:
May 4, 2007, 1:16:35 PM (17 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BasicApi

    v4 v5  
    1010== Initialization and termination ==
    1111
    12 Applications should [DiagnosticsApi initialize diagnostics] before any other BOINC calls.
    13 
    1412Initialization for graphical and compound applications are described elsewhere (see links above). Other applications must call
    1513
     
    1816}}}
    1917
    20 before calling other BOINC functions or doing I/O.
     18before calling other BOINC functions.
    2119
    2220When the application has completed it must call
     
    2725
    2826`status` is nonzero if an error was encountered. This call does not return.
    29 
    30 == Is your application running under the control of the BOINC client? ==
    31 
    32 BOINC applications can be run in "standalone" mode for testing, or under the control of the BOINC client. You might want your application to behave differently in the two cases. For example you might want to output debugging information if the application is running standalone. To determine if the application is running in standalone mode or under the control of the BOINC client, call
    33 
    34 {{{
    35 int boinc_is_standalone(void);
    36 }}}
    37 
    38 This returns non-zero (True) if the application is running standalone, and zero (False) if the application is running under the control of the BOINC client.
    3927
    4028== Resolving file names ==
     
    141129This reports the total number of floating-point and integer operations since the start of the result. It must be called just before boinc_finish(), and optionally at intermediate points.
    142130
     131== Reporting progress ==
     132
     133The core client GUI displays the percent done of workunits in progress. To keep this display current, an application should periodically call
     134
     135{{{
     136boinc_fraction_done(double fraction_done);
     137}}}
     138
     139The `fraction_done` argument is an estimate of the workunit fraction complete (0 to 1). This function is fast and can be called frequently. The sequence of arguments in successive calls should be non-decreasing. An application should never 'reset' and start over if an error occurs; it should exit with an error code.
     140
     141{{{
     142double boinc_get_fraction_done();
     143}}}
     144
     145returns the last value set, or `-1` if none has been set (this would typically be called from graphics code).
     146
    143147== Communicating with the core client ==
    144 
    145 The core client GUI displays the percent done of workunits in progress. To keep this display current, an application should periodically call
    146 
    147 {{{
    148 boinc_fraction_done(double fraction_done);
    149 }}}
    150 
    151 The `fraction_done` argument is an estimate of the workunit fraction complete (0 to 1). This function is fast and can be called frequently. The sequence of arguments in successive calls should be non-decreasing. An application should never 'reset' and start over if an error occurs; it should exit with an error code.
    152 
    153 {{{
    154 double boinc_get_fraction_done();
    155 }}}
    156 
    157 returns the last value set, or `-1` if none has been set (this would typically be called from graphics code).
    158148
    159149The following functions get information from the core client; this information may be useful for graphics.
     
    231221to get its total CPU time (from the beginning of the work unit, not just since the last restart). This excludes CPU time used to render graphics.
    232222
     223== Is your application running standalone? ==
     224
     225BOINC applications can be run in "standalone" mode for testing, or under the control of the BOINC client. You might want your application to behave differently in the two cases. For example you might want to output debugging information if the application is running standalone. To determine if the application is running in standalone mode or under the control of the BOINC client, call
     226
     227{{{
     228int boinc_is_standalone(void);
     229}}}
     230
     231This returns non-zero (True) if the application is running standalone, and zero (False) if the application is running under the control of the BOINC client.
     232
    233233== Requesting network connection ==
    234234
    235 If it appears that there is no physical network connection (e.g. gethostbyname() fails for a valid name) then:
     235If your application needs to do network communication and it appears that there is no physical network connection (e.g. gethostbyname() fails for a valid name) then:
    236236
    237237    * Call `boinc_need_network()`. This will alert the user that a network connection is needed.
     
    245245void boinc_network_done();
    246246}}}
    247 
    248 Note: this should be enclosed in `boinc_not_using_cpu() ... boinc_using_cpu()`.