From 553ffa1a5b2b461f1a05a4562d88751052b2852f Mon Sep 17 00:00:00 2001 From: Laurent Clouet Date: Tue, 9 Jun 2015 20:16:12 +0100 Subject: [PATCH] On the job request, send the number of available cpu for rendering --- protocol.txt | 1 + src/com/sheepit/client/Server.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/protocol.txt b/protocol.txt index 1dc7fc7..826caf4 100644 --- a/protocol.txt +++ b/protocol.txt @@ -76,6 +76,7 @@ On error: an 404 http code Url: use the request type "request-job" from the configuration answer. Parameter as GET or POST: * computemethod: What are my computer capability, 0 for using gpu and cpu (the computer is capable of using both but it will not use it at the same time), 1 for cpu only, 2 for gpu only. + * cpu_cores: Number of cores currently available for rendering (optional). Answer in case of error: diff --git a/src/com/sheepit/client/Server.java b/src/com/sheepit/client/Server.java index 6bf5110..edced25 100644 --- a/src/com/sheepit/client/Server.java +++ b/src/com/sheepit/client/Server.java @@ -275,7 +275,8 @@ public class Server extends Thread implements HostnameVerifier, X509TrustManager HttpURLConnection connection = null; try { - String url = String.format("%s?computemethod=%s", this.getPage("request-job"), this.user_config.computeMethodToInt()); + OS os = OS.getOS(); + String url = String.format("%s?computemethod=%s&cpu_cores=%s", this.getPage("request-job"), this.user_config.computeMethodToInt(), ((this.user_config.getNbCores() == -1) ? os.getCPU().cores() : this.user_config.getNbCores())); if (this.user_config.getComputeMethod() != ComputeType.CPU && this.user_config.getGPUDevice() != null) { String gpu_model = ""; try {