close()
.
This lets you write output files and state files more or less atomically.
++By default, the credit assigned to a result is based on +the product of its total CPU time and +benchmarks run by the core client. +This can produce results that are too low if +the application uses processor-specific optimizations +not present in the core client, +is compiled with different compiler settings, +or uses a GPU or other non-CPU computing resource. +To handle such cases, the following functions can be used. +
+void boinc_fpops_per_cpu_second(double); ++This reports the results of an application-specific benchmark, +expressed as number of floating-point operations per CPU second. +
+void boinc_fpops_cumulative(double); ++This reports the total number of floating-point operations +since the start of the result. +It must be called just before boinc_finish(), +and optionally at intermediate points. +
The core client GUI displays the percent done of workunits in progress. diff --git a/doc/build_system.php b/doc/build_system.php index 069d8bc616..7026956a31 100644 --- a/doc/build_system.php +++ b/doc/build_system.php @@ -28,7 +28,7 @@ To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. Example: to compile BOINC with strict compiler warnings, use
-./configure CXXFLAGS=\"-Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -fno-common -Wnested-externs\" +./configure CXXFLAGS=\"-Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -fno-common \"
diff --git a/sched/handle_request.C b/sched/handle_request.C
index e1d55110d1..f3f7fa5c2d 100644
--- a/sched/handle_request.C
+++ b/sched/handle_request.C
@@ -324,7 +324,6 @@ make_new_host:
//
if (strlen(sreq.cross_project_id)) {
if (strcmp(sreq.cross_project_id, reply.user.cross_project_id)) {
- DB_USER user;
user.id = reply.user.id;
escape_string(sreq.cross_project_id, sizeof(sreq.cross_project_id));
sprintf(buf, "cross_project_id='%s'", sreq.cross_project_id);
@@ -335,14 +334,19 @@ make_new_host:
return 0;
}
+#define COBBLESTONE_FACTOR 100.0
+
// somewhat arbitrary formula for credit as a function of CPU time.
// Could also include terms for RAM size, network speed etc.
//
static void compute_credit_rating(HOST& host) {
- double cobblestone_factor = 100;
host.credit_per_cpu_sec =
(fabs(host.p_fpops)/1e9 + fabs(host.p_iops)/1e9)
- * cobblestone_factor / (2 * SECONDS_PER_DAY);
+ * COBBLESTONE_FACTOR / (2 * SECONDS_PER_DAY);
+}
+
+static double fpops_to_credit(double fpops) {
+ return (fpops/1e9)*COBBLESTONE_FACTOR/SECONDS_PER_DAY;
}
// modify host struct based on request.
@@ -599,7 +603,13 @@ int handle_results(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
srip->cpu_time = rp->cpu_time;
srip->exit_status = rp->exit_status;
srip->app_version_num = rp->app_version_num;
- srip->claimed_credit = rp->cpu_time * reply.host.credit_per_cpu_sec;
+ if (rp->fpops_cumulative) {
+ srip->claimed_credit = fpops_to_credit(rp->fpops_cumulative);
+ } else if (rp->fpops_per_cpu_sec) {
+ srip->claimed_credit = fpops_to_credit(rp->fpops_per_cpu_sec*rp->cpu_time);
+ } else {
+ srip->claimed_credit = rp->cpu_time * reply.host.credit_per_cpu_sec;
+ }
#ifdef EINSTEIN_AT_HOME
log_messages.printf(SCHED_MSG_LOG::DEBUG,
"cpu %f cpcs %f, cc %f\n", srip->cpu_time, reply.host.credit_per_cpu_sec, srip->claimed_credit
diff --git a/sched/sched_shmem.C b/sched/sched_shmem.C
index 0cdf9075e5..1f6f630160 100644
--- a/sched/sched_shmem.C
+++ b/sched/sched_shmem.C
@@ -50,7 +50,7 @@ void SCHED_SHMEM::init() {
nwu_results = MAX_WU_RESULTS;
}
-static int error_return(char* p) {
+static int error_return(const char* p) {
fprintf(stderr, "Error in structure: %s\n", p);
return ERR_SCHED_SHMEM;
}
diff --git a/sched/server_types.C b/sched/server_types.C
index a18b94be7a..92e8ed3115 100644
--- a/sched/server_types.C
+++ b/sched/server_types.C
@@ -620,6 +620,8 @@ int RESULT::parse_from_client(FILE* fin) {
else if (parse_double(buf, "