Package edu.rit.pj.cluster
Class JobSchedulerMessage
java.lang.Object
edu.rit.pj.cluster.Message
edu.rit.pj.cluster.JobSchedulerMessage
- All Implemented Interfaces:
Externalizable
,Serializable
Class JobSchedulerMessage provides a message sent to a Job Scheduler process
(interface JobSchedulerRef) in the PJ cluster middleware.
- Version:
- 24-Jan-2012
- Author:
- Alan Kaminsky
- See Also:
-
Field Summary
Fields inherited from class edu.rit.pj.cluster.Message
FILE_READ_DATA, FILE_WRITE_DATA, FROM_JOB_BACKEND, FROM_JOB_FRONTEND, FROM_JOB_LAUNCHER, FROM_JOB_SCHEDULER
-
Constructor Summary
ConstructorDescriptionConstruct a new job scheduler message.JobSchedulerMessage
(int theTag) Construct a new job scheduler message with the given message tag. -
Method Summary
Modifier and TypeMethodDescriptionstatic JobSchedulerMessage
backendFailed
(JobFrontendRef theJobFrontend, String name) Construct a new "backend failed" message.static JobSchedulerMessage
cancelJob
(JobFrontendRef theJobFrontend, String errmsg) Construct a new "cancel job" message.void
invoke
(JobSchedulerRef theJobScheduler, JobFrontendRef theJobFrontend) Invoke the method corresponding to this job scheduler message on the given Job Scheduler object.static JobSchedulerMessage
jobFinished
(JobFrontendRef theJobFrontend) Construct a new "job finished" message.void
Read this job scheduler message from the given object input stream.static JobSchedulerMessage
renewLease
(JobFrontendRef theJobFrontend) Construct a new "renew lease" message.static JobSchedulerMessage
reportComment
(JobFrontendRef theJobFrontend, int rank, String comment) Construct a new "report comment" message.static JobSchedulerMessage
requestJob
(JobFrontendRef theJobFrontend, String username, int Nn, int Np, int Nt) Construct a new "request job" message.void
Write this job scheduler message to the given object output stream.
-
Constructor Details
-
JobSchedulerMessage
public JobSchedulerMessage()Construct a new job scheduler message. -
JobSchedulerMessage
public JobSchedulerMessage(int theTag) Construct a new job scheduler message with the given message tag.- Parameters:
theTag
- Message tag to use when sending this message.
-
-
Method Details
-
backendFailed
Construct a new "backend failed" message.- Parameters:
theJobFrontend
- Job frontend that is calling this method.name
- Backend node name.- Returns:
- a
JobSchedulerMessage
object.
-
cancelJob
Construct a new "cancel job" message.- Parameters:
theJobFrontend
- Job frontend that is calling this method.errmsg
- Error message string.- Returns:
- a
JobSchedulerMessage
object.
-
jobFinished
Construct a new "job finished" message.- Parameters:
theJobFrontend
- Job frontend that is calling this method.- Returns:
- a
JobSchedulerMessage
object.
-
renewLease
Construct a new "renew lease" message.- Parameters:
theJobFrontend
- Job frontend that is calling this method.- Returns:
- a
JobSchedulerMessage
object.
-
reportComment
public static JobSchedulerMessage reportComment(JobFrontendRef theJobFrontend, int rank, String comment) Construct a new "report comment" message.- Parameters:
theJobFrontend
- Job frontend that is calling this method.rank
- Process rank.comment
- Comment string.- Returns:
- a
JobSchedulerMessage
object.
-
requestJob
public static JobSchedulerMessage requestJob(JobFrontendRef theJobFrontend, String username, int Nn, int Np, int Nt) Construct a new "request job" message.- Parameters:
theJobFrontend
- Job frontend that is calling this method.username
- User name.Nn
- Number of backend nodes.Np
- Number of processes.Nt
- Number of CPUs per process. 0 means "all CPUs."- Returns:
- a
JobSchedulerMessage
object.
-
invoke
public void invoke(JobSchedulerRef theJobScheduler, JobFrontendRef theJobFrontend) throws IOException Invoke the method corresponding to this job scheduler message on the given Job Scheduler object. The method arguments come from the fields of this job scheduler message object.- Parameters:
theJobScheduler
- Job Scheduler on which to invoke the method.theJobFrontend
- Job Frontend that is calling the method.- Throws:
IOException
- Thrown if an I/O error occurred.IOException
- if any.
-
writeExternal
Write this job scheduler message to the given object output stream.- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
- Thrown if an I/O error occurred.
-
readExternal
Read this job scheduler message from the given object input stream.- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
- Thrown if an I/O error occurred.
-