Bugfix: store the number of cpu cores on Job object because it might be changed by the user between the start and end of render
This commit is contained in:
@@ -622,8 +622,9 @@ public class Client {
|
||||
|
||||
protected Error.Type confirmJob(Job ajob) {
|
||||
String extras_config = "";
|
||||
if (this.config.getNbCores() > 0) {
|
||||
extras_config = "&cores=" + this.config.getNbCores();
|
||||
RenderProcess process = ajob.getProcessRender();
|
||||
if (process != null && process.getCoresUsed() > 0) {
|
||||
extras_config = "&cores=" + process.getCoresUsed();
|
||||
}
|
||||
|
||||
String url_real = String.format("%s?job=%s&frame=%s&rendertime=%d&revision=%s&memoryused=%s&extras=%s%s", this.server.getPage("validate-job"), ajob.getId(), ajob.getFrameNumber(), ajob.getProcessRender().getDuration(), ajob.getRevision(), ajob.getProcessRender().getMemoryUsed(), ajob.getExtras(), extras_config);
|
||||
|
||||
@@ -263,6 +263,7 @@ public class Job {
|
||||
String line;
|
||||
log.debug(command.toString());
|
||||
OS os = OS.getOS();
|
||||
process.setCoresUsed(config.getNbCores());
|
||||
process.start();
|
||||
getProcessRender().setProcess(os.exec(command, new_env));
|
||||
BufferedReader input = new BufferedReader(new InputStreamReader(getProcessRender().getProcess().getInputStream()));
|
||||
|
||||
@@ -26,6 +26,7 @@ public class RenderProcess {
|
||||
private long end;
|
||||
private int remainingDuration;
|
||||
private long memoryUsed; // in kB
|
||||
private int coresUsed;
|
||||
private Process process;
|
||||
|
||||
public RenderProcess() {
|
||||
@@ -33,6 +34,7 @@ public class RenderProcess {
|
||||
start = -1;
|
||||
end = -1;
|
||||
memoryUsed = 0;
|
||||
coresUsed = 0;
|
||||
remainingDuration = 0;
|
||||
}
|
||||
|
||||
@@ -44,6 +46,14 @@ public class RenderProcess {
|
||||
return memoryUsed;
|
||||
}
|
||||
|
||||
public void setCoresUsed(int val) {
|
||||
coresUsed = val;
|
||||
}
|
||||
|
||||
public int getCoresUsed() {
|
||||
return coresUsed;
|
||||
}
|
||||
|
||||
public long getStartTime() {
|
||||
return start;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user