ICluster::SubmitJob method

Adds the specified job to the scheduling queue.


HRESULT SubmitJob(
  [in]           long         jobId,
  [in]           BSTR         userName,
  [in]           BSTR         password,
  [in]           VARIANT_BOOL isConsole,
  [in, optional] long         hwndParent


  • jobId [in]
    The job identifier. The ICluster::AddJob method returns this value.

  • userName [in]
    The name of the RunAs user, in the form domain\user. The user name is limited to 80 Unicode characters.

    If userName is NULL, empty, or not valid, the cluster searches the calling user's credential cache for the credentials to use. If the cache contains only one credential, that credential is used. If the cache does not exist or contains multiple credentials, the user is prompted for the credentials.

  • password [in]
    The RunAs user's password. The password is limited to 127 Unicode characters. If this parameter is NULL or empty, the method uses the cached credentials. See ICluster::SetCachedCredentials. If the credentials are not cached, the current user is prompted for the credentials. If the isConsole parameter is VARIANT_TRUE, the user is prompted in the console window; otherwise, the standard credentials dialog box is used.

  • isConsole [in]
    Set the value to VARIANT_TRUE if the application is a console-mode application. Set the value to VARIANT_FALSE if the application is a GUI application.

  • hwndParent [in, optional]
    The handle to use as the parent window for the modal credentials dialog box. If 0, HWND_DESKTOP is used. The handle is ignored if isConsole is VARIANT_TRUE.

Return value

If the method succeeds, the return value is S_OK. Otherwise, the return value is an error code. To get a description of the error, call the ICluster::get_ErrorMessage method.


If the operation succeeds, the status of the job is JobStatus_Queued. The job moves to the JobStatus_Running state when all required resources are available and the scheduler starts the job. Tasks are started in the order in which they were added to the job, except if there is a dependency.

You can submit a job that does not contain tasks to reserve resources for the job. If the IJob::put_RunUntilCanceled method's pRetVal parameter is VARIANT_TRUE, the job is scheduled and runs indefinitely or until it exceeds the run-time limit set in the IJob::put_Runtime method (then the job is canceled). If the put_RunUntilCanceled method's pRetVal parameter is VARIANT_FALSE, the state of the job moves to the finished status.



Compute Cluster Pack Client Utilities

Type library


See also