Share via


Cluster.AddJobs Method

Adds one or more specified jobs to the cluster.

Namespace: Microsoft.ComputeCluster
Assembly: CcpAPI (in ccpapi.dll)

Usage

Syntax

'Declaration
Public Function AddJobs ( _
    jobs As IClusterEnumerable _
) As IClusterEnumerable
public IClusterEnumerable AddJobs (
    IClusterEnumerable jobs
)
public:
virtual IClusterEnumerable^ AddJobs (
    IClusterEnumerable^ jobs
) sealed
public final IClusterEnumerable AddJobs (
    IClusterEnumerable jobs
)
public final function AddJobs (
    jobs : IClusterEnumerable
) : IClusterEnumerable

Parameters

  • jobs
    A class that implements the IClusterEnumerable interface. The class contains one or more Job objects of the jobs that you want to add to the cluster.

Return Value

An IClusterEnumerable interface that contains a collection of integers that identify the jobs that were added to the cluster. The identifiers in this collection correspond directly to the jobs passed in the jobs parameter. Use the identifier to add tasks to the job and to submit or retrieve the job. Note that identifiers for jobs that are no longer in the cluster are reused.

Remarks

The ClusterEnumerable class implements the IClusterEnumerable interface.

If you need to add multiple jobs to the cluster, calling this method provides better performance than calling the Cluster.AddJob method in a loop.

To create the enumerable object that contains the collection of jobs, call the Cluster.CreateClusterEnumerable method. Then, call the ClusterEnumerable.Add method for each job that you want to add to the enumerable object.

If this method fails to add one of the jobs to the cluster, none of the jobs are added to the cluster.

To update the terms of the job after you have added the job to the cluster, you must use the Cluster.ModifyJob or Cluster.ModifyJobTerm method.

If each job contains at least one task, call the Cluster.SubmitJobs method to add the jobs to the scheduling queue. If any jobs do not contain at least one task, call the Cluster.AddTask method to add at least one task to those jobs before calling the SubmitJobs method.

Note that you can call the SubmitJobs method on jobs that do not contain tasks to reserve resources for the jobs. If the Job.RunUntilCanceled property value is true, the job is scheduled and runs indefinitely or until it exceeds the run-time limit set in the Job.Runtime property (then the job is canceled). If the RunUntilCanceled property value is false, the job moves to the finished status.

As an alternative to calling both the AddJobs and SubmitJobs methods, you can call the Cluster.QueueJobs method.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows Compute Cluster Server 2003, Windows Server 2003, Windows XP

Target Platforms

Microsoft Windows Compute Cluster Server 2003, Windows Server 2003 with Compute Cluster Pack Client Utilities, Windows XP with Compute Cluster Pack Client Utilities

See Also

Reference

Cluster Class
Cluster Members
Microsoft.ComputeCluster Namespace
Cluster.AddJob Method
CancelJobs
ListJobs