private static IJob CreateJob(int taskPerJobCount, string leafDistributionName, string niceName, RangeCollection nullIndexRangeCollection, ICluster cluster, Queue <ITask> taskQueue)
        {
            IJob   job = cluster.CreateJob();
            string firstPieceIndex = null, lastPieceIndex = null;

            for (int iTaskPerJob = 0; iTaskPerJob < taskPerJobCount; ++iTaskPerJob)
            {
                ITask  task           = taskQueue.Dequeue();
                string taskPieceIndex = task.Name.Split(' ')[1];
                if (iTaskPerJob == 0)
                {
                    firstPieceIndex = taskPieceIndex.ToString();
                }
                lastPieceIndex = taskPieceIndex;
                job.AddTask(task);
                job.Runtime = task.Runtime;

                if (taskQueue.Count == 0)
                {
                    break;
                }
            }
            job.Name = SpecialFunctions.CreateTabString(niceName, firstPieceIndex + "-" + lastPieceIndex,
                                                        leafDistributionName, nullIndexRangeCollection).Replace("\t", " "); //!!!create a nicer way to make a space delimited list
            if (job.Name.Length > 80)
            {
                job.Name = job.Name.Substring(0, 80);
            }
            Console.WriteLine(job.Name);
            job.IsExclusive = false;

            return(job);
        }
        private static void SubmitQueue(int taskPerJobCount, string caseName, RangeCollection nullIndexRangeCollection, ICluster cluster, string id, string password, Queue <ITask> taskQueue)
        {
            while (taskQueue.Count != 0)
            {
                IJob   job = cluster.CreateJob();
                string firstPieceIndex = null, lastPieceIndex = null;
                for (int iTaskPerJob = 0; iTaskPerJob < taskPerJobCount; ++iTaskPerJob)
                {
                    ITask  task           = taskQueue.Dequeue();
                    string taskPieceIndex = task.Name.Split(' ')[1];
                    if (iTaskPerJob == 0)
                    {
                        firstPieceIndex = taskPieceIndex.ToString();
                    }
                    lastPieceIndex = taskPieceIndex;
                    job.AddTask(task);
                    job.Runtime = task.Runtime;

                    if (taskQueue.Count == 0)
                    {
                        break;
                    }
                }
                string jobName = SpecialFunctions.CreateTabString(caseName, firstPieceIndex + "-" + lastPieceIndex,
                                                                  nullIndexRangeCollection).Replace("\t", " "); //!!!create a nicer way to make a space delimited list
                job.Name = jobName.Substring(0, Math.Min(jobName.Length, 70));
                Console.WriteLine(job.Name);
                job.IsExclusive = false;
                cluster.AddJob(job);
                cluster.SubmitJob(job.Id, id, password, true, 0);
            }
        }
Beispiel #3
0
        private void AddTasksToJob(BuildConfigurationType buildConfig, IJob job, JobType buildConfigJob)
        {
            TasksType taskList = (TasksType)buildConfigJob.Item;

            if (taskList.Items == null)
            {
                return;
            }

            foreach (object taskListItem in taskList.Items)
            {
                object buildConfigTask = GetBuildConfigTaskFromTaskListItem(buildConfig, taskListItem);

                ITask task = MakeTask(buildConfigTask);
                job.AddTask(task);
            }
        }
Beispiel #4
0
 public void add_task(ILuaTask task)
 {
     _job.AddTask(task.Task);
 }