", intops_cumulative)) continue;
else scope_messages.printf("RESULT::parse(): unrecognized: %s\n", buf);
}
return ERR_XML_PARSE;
@@ -1314,14 +1318,16 @@ int RESULT::write(MIOFILE& out, bool to_server) {
state
);
if (fpops_per_cpu_sec) {
- out.printf(
- " %f\n", fpops_per_cpu_sec
- );
+ out.printf(" %f\n", fpops_per_cpu_sec);
}
if (fpops_cumulative) {
- out.printf(
- " %f\n", fpops_cumulative
- );
+ out.printf(" %f\n", fpops_cumulative);
+ }
+ if (intops_per_cpu_sec) {
+ out.printf(" %f\n", intops_per_cpu_sec);
+ }
+ if (intops_cumulative) {
+ out.printf(" %f\n", intops_cumulative);
}
if (to_server) {
out.printf(
diff --git a/client/client_types.h b/client/client_types.h
index 7b4b7a96a8..97fddc819d 100644
--- a/client/client_types.h
+++ b/client/client_types.h
@@ -407,6 +407,8 @@ struct RESULT {
double final_cpu_time;
double fpops_per_cpu_sec; // nonzero if reported by app
double fpops_cumulative; // nonzero if reported by app
+ double intops_per_cpu_sec; // nonzero if reported by app
+ double intops_cumulative; // nonzero if reported by app
int state; // state of this result: see lib/result_state.h
int exit_status; // return value from the application
std::string stderr_out;
diff --git a/db/boinc_db.h b/db/boinc_db.h
index ce1249d7a2..9f624a7c14 100755
--- a/db/boinc_db.h
+++ b/db/boinc_db.h
@@ -437,6 +437,8 @@ struct RESULT {
char wu_name[256];
double fpops_per_cpu_sec;
double fpops_cumulative;
+ double intops_per_cpu_sec;
+ double intops_cumulative;
int parse_from_client(FILE*);
void clear();
};
diff --git a/doc/api.php b/doc/api.php
index bcf9216320..1bc7011967 100644
--- a/doc/api.php
+++ b/doc/api.php
@@ -149,14 +149,14 @@ 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);
+void boinc_ops_per_cpu_second(double floating_point_ops, double integer_ops);
This reports the results of an application-specific benchmark,
-expressed as number of floating-point operations per CPU second.
+expressed as number of floating-point and integer operations per CPU second.
-void boinc_fpops_cumulative(double);
+void boinc_ops_cumulative(double floating_point_ops, double integer_ops);
-This reports the total number of floating-point operations
+This reports the total number of floating-point and integer operations
since the start of the result.
It must be called just before boinc_finish(),
and optionally at intermediate points.
diff --git a/sched/handle_request.C b/sched/handle_request.C
index 9c30bec390..6233e4b47a 100644
--- a/sched/handle_request.C
+++ b/sched/handle_request.C
@@ -325,8 +325,10 @@ static void compute_credit_rating(HOST& host) {
host.credit_per_cpu_sec = x;
}
-static double fpops_to_credit(double fpops) {
- return (fpops/1e9)*COBBLESTONE_FACTOR/SECONDS_PER_DAY;
+static double fpops_to_credit(double fpops, double intops) {
+ double fpc = (fpops/1e9)*COBBLESTONE_FACTOR/SECONDS_PER_DAY;
+ double intc = (intops/1e9)*COBBLESTONE_FACTOR/SECONDS_PER_DAY;
+ return std::max(fpc, intc);
}
// modify host struct based on request.
@@ -611,10 +613,13 @@ int handle_results(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
srip->exit_status = rp->exit_status;
srip->app_version_num = rp->app_version_num;
- 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*srip->cpu_time);
+ if (rp->fpops_cumulative || rp->intops_cumulative) {
+ srip->claimed_credit = fpops_to_credit(rp->fpops_cumulative, rp->intops_cumulative);
+ } else if (rp->fpops_per_cpu_sec || rp->intops_per_cpu_sec) {
+ srip->claimed_credit = fpops_to_credit(
+ rp->fpops_per_cpu_sec*srip->cpu_time,
+ rp->intops_per_cpu_sec*srip->cpu_time
+ );
} else {
srip->claimed_credit = srip->cpu_time * reply.host.credit_per_cpu_sec;
}
diff --git a/sched/server_types.C b/sched/server_types.C
index 1b69c560d4..4f720196c2 100644
--- a/sched/server_types.C
+++ b/sched/server_types.C
@@ -712,6 +712,8 @@ int RESULT::parse_from_client(FILE* fin) {
else if (parse_int(buf, "", app_version_num)) continue;
else if (parse_double(buf, "", fpops_per_cpu_sec)) continue;
else if (parse_double(buf, "", fpops_cumulative)) continue;
+ else if (parse_double(buf, "", intops_per_cpu_sec)) continue;
+ else if (parse_double(buf, "", intops_cumulative)) continue;
else if (match_tag(buf, "")) {
safe_strcat(xml_doc_out, buf);
while (fgets(buf, 256, fin)) {