private static void CreateTasks(string externalRemoteDirectoryName, string internalRemoteDirectoryName, int pieceCount, int taskPerJobCount, string treeFileName, string predictorFileName, string targetFileName, string leafDistributionName, string nullDataGeneratorName, string keepTestName, string skipRowIndexFileNameOrNull, string niceName, RangeCollection nullIndexRangeCollection, string exeNewRelativeDirectoryName, string clusterName, string id, string password, string optimizerName)
        {
            ICluster cluster = new Cluster();

            cluster.Connect(clusterName);

            Queue <ITask> taskQueue = new Queue <ITask>();

            for (int pieceIndex = 0; pieceIndex < pieceCount; ++pieceIndex)
            {
                ITask task = CreateTask(externalRemoteDirectoryName, internalRemoteDirectoryName, pieceCount, treeFileName, predictorFileName, targetFileName, leafDistributionName, nullDataGeneratorName, keepTestName, skipRowIndexFileNameOrNull, niceName, nullIndexRangeCollection, exeNewRelativeDirectoryName, pieceIndex, optimizerName);
                taskQueue.Enqueue(task);
            }

            while (taskQueue.Count != 0)
            {
                IJob job = CreateJob(taskPerJobCount, leafDistributionName, niceName, nullIndexRangeCollection, cluster, taskQueue);
                cluster.AddJob(job);
                cluster.SubmitJob(job.Id, id, password, true, 0);
                //cluster.SubmitJob(job.Id, null, null, true, 0);
            }
        }