Changes between Version 34 and Version 35 of BasicApi


Ignore:
Timestamp:
May 29, 2011, 8:32:52 PM (13 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BasicApi

    v34 v35  
    1616
    1717{{{
    18 BOINC_OPTIONS options;
    19 
    20 boinc_options_defaults(options);
    21 options.multi_thread = true;    // include this if your app's main process uses multiple threads
    22 options.multi_process = true;   // include this if your app uses multiple processes
    23 
    24 boinc_init_options(&options);
     18boinc_init();
    2519}}}
    2620
    2721Do not create any threads or store the current PID
    28 before calling '''boinc_init_options()'''.
     22before calling '''boinc_init()'''.
    2923
    3024When the application has completed it must call
     
    8579}}}
    8680
    87 This deals with platform-specific problems. On Windows, where security and indexing programs can briefly lock files, `boinc_fopen()` does several retries at 1-second intervals. On Unix, where signals can cause `fopen()` to fail with `EINTR`, `boinc_fopen` checks for this and does a few retries; it also sets the 'close-on-exec' flag.
     81This deals with platform-specific problems.
     82On Windows, where security and indexing programs can briefly lock files,
     83`boinc_fopen()` does several retries at 1-second intervals.
     84On Unix, where signals can cause `fopen()` to fail with `EINTR`,
     85`boinc_fopen` checks for this and does a few retries; it also sets the 'close-on-exec' flag.
    8886
    8987== Checkpointing == #checkpointing
     
    169167An application should never 'reset' and start over if an error occurs; it should exit with an error code.
    170168
    171 == Miscellaneous data ==
    172 
    173 The following functions return miscellaneous data:
    174 
    175 {{{
    176 #!c++
    177 int boinc_get_init_data_p(APP_INIT_DATA*);
    178 int boinc_get_init_data(APP_INIT_DATA&);
    179 
    180 struct APP_INIT_DATA {
    181     int major_version;
    182     int minor_version;
    183     int release;
    184     int app_version;
    185     char app_name[256];
    186     char symstore[256];
    187     char acct_mgr_url[256];
    188     char* project_preferences;
    189     int hostid;
    190     char user_name[256];
    191     char team_name[256];
    192     char project_dir[256];
    193     char boinc_dir[256];
    194     char wu_name[256];
    195     char authenticator[256];
    196     int slot;
    197     double user_total_credit;
    198     double user_expavg_credit;
    199     double host_total_credit;
    200     double host_expavg_credit;
    201     double resource_share_fraction;
    202     HOST_INFO host_info;
    203     PROXY_INFO proxy_info;  // in case app wants to use network
    204     GLOBAL_PREFS global_prefs;
    205     double starting_elapsed_time;
    206 
    207     // info about the WU
    208     double rsc_fpops_est;
    209     double rsc_fpops_bound;
    210     double rsc_memory_bound;
    211     double rsc_disk_bound;
    212 
    213     // the following are used for compound apps,
    214     // where each stage of the computation is a fixed
    215     // fraction of the total.
    216     double fraction_done_start;
    217     double fraction_done_end;
    218 };
    219 }}}
    220 
    221 to get the following information:
    222 
    223 ||'''core version'''||The version number of the core client||
    224 ||'''app_name'''||The application name (from the server's DB)||
    225 ||'''project_preferences'''||An XML string containing the user's project-specific preferences.||
    226 ||'''user_name'''||The user's 'screen name' on this project.||
    227 ||'''team_name'''||The user's team name, if any.||
    228 ||'''project_dir'''||Absolute path of project directory||
    229 ||'''boinc_dir'''||Absolute path of BOINC root directory||
    230 ||'''wu_name'''||Name of workunit being processed||
    231 ||'''authenticator'''||User's authenticator for this project||
    232 ||'''slot'''||The number of the app's 'slot'||
    233 ||'''user_total_credit'''||User's total work for this project.||
    234 ||'''user_expavg_credit'''||User's recent average work per day.||
    235 ||'''team_total_credit'''||Team's total work for this project.||
    236 ||'''team_expavg_credit'''||Team's recent average work per day.||
    237 ||'''host_info'''||A structure describing the host hardware and OS||
    238 ||'''starting_elapsed_time'''||Elapsed time, counting previous episodes (provided only by 6.10 and later clients)||
     169
    239170
    240171== Timing information ==