private static IEnumerable <v1.ITask> EnumerateTasks(ClusterSubmitterArgs clusterArgs, IDistributable distributableObj) { //bool checkIfValid = ValidateParamsOrNull != null; for (int pieceIndex = 0; pieceIndex < clusterArgs.TaskCount; ++pieceIndex) { if (clusterArgs.TaskRange.Contains(pieceIndex)) { ArgumentCollection thisTasksArgs; //if (TryCreateTaskArgsAndValidate(args, pieceIndex.ToString(), out thisTasksArgs)) { v1.ITask task = CreateTask(clusterArgs, pieceIndex, distributableObj); yield return(task); } } } }
private static v1.IJob CreateJobApi1(v1.ICluster cluster, v1.JobPriority priority, v1.ITask task, string runName) { v1.IJob job = cluster.CreateJob(); job.Name = runName; // Helper.CreateDelimitedString(" ", runName, firstPieceIndex + "-" + lastPieceIndex); Helper.CheckCondition(job.Name.Length < 80, "Job name is too long. Must be < 80 but is " + job.Name.Length + ". " + job.Name); Console.Write("\r" + job.Name); job.AddTask(task); job.Runtime = task.Runtime; job.IsExclusive = false; job.MinimumNumberOfProcessors = 1; job.MaximumNumberOfProcessors = 1; job.Priority = priority; return(job); }