diff --git a/db/db.h b/db/db.h index 98f3cf7467..34192eac3a 100644 --- a/db/db.h +++ b/db/db.h @@ -29,6 +29,7 @@ #include +// Maximum allowed size for SQL based blobs (Binary Large Object) #define MAX_BLOB_SIZE 4096 // A compilation target, i.e. a architecture/OS combination. @@ -40,8 +41,8 @@ // struct PLATFORM { int id; - unsigned int create_time; - char name[256]; + unsigned int create_time; // UNIX time of record creation + char name[256]; // Platform name (i.e. "sparc-sun-solaris2.7") }; // An application. @@ -49,11 +50,11 @@ struct PLATFORM { // struct APP { int id; - unsigned int create_time; - char name[256]; // preferably short - int alpha_vers; - int beta_vers; - int prod_vers; + unsigned int create_time; // UNIX time of record creation + char name[256]; // application name (i.e. "setiathome_4.0"), preferably short + int alpha_vers; // Alpha version number + int beta_vers; // Beta version number + int prod_vers; // Production version number char result_xml_template[MAX_BLOB_SIZE]; // if any workunits have dynamic results, // XML template for results comes from here @@ -67,10 +68,10 @@ struct APP { // struct APP_VERSION { int id; - unsigned int create_time; - int appid; - int version_num; - int platformid; + unsigned int create_time; // UNIX time of record creation + int appid; // id of APP record associated with this APP_VERSION + int version_num; // Version number + int platformid; // id of PLATFORM record associated with this APP_VERSION // describes app files. format: // ... @@ -101,18 +102,19 @@ struct APP_VERSION { struct USER { int id; - unsigned int create_time; - char email_addr[256]; - char name[256]; - char web_password[256]; - char authenticator[256]; - char country[256]; - char postal_code[256]; + unsigned int create_time; // UNIX time of record creation + char email_addr[256]; // User email address + char name[256]; // User name + char web_password[256]; // User specifiable web password + char authenticator[256]; // Authenticator string, used to confirm email + // address when signing up for a project + char country[256]; // User country (selected from a list in countries.C) + char postal_code[256]; // User postal code double total_credit; double expavg_credit; // exponenially averaged credit int expavg_time; // last time the above was computed - char prefs[MAX_BLOB_SIZE]; - unsigned int prefs_mod_time; + char prefs[MAX_BLOB_SIZE]; // Raw XML preferences data + unsigned int prefs_mod_time; // When the preferences were last updated int teamid; //if the user is part of a team }; @@ -128,22 +130,22 @@ struct USER { struct TEAM { int id; - int userid; - char name[256]; - char name_lc[256]; - char url[256]; - int type; - char name_html[256]; + int userid; // User ID of team founder + char name[256]; // Team name + char name_lc[256]; // Team name in lowercase (used for searching) + char url[256]; // URL of team + int type; // Team type (company, club, etc, see above definitions) + char name_html[256]; // char description[256]; int nusers; }; struct HOST { int id; - unsigned int create_time; - int userid; + unsigned int create_time; // UNIX time of record creation + int userid; // ID of user running this host int rpc_seqno; // last seqno received from client - unsigned int rpc_time; + unsigned int rpc_time; // UNIX time of last scheduler RPC // all remaining items are assigned by the client int timezone; @@ -152,30 +154,30 @@ struct HOST { char last_ip_addr[256]; int nsame_ip_addr; - double on_frac; - double connected_frac; - double active_frac; + double on_frac; // Fraction of the time (0-1) that the host is on + double connected_frac; // Fraction of time that host is connected + double active_frac; // Fraction of time that host is actively doing tasks - int p_ncpus; - char p_vendor[256]; - char p_model[256]; - double p_fpops; - double p_iops; - double p_membw; + int p_ncpus; // Number of CPUs on host + char p_vendor[256]; // Vendor name of host CPU + char p_model[256]; // Model of host CPU + double p_fpops; // Approximate flop speed of host CPU + double p_iops; // Approximate integer op/sec speed of host CPU + double p_membw; // Approximate memory bandwidth of host double p_calculated; - char os_name[256]; - char os_version[256]; + char os_name[256]; // Name of host operating system + char os_version[256]; // Version of host operating system - double m_nbytes; - double m_cache; - double m_swap; + double m_nbytes; // Size of host memory in bytes + double m_cache; // Size of CPU cache in bytes (L1 or L2?) + double m_swap; // Size of host swap space in bytes - double d_total; + double d_total; // Total disk space double d_free; - double n_bwup; - double n_bwdown; + double n_bwup; // Average upload bandwidth for host + double n_bwdown; // Average download bandwidth for host int parse(FILE*); int parse_time_stats(FILE*); @@ -184,11 +186,11 @@ struct HOST { struct WORKUNIT { int id; - unsigned int create_time; - int appid; + unsigned int create_time; // UNIX time of record creation + int appid; // ID of APP record tied to this workunit int previous_wuid; bool has_successor; - char name[256]; + char name[256]; // Name of the workunit char xml_doc[MAX_BLOB_SIZE]; int batch; double rsc_fpops; // estimated # of FP operations @@ -216,16 +218,16 @@ struct WORKUNIT { struct RESULT { int id; - unsigned int create_time; - int workunitid; - int state; - int hostid; - unsigned int report_deadline; - unsigned int sent_time; - unsigned int received_time; - char name[256]; - int exit_status; - double cpu_time; + unsigned int create_time; // UNIX time of record creation + int workunitid; // ID of the workunit tied to this result + int state; // Current state of the processing for this result + int hostid; // ID of host currently processing this result + unsigned int report_deadline; // UNIX time deadline for receiving result + unsigned int sent_time; // UNIX time that result request was sent to host + unsigned int received_time; // UNIX time that result data was received from host + char name[256]; // Name of result + int exit_status; // Final exit status of application that processed result + double cpu_time; // Total CPU time required to complete result char xml_doc_in[MAX_BLOB_SIZE]; // descriptions of output files char xml_doc_out[MAX_BLOB_SIZE]; // MD5s of output files char stderr_out[MAX_BLOB_SIZE]; // stderr output, if any