protected override IEnumerable <TaskSpecifier> Split(IJob job, JobSplitSettings settings) { var tasks = new List <TaskSpecifier>(); double low = Double.Parse(job.Parameters["low"]); double high = Double.Parse(job.Parameters["high"]); int num = Int32.Parse(job.Parameters["steps"]); double omega = 1.5; if (job.Parameters.Select(par => par.Key).Contains("omega")) { omega = Double.Parse(job.Parameters["omega"]); } double step = (high - low) / num; for (double x = low; x <= high; x += step) { tasks.Add(new TaskSpecifier { Parameters = new Dictionary <string, string> { { "l0", x.ToString() }, { "omega", omega.ToString() } } }); } return(tasks); }
protected override IEnumerable<TaskSpecifier> Split(IJob job, JobSplitSettings settings) { // Iterate through each of the video files that have been passed in // and create a task for each one. foreach (var file in job.Files) { yield return new TaskSpecifier { RequiredFiles = new[] { file }, // The single video file for this iteration so this task will process that one video Parameters = job.Parameters, }; } }
/// <summary> /// Splits a job into more granular tasks to be processed in parallel. /// </summary> /// <param name="job">The job to be split.</param> /// <param name="settings">Contains information and services about the split request.</param> /// <returns>A sequence of tasks to be run on compute nodes.</returns> protected override IEnumerable <TaskSpecifier> Split(IJob job, JobSplitSettings settings) { var jobParameters = BlenderParameters.FromJob(job); if (!jobParameters.Valid) { Log.Error(jobParameters.ErrorText); throw new InvalidParameterException(jobParameters.ErrorText); } for (var i = jobParameters.Start; i <= jobParameters.End; i++) { yield return(new TaskSpecifier { TaskIndex = i, Parameters = job.Parameters, RequiredFiles = job.Files, }); } }
/// <summary> /// Splits a job into more granular tasks to be processed in parallel. /// </summary> /// <param name="job">The job to be split.</param> /// <param name="settings">Contains information and services about the split request.</param> /// <returns>A sequence of tasks to be run on compute nodes.</returns> protected override IEnumerable<TaskSpecifier> Split(IJob job, JobSplitSettings settings) { var jobParameters = BlenderParameters.FromJob(job); if (!jobParameters.Valid) { Log.Error(jobParameters.ErrorText); throw new InvalidParameterException(jobParameters.ErrorText); } for (var i = jobParameters.Start; i <= jobParameters.End; i++) { yield return new TaskSpecifier { TaskIndex = i, Parameters = job.Parameters, RequiredFiles = job.Files, }; } }
protected override IEnumerable <TaskSpecifier> Split(IJob job, JobSplitSettings settings) { var tasks = new List <TaskSpecifier>(); var pars = job.Parameters; double K_max = Double.Parse(pars["K_max"], CultureInfo.InvariantCulture); double sigma = Double.Parse(pars["sigma"], CultureInfo.InvariantCulture); double Omega = Double.Parse(pars["Omega"], CultureInfo.InvariantCulture); double l0_init = Double.Parse(pars["l0_init"], CultureInfo.InvariantCulture); double l0_end = Double.Parse(pars["l0_end"], CultureInfo.InvariantCulture); double l0_steps = Double.Parse(pars["l0_steps"], CultureInfo.InvariantCulture); double l0_step = (l0_end - l0_init) / l0_steps; for (double l0 = l0_init; l0 <= l0_end; l0 += l0_step) { tasks.Add(makeTask(K_max, sigma, Omega, l0, String.Format("{0}_{1}_{2}_{3}", K_max, sigma, Omega, l0))); } return(tasks); }
/// <summary> /// Splits a job into more granular tasks to be processed in parallel. /// </summary> /// <param name="job">The job to be split.</param> /// <param name="settings">Contains information and services about the split request.</param> /// <returns>A sequence of tasks to be run on compute nodes.</returns> protected override IEnumerable <TaskSpecifier> Split(IJob job, JobSplitSettings settings) { try { var tasks = File.ReadAllLines(job.Files[0].Name) .Select(line => { var ps = line.Split('\t'); var task = new TaskSpecifier(); task.Parameters.Add("HostName", ps[0]); task.Parameters.Add("DataFileName", ps[1]); task.Parameters.Add("NumChannels", ps[2]); task.Parameters.Add("OutFileName", ps[3]); task.Parameters.Add("MinTemp", ps[4]); task.Parameters.Add("MaxTemp", ps[5]); task.Parameters.Add("FirstBlock", ps[6]); task.Parameters.Add("NumBlocks", ps[7]); return(task); }); return(tasks); } catch (Exception ex) { Log.Error("Error in job splitter: {0}", ex.ToString()); } return(Enumerable.Empty <TaskSpecifier>()); }