| 62 | | |
| 63 | | == Miscellaneous data == |
| 64 | | |
| 65 | | The following functions return miscellaneous data: |
| 66 | | |
| 67 | | {{{ |
| 68 | | #!c++ |
| 69 | | int boinc_get_init_data_p(APP_INIT_DATA*); |
| 70 | | int boinc_get_init_data(APP_INIT_DATA&); |
| 71 | | |
| 72 | | struct APP_INIT_DATA { |
| 73 | | int major_version; |
| 74 | | int minor_version; |
| 75 | | int release; |
| 76 | | int app_version; |
| 77 | | char app_name[256]; |
| 78 | | char symstore[256]; |
| 79 | | char acct_mgr_url[256]; |
| 80 | | char* project_preferences; |
| 81 | | int hostid; |
| 82 | | char user_name[256]; |
| 83 | | char team_name[256]; |
| 84 | | char project_dir[256]; |
| 85 | | char boinc_dir[256]; |
| 86 | | char wu_name[256]; |
| 87 | | char authenticator[256]; |
| 88 | | int slot; |
| 89 | | double user_total_credit; |
| 90 | | double user_expavg_credit; |
| 91 | | double host_total_credit; |
| 92 | | double host_expavg_credit; |
| 93 | | double resource_share_fraction; |
| 94 | | HOST_INFO host_info; |
| 95 | | PROXY_INFO proxy_info; // in case app wants to use network |
| 96 | | GLOBAL_PREFS global_prefs; |
| 97 | | double starting_elapsed_time; |
| 98 | | |
| 99 | | // info about the WU |
| 100 | | double rsc_fpops_est; |
| 101 | | double rsc_fpops_bound; |
| 102 | | double rsc_memory_bound; |
| 103 | | double rsc_disk_bound; |
| 104 | | |
| 105 | | // the following are used for compound apps, |
| 106 | | // where each stage of the computation is a fixed |
| 107 | | // fraction of the total. |
| 108 | | double fraction_done_start; |
| 109 | | double fraction_done_end; |
| 110 | | }; |
| 111 | | }}} |
| 112 | | |
| 113 | | to get the following information: |
| 114 | | |
| 115 | | ||'''core version'''||The version number of the core client|| |
| 116 | | ||'''app_name'''||The application name (from the server's DB)|| |
| 117 | | ||'''project_preferences'''||An XML string containing the user's project-specific preferences.|| |
| 118 | | ||'''user_name'''||The user's 'screen name' on this project.|| |
| 119 | | ||'''team_name'''||The user's team name, if any.|| |
| 120 | | ||'''project_dir'''||Absolute path of project directory|| |
| 121 | | ||'''boinc_dir'''||Absolute path of BOINC root directory|| |
| 122 | | ||'''wu_name'''||Name of workunit being processed|| |
| 123 | | ||'''authenticator'''||User's authenticator for this project|| |
| 124 | | ||'''slot'''||The number of the app's 'slot'|| |
| 125 | | ||'''user_total_credit'''||User's total work for this project.|| |
| 126 | | ||'''user_expavg_credit'''||User's recent average work per day.|| |
| 127 | | ||'''team_total_credit'''||Team's total work for this project.|| |
| 128 | | ||'''team_expavg_credit'''||Team's recent average work per day.|| |
| 129 | | ||'''host_info'''||A structure describing the host hardware and OS|| |
| 130 | | ||'''starting_elapsed_time'''||Elapsed time, counting previous episodes (provided only by 6.10 and later clients)|| |
| 131 | | |
| 132 | | == Getting the status of the runtime system == |
| 133 | | |
| 134 | | The status of the runtime system is represented by the following structure: |
| 135 | | {{{ |
| 136 | | typedef struct BOINC_STATUS { |
| 137 | | int no_heartbeat; |
| 138 | | int suspended; |
| 139 | | int quit_request; |
| 140 | | int reread_init_data_file; |
| 141 | | int abort_request; |
| 142 | | double working_set_size; |
| 143 | | double max_working_set_size; |
| 144 | | int network_suspended; |
| 145 | | } BOINC_STATUS; |
| 146 | | }}} |
| 147 | | |
| 148 | | You can get the current status using |
| 149 | | |
| 150 | | {{{ |
| 151 | | void boinc_get_status(BOINC_STATUS*); |
| 152 | | }}} |