Creates and adds a job, adds multiple tasks to the job, and submits job.
strClusterName = "localhost" 'Change to name of cluster if not run locally. strCommandLine = "mpiexec icpi" 'For all tasks intTaskCount = 3 'Number of tasks to create strUsername = "" 'If empty string, script prompts for username. strPassword = "" 'If empty string, script prompts for password. blnIsConsole = True 'True = cmd-line, False = GUI intHandle = 0 Set objComputeCluster = CreateObject("Microsoft.ComputeCluster.Cluster") objComputeCluster.Connect(strClusterName) WScript.Echo "Compute Cluster Name: " & objComputeCluster.Name Set objJob = objComputeCluster.CreateJob intJobID = objComputeCluster.AddJob((objJob)) WScript.Echo "Job ID: " & intJobID For i = 1 To intTaskCount Set objTask = objComputeCluster.CreateTask objTask.CommandLine = strCommandLine intTaskID = objComputeCluster.AddTask(objJob.ID, (objTask)) WScript.Echo "Task ID: " & objTask.ID Next objComputeCluster.SubmitJob intJobID, strUsername, strPassword, _ blnIsConsole, intHandle WScript.Echo "Submitted Job " & intJobID
strClusterName = "localhost" 'Change to name of cluster if not run locally. strCommandLine = "mpiexec icpi" 'For all tasks intTaskCount = 3 'Number of tasks to create strUsername = "" 'If empty string, script prompts for username. strPassword = "" 'If empty string, script prompts for password. blnIsConsole = True 'True = cmd-line, False = GUI intHandle = 0 Set objComputeCluster = CreateObject("Microsoft.ComputeCluster.Cluster") objComputeCluster.Connect(strClusterName) WScript.Echo "Compute Cluster Name: " & objComputeCluster.Name Set objJob = objComputeCluster.CreateJob intJobID = objComputeCluster.AddJob((objJob)) WScript.Echo "Job ID: " & intJobID For i = 1 To intTaskCount Set objTask = objComputeCluster.CreateTask objTask.CommandLine = strCommandLine intTaskID = objComputeCluster.AddTask(objJob.ID, (objTask)) WScript.Echo "Task ID: " & objTask.ID Next objComputeCluster.SubmitJob intJobID, strUsername, strPassword, _ blnIsConsole, intHandle WScript.Echo "Submitted Job " & intJobID