Share via


Cluster.AddJob Method

Adds the specified job to the cluster.

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

Usage

Syntax

'Declaration
Public Function AddJob ( _
    job As IJob _
) As Integer
public int AddJob (
    IJob job
)
public:
virtual int AddJob (
    IJob^ job
) sealed
public final int AddJob (
    IJob job
)
public final function AddJob (
    job : IJob
) : int

Parameters

  • job

Return Value

The identifier of the job that was added to the cluster. The identifier is unique within the cluster. 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 Job class implements the IJob interface. To get a Job object, call the Cluster.CreateJob method. You can also call the Cluster.GetJob method or one of the list methods to get an existing job to use as a template for adding similar jobs (or the same job) 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 the job contains tasks, call the Cluster.SubmitJob method to add the job to the scheduling queue. If the job does not contain tasks, call the Cluster.AddTask method to add a task to the job before calling the SubmitJob method.

Note that you can call the SubmitJob method on a job that does not contain tasks to reserve resources for the job. 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 AddJob and SubmitJob methods, you can call the Cluster.QueueJob 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
AddJobs
CancelJob
ListJobs
QueueJobs
SubmitJobs