示例#1
0
        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 ???
                // TODO: can be more than one ???
                if (interpreter.result.Success)
                {
                    string workingDirectory = interpreter.MainParameters.OutputDirectory;

                    success = success && manager.EnqueueSoT(workingDirectory, ProjectDirectory);
                }
            }

            // TODO: should this be inside the Dispatch and triggred by a timer ???
            manager.AddSoTs();


            if (this.Interpreters.Count == 0)
            {
                success = false;
            }

            return(success);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        public override bool PostToJobManager(JobManagerDispatch manager = null)
        {
            if (this.Interpreters == null)
            {
                throw new InvalidOperationException("Call RunInterpreters method first.");
            }

            if (manager == null)
            {
                manager = new JobManagerDispatch();
            }

            bool success = true;

            foreach (var interpreter in this.Interpreters)
            {
                // TODO: what if some of them failed ???
                // TODO: can be more than one ???
                if (interpreter.result.Success)
                {
                    string workingDirectory = interpreter.MainParameters.OutputDirectory;

                    success = success && manager.EnqueueSoT(workingDirectory);
                }
            }

            // TODO: should this be inside the Dispatch and triggred by a timer ???
            manager.AddSoTs();


            if (this.Interpreters.Count == 0)
            {
                success = false;
            }

            return success;
        }
 /// <summary>
 /// Posts the generated analysis packages to the JobManager for execution.
 /// </summary>
 /// <param name="manager">JobManager instance to post the job to.</param>
 /// <returns>True if job was posted successfully, otherwise false</returns>
 public abstract bool PostToJobManager(JobManagerDispatch manager);
示例#6
0
 /// <summary>
 /// Posts the generated analysis packages to the JobManager for execution.
 /// </summary>
 /// <param name="manager">JobManager instance to post the job to.</param>
 /// <returns>True if job was posted successfully, otherwise false</returns>
 public abstract bool PostToJobManager(JobManagerDispatch manager);
        public override bool PostToJobManager(JobManagerDispatch manager = null)
        {
            if (this.Interpreters == null)
            {
                throw new InvalidOperationException("Call RunInterpreters method first.");
            }

            if (manager == null)
            {
                manager = new JobManagerDispatch();
            }

            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
                        .Children
                        .TestBenchRefCollection
                        .FirstOrDefault()
                        .Referred
                        .TestBenchType
                        .Name;

                    success = success && manager.EnqueueJob(runCommand, title, testbenchName, workingDirectory, interpreter);
                }
            }

            // TODO: should this be inside the Dispatch and triggred by a timer ???
            manager.AddJobs();


            if (this.Interpreters.Count == 0)
            {
                success = false;
            }

            return success;
        }