|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ggf.drmaa.GridWaySession
public class GridWaySession
This is the class to implement the Session interface.
Field Summary | |
---|---|
static java.lang.String |
GW_ARCH
Pre-defined string to refer to the remote host architecture as returned by the resource selector module. |
static java.lang.String |
GW_JOB_ID
Pre-defined string to refer to the job unique identification as provided by the GridWay system. |
static java.lang.String |
GW_TASK_ID
Pre-defined string to refer to the task unique identification as provided by the GridWay system. |
static java.lang.String |
GW_TOTAL_TASKS
Pre-defined string to refer to the number of total tasks in a bulk job. |
static java.lang.String |
GW_TYPE_MPI
Pre-defined string to define MPI (Message Passing Interface) jobs. |
static java.lang.String |
GW_TYPE_SINGLE
Pre-defined string to define single (one process) jobs. |
Fields inherited from interface org.ggf.drmaa.Session |
---|
DONE, FAILED, HOLD, JOB_IDS_SESSION_ALL, JOB_IDS_SESSION_ANY, QUEUED_ACTIVE, RELEASE, RESUME, RUNNING, SUSPEND, SYSTEM_ON_HOLD, SYSTEM_SUSPENDED, TERMINATE, TIMEOUT_NO_WAIT, TIMEOUT_WAIT_FOREVER, UNDETERMINED, USER_ON_HOLD, USER_SUSPENDED, USER_SYSTEM_ON_HOLD, USER_SYSTEM_SUSPENDED |
Constructor Summary | |
---|---|
GridWaySession()
|
Method Summary | |
---|---|
void |
control(java.lang.String jobName,
int operation)
This method allows the job specified by jobid to be controlled according to a given action. |
JobTemplate |
createJobTemplate()
This method allocates a new job template. |
void |
deleteJobTemplate(JobTemplate jt)
This method deallocates a job template. |
void |
exit()
Disengage from DRMAA library. |
java.lang.String |
getContact()
If called before Session.init(java.lang.String) , this method returns a string containing a
comma-delimited list of default contact hosts for the GridWay daemon. |
java.lang.String |
getDrmaaImplementation()
This method returns the DRMAA implementation. |
java.lang.String |
getDrmsInfo()
This method always returns "GridWay" in drm_system, the only DRM system supported by the GridWay DRMAA implementation |
int |
getJobStatus(java.lang.String jobName)
Obtains the status of a given job. |
Version |
getVersion()
This method sets major and minor to the major and minor versions of the DRMAA C binding specification implemented by the DRMAA implementation. |
void |
init(java.lang.String contactString)
Initialize DRMAA API library and create a new DRMAA Session. |
java.util.List |
runBulkJobs(JobTemplate jobTemplate,
int beginIndex,
int endIndex,
int step)
Submits a set of parametric jobs tha can be run concurrently. |
java.lang.String |
runJob(JobTemplate jobTemplate)
This method submits a single job with the attributes defined in the job template. |
void |
synchronize(java.util.List jobList,
long timeout,
boolean dispose)
This method blocks until all jobs specified by jobList have completed execution or fail. |
JobInfo |
wait(java.lang.String jobName,
long timeout)
This method waits for a given job to either finish executing or fail. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String GW_TOTAL_TASKS
public static final java.lang.String GW_JOB_ID
runBulkJobs(org.ggf.drmaa.JobTemplate, int, int, int)
and runJob(org.ggf.drmaa.JobTemplate)
method calls.
public static final java.lang.String GW_TASK_ID
GW_TOTAL_TASKS
-1. Please note that this attribute name
should be used ONLY in conjuntion with a runBulkJobs(org.ggf.drmaa.JobTemplate, int, int, int)
method call.
public static final java.lang.String GW_ARCH
public static final java.lang.String GW_TYPE_SINGLE
public static final java.lang.String GW_TYPE_MPI
Constructor Detail |
---|
public GridWaySession()
Method Detail |
---|
public void init(java.lang.String contactString) throws DrmaaException
Session
init
in interface Session
contactString
- is an implementation dependent string which may
be used to specify which DRM system to use. The current GridWay DRMAA
implementation contact MUST be NULL or "localhost".
DrmsInitException
InvalidContactStringException
AlreadyActiveSessionException
DefaultContactStringException
NoDefaultContactStringSelectedException
DrmCommunicationException
AuthorizationException
DrmaaException
public void exit() throws DrmaaException
Session
exit
in interface Session
DrmsExitException
NoActiveSessionException
DrmCommunicationException
AuthorizationException
DrmaaException
public JobTemplate createJobTemplate() throws DrmaaException
Session
createJobTemplate
in interface Session
JobTemplate
Object.
The DRMAA API runtime library will allocate memory for the new template.
This memory MUST be freed with a subsequent call to
Session.deleteJobTemplate(org.ggf.drmaa.JobTemplate)
method.
NoActiveSessionException
DrmCommunicationException
AuthorizationException
DrmaaException
public void deleteJobTemplate(JobTemplate jt) throws DrmaaException
Session
deleteJobTemplate
in interface Session
jt
- Rerence to a JobTemplate
object.
The JobTemplate
object jt MUST BE previously allocated with a
Session.createJobTemplate()
method.
NoActiveSessionException
InvalidJobTemplateException
DrmCommunicationException
AuthorizationException
DrmaaException
public java.lang.String runJob(JobTemplate jobTemplate) throws DrmaaException
Session
runJob
in interface Session
jobTemplate
- Reference to a JobTemplate
object.
The JobTemplate
jobTemplate MUST BE previously allocated with a
Session.createJobTemplate()
method call. Job template values MUST be
previously defined with set methods.
String
identification as provided by the GridWay
system.
TryLaterException
DeniedByDrmException
InvalidJobTemplateException
NoActiveSessionException
DrmCommunicationException
AuthorizationException
DrmaaException
public java.util.List runBulkJobs(JobTemplate jobTemplate, int beginIndex, int endIndex, int step) throws DrmaaException
Session
runBulkJobs
in interface Session
jobTemplate
- Reference to a JobTemplate
structure.
The JobTemplate
jobTemplate MUST BE previously allocated with a
Session.createJobTemplate()
method call. Job template values MUST be
previously defined with sets methods calls.beginIndex
- index associated to the first job. The smallest start value is 0endIndex
- index associated to the last job.step
- increment used to obtain the total number of job. GridWay
will internally used incr=1
TryLaterException
DeniedByDrmException
InvalidJobTemplateException
NoActiveSessionException
DrmCommunicationException
AuthorizationException
DrmaaException
public void control(java.lang.String jobName, int operation) throws DrmaaException
Session
Session.SUSPEND
A job will be stopped, and restart files
tranferred back to the client. These files if provided by the running job
will be used on RESUME to re-start execution.Session.RESUME
A previously stopped job will be resumed.
If re-start files are provided the job will used them to re-start execution,
from the last checkpointing context.Session.TERMINATE
The job will be killed, it execution can be
synchronized through the drmaa_wait and drmaa_synchronize method calls.
However, job rusage information will not be available.Session.HOLD
The job will be held, it execution will not
start until it is released. Only jobs in the QUEUED_ACTIVE state can be held.
Session.RELEASE
The job will be released and scheduled, only jobs
in the USER_ON_HOLD state can be released.
control
in interface Session
jobName
- String with the job unique identification as
provided by the GridWay system. The jobid SHOULD be obtained from a
Session.runJob(org.ggf.drmaa.JobTemplate)
or Session.runBulkJobs(org.ggf.drmaa.JobTemplate, int, int, int)
methods calls.operation
- The action to be performed over the job whose value
may be one of the following: Session.SUSPEND
, Session.RESUME
,
Session.TERMINATE
, Session.HOLD
or Session.RELEASE
.
NoActiveSessionException
ResumeInconsistentStateException
SuspendInconsistentStateException
HoldInconsistentStateException
ReleaseInconsistentStateException
InvalidJobException
DrmCommunicationException
AuthorizationException
DrmaaException
public void synchronize(java.util.List jobList, long timeout, boolean dispose) throws DrmaaException
Session
synchronize
in interface Session
jobList
- A NULL terminated list of jobid strings.
The jobids SHOULD be obtained from a Session.runJob(org.ggf.drmaa.JobTemplate)
or
Session.runBulkJobs(org.ggf.drmaa.JobTemplate, int, int, int)
methods calls. The pre-defined value
Session.JOB_IDS_SESSION_ALL
can be used to synchronize all jobs submitted
during the DRMAA session. Please note that "disposed" jobs will be removed
from the job-list associated to the DRMAA session.timeout
- The current GridWay DRMAA implementation
only supports Session.TIMEOUT_WAIT_FOREVER
, it
specifies an undetermined amount of time.dispose
- If dispose is equal to 1 the jobid will be killed, and
its resources freed in the GridWay system. Therefore subsequent calls on
this job will fail. However, if dispose is equal to 0 the job remains in
Session.DONE
state in the GridWay system and its rusage statistics can be
obtained with Session.wait(java.lang.String, long)
method call. Also these jobid will not make
subsequent calls synchronize method call to fail.
NoActiveSessionException
ExitTimeoutException
InvalidJobException
DrmCommunicationException
AuthorizationException
DrmaaException
public JobInfo wait(java.lang.String jobName, long timeout) throws DrmaaException
Session
InvalidJobException
.
wait
in interface Session
jobName
- String with the job unique identification as
provided by the GridWay system. The jobid SHOULD be obtained from a
Session.runJob(org.ggf.drmaa.JobTemplate)
or Session.runBulkJobs(org.ggf.drmaa.JobTemplate, int, int, int)
methods calls.
Session.JOB_IDS_SESSION_ANY
can be used to wait on any job submitted
during the DRMAA session. Please note that "disposed" jobs will be removed
from the job-list associated to the DRMAA session.timeout
- The current GridWay DRMAA implementation
only supports Session.TIMEOUT_WAIT_FOREVER
. Session.TIMEOUT_WAIT_FOREVER
,
specifies an undetermined amount of time.
JobInfo
object that stores the exit status and the resource usage of the job_out.
NoActiveSessionException
ExitTimeoutException
InvalidJobException
DrmCommunicationException
AuthorizationException
DrmaaException
public int getJobStatus(java.lang.String jobName) throws DrmaaException
Session
getJobStatus
in interface Session
jobName
- String with the job unique identification as
provided by the GridWay system. The jobid SHOULD be obtained from a
Session.runJob(org.ggf.drmaa.JobTemplate)
or Session.runBulkJobs(org.ggf.drmaa.JobTemplate, int, int, int)
method calls.
Session.UNDETERMINED
: An UNDETERMINED state can either obtained due
to a communication error with the GridWay daemon, or because the job has
not been initialized yet.Session.QUEUED_ACTIVE
: The job has been successfully submitted and
it is pending to be scheduled.Session.RUNNING
: The job has been successfully submitted to a
remote host. Please note that once submitted, the job can be in any of the
execution stages, namely: prolog (file stage-in), wrapper (execution),
epilog (file stage-out) or migrating (to another host).Session.USER_ON_HOLD
: The job has been held by the userSession.DONE
: Job has been completely executed and output files are
available at the client. drmaa_wait() and drmaa_synchronize() calls on the
job will return immediately. Also rusage information is available. Session.DONE
: Job has been completely executed and output files are
available at the client. drmaa_wait() and drmaa_synchronize() calls on the
job will return immediately. Also rusage information is available. Session.FAILED
: Job execution has failed, and the "on_failure" policy
is to hold it on FAILED state.Session.SYSTEM_ON_HOLD
, Session.USER_SYSTEM_ON_HOLD
,
Session.SYSTEM_SUSPENDED
and Session.USER_SYSTEM_SUSPENDED
.
NoActiveSessionException
InvalidJobException
DrmCommunicationException
AuthorizationException
DrmaaException
public java.lang.String getContact()
Session
Session.init(java.lang.String)
, this method returns a string containing a
comma-delimited list of default contact hosts for the GridWay daemon. If called
after Session.init(java.lang.String)
, this funtion returns the contact string (hostname)
where GridWay is running. The client library has been initialized by contacting this
host.
getContact
in interface Session
public Version getVersion()
Session
getVersion
in interface Session
public java.lang.String getDrmsInfo()
Session
getDrmsInfo
in interface Session
public java.lang.String getDrmaaImplementation()
Session
getDrmaaImplementation
in interface Session
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |