wiki:StatusApi

Version 1 (modified by davea, 13 years ago) (diff)

--

Startup and status data

Getting startup data

The following functions return startup data:

int boinc_get_init_data_p(APP_INIT_DATA*);
int boinc_get_init_data(APP_INIT_DATA&);

struct APP_INIT_DATA {
    int major_version;
    int minor_version;
    int release;
    int app_version;
    char app_name[256];
    char symstore[256];
    char acct_mgr_url[256];
    char* project_preferences;
    int hostid;
    char user_name[256];
    char team_name[256];
    char project_dir[256];
    char boinc_dir[256];
    char wu_name[256];
    char authenticator[256];
    int slot;
    double user_total_credit;
    double user_expavg_credit;
    double host_total_credit;
    double host_expavg_credit;
    double resource_share_fraction;
    HOST_INFO host_info;
    PROXY_INFO proxy_info;  // in case app wants to use network
    GLOBAL_PREFS global_prefs;
    double starting_elapsed_time;

    // info about the WU
    double rsc_fpops_est;
    double rsc_fpops_bound;
    double rsc_memory_bound;
    double rsc_disk_bound;

    // the following are used for compound apps,
    // where each stage of the computation is a fixed
    // fraction of the total.
    double fraction_done_start;
    double fraction_done_end;
};

to get the following information:

core versionThe version number of the core client
app_nameThe application name (from the server's DB)
project_preferencesAn XML string containing the user's project-specific preferences.
user_nameThe user's 'screen name' on this project.
team_nameThe user's team name, if any.
project_dirAbsolute path of project directory
boinc_dirAbsolute path of BOINC root directory
wu_nameName of workunit being processed
authenticatorUser's authenticator for this project
slotThe number of the app's 'slot'
user_total_creditUser's total work for this project.
user_expavg_creditUser's recent average work per day.
team_total_creditTeam's total work for this project.
team_expavg_creditTeam's recent average work per day.
host_infoA structure describing the host hardware and OS
starting_elapsed_timeElapsed time, counting previous episodes (provided only by 6.10 and later clients)

Getting runtime system status

The status of the runtime system is represented by the following structure:

typedef struct BOINC_STATUS {
    int no_heartbeat;
    int suspended;
    int quit_request;
    int reread_init_data_file;
    int abort_request;
    double working_set_size;
    double max_working_set_size;
    int network_suspended;
} BOINC_STATUS;

no_heartbeat:: no heartbeat from client; clean up and exit(0). suspended:: the client has requested that we suspend ourself. quit_request:: the client has requested that we exit (will restart). reread_init_data_file: project preferences have changed; reread them if needed. abort_request: the client has request that we abort (no restart). working_set_size:: our current working-set size max_working_set_size:: the amount of available RAM network_suspended:: set of network activity is not currently allowed

You can get the current status using

void boinc_get_status(BOINC_STATUS*);