Wait until all jobs specified by
jobIds have finished execution. If
jobIds contains
JOB_IDS_SESSION_ALL
, then this method waits for all jobs
submitted during this DRMAA session up to the moment synchronize() is called. To avoid thread race conditions in multithreaded applications, the DRMAA implementation user should explicitly synchronize this call with any other job submission or control calls that may change the number of remote jobs.
To prevent blocking indefinitely in this call, the caller may use a timeout specifying how many seconds to block in this call. The value TIMEOUT_WAIT_FOREVER
may be specified to wait indefinitely for a result. The value TIMEOUT_NO_WAIT
may be specified to return immediately if no result is available. If the call exits before the timeout has elapsed, all the jobs have been waited on or there was an interrupt. If the invocation exits on timeout, an ExitTimeException is thrown. The caller should check system time before and after this call in order to be sure of how much time has passed.
The dispose parameter specifies how to treat the reaping of the remote jobs' internal data records, which includes a record of the jobs' consumption of system resources during their execution and other statistical information. If this parameter is set to true
, the DRM will dispose of the jobs' data records at the end of the synchroniize() call. If set to false
, the data records will be left for future access via the wait() method.
@param jobIds the ids of the jobs to synchronize
@param timeout the maximum number of seconds to wait
@param dispose specifies how to treat reaping information
@throws DrmaaException May be one of the following:
- ExitTimeoutException -- the operation timed out before completing
- InvalidJobException -- the job identifier does not refer to an active job
- NoActiveSessionException -- the session has not yet been initialized or has already been exited
- DrmCommunicationException -- the DRMAA implementation was unable to contact the DRM
- AuthorizationException -- the executing user does not have sufficient permissions to execute the desired action
- IllegalArgumentException -- an argument is invalid
- InternalException -- an error has occured in the DRMAA implementation
@see #wait