public override bool PostToJobManager(JobManagerDispatch manager) { if (this.Interpreters == null) { throw new InvalidOperationException("Call RunInterpreters method first."); } bool success = true; if (this.Interpreters.All(i => i.result.Success)) { foreach (var interpreter in this.Interpreters) { string runCommand = interpreter.result.RunCommand; string title = string.Empty; string testbenchName = string.Empty; string workingDirectory = interpreter.MainParameters.OutputDirectory; string projectDirectory = ProjectDirectory; string interpreterName = interpreter.Name.StartsWith("MGA.Interpreter.") ? interpreter.Name.Substring("MGA.Interpreter.".Length) : interpreter.Name; title = String.Format("{0}_{1}", interpreterName, this.expandedTestBenchType.Name).Replace(" ", "_"); testbenchName = this.testBenchType.Name; // JobManager will run python.exe -m testbenchexecutor if testbench_manifest.json exists, which will run all the steps if (!File.Exists(Path.Combine(interpreter.MainParameters.OutputDirectory, "testbench_manifest.json")) || interpreter == this.Interpreters.Last()) { success = success && manager.EnqueueJob(runCommand, title, testbenchName, workingDirectory, projectDirectory, interpreter); } } } // TODO: should this be inside the Dispatch and triggred by a timer ??? manager.AddJobs(); if (this.Interpreters.Count == 0) { success = false; } return(success); }
public override bool PostToJobManager(JobManagerDispatch manager) { if (this.Interpreters == null) { throw new InvalidOperationException("Call RunInterpreters method first."); } bool success = true; foreach (var interpreter in this.Interpreters) { // TODO: what if some of them failed ??? if (interpreter.result.Success) { string runCommand = interpreter.result.RunCommand; string title = string.Empty; string testbenchName = string.Empty; string workingDirectory = interpreter.MainParameters.OutputDirectory; string interpreterName = interpreter.Name.StartsWith("MGA.Interpreter.") ? interpreter.Name.Substring("MGA.Interpreter.".Length) : interpreter.Name; title = String.Format("{0}_{1}", interpreterName, this.expandedParametricExploration.Name).Replace(" ", "_"); testbenchName = this.parametricExploration.Name; success = success && manager.EnqueueJob(runCommand, title, testbenchName, workingDirectory, ProjectDirectory, interpreter); } } // TODO: should this be inside the Dispatch and triggred by a timer ??? manager.AddJobs(); if (this.Interpreters.Count == 0) { success = false; } return(success); }