Interface JobFrontendRef

All Known Implementing Classes:
JobFrontend, JobFrontendProxy, NonPjJobFrontend

public interface JobFrontendRef
Interface JobFrontendRef specifies the interface for the PJ job frontend process.
Version:
20-Jun-2012
Author:
Alan Kaminsky
  • Method Details

    • assignBackend

      void assignBackend(JobSchedulerRef theJobScheduler, String name, String host, String jvm, String classpath, String[] jvmflags, String shellCommand, int Nt) throws IOException
      Assign a backend process to the job.
      Parameters:
      theJobScheduler - Job Scheduler that is calling this method.
      name - Backend node name.
      host - Host name for SSH remote login.
      jvm - Full pathname of Java Virtual Machine.
      classpath - Java class path for PJ Library.
      jvmflags - Array of JVM command line flags.
      shellCommand - Shell command string.
      Nt - Number of CPUs assigned to the process.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • assignJobNumber

      void assignJobNumber(JobSchedulerRef theJobScheduler, int jobnum, String pjhost) throws IOException
      Assign a job number to the job. The host name for the job frontend's middleware channel group is also specified.
      Parameters:
      theJobScheduler - Job Scheduler that is calling this method.
      jobnum - Job number.
      pjhost - Host name for middleware channel group.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • cancelJob

      void cancelJob(JobSchedulerRef theJobScheduler, String errmsg) throws IOException
      Cancel the job.
      Parameters:
      theJobScheduler - Job Scheduler that is calling this method.
      errmsg - Error message string.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • renewLease

      void renewLease(JobSchedulerRef theJobScheduler) throws IOException
      Renew the lease on the job.
      Parameters:
      theJobScheduler - Job Scheduler that is calling this method.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • backendFinished

      void backendFinished(JobBackendRef theJobBackend) throws IOException
      Report that a backend process has finished executing the job.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • backendReady

      void backendReady(JobBackendRef theJobBackend, int rank, InetSocketAddress middlewareAddress, InetSocketAddress worldAddress, InetSocketAddress frontendAddress) throws IOException
      Report that a backend process is ready to commence executing the job.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      rank - Rank of the job backend process.
      middlewareAddress - Host/port to which the job backend process is listening for middleware messages.
      worldAddress - Host/port to which the job backend process is listening for the world communicator.
      frontendAddress - Host/port to which the job backend process is listening for the frontend communicator, or null if the frontend communicator does not exist.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • cancelJob

      void cancelJob(JobBackendRef theJobBackend, String errmsg) throws IOException
      Cancel the job.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      errmsg - Error message string.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • renewLease

      void renewLease(JobBackendRef theJobBackend) throws IOException
      Renew the lease on the job.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • requestResource

      void requestResource(JobBackendRef theJobBackend, String resourceName) throws IOException
      Request the given resource from this job frontend's class loader.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      resourceName - Resource name.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • outputFileOpen

      void outputFileOpen(JobBackendRef theJobBackend, int bfd, File file, boolean append) throws IOException
      Open the given output file for writing or appending.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      bfd - Backend file descriptor.
      file - File.
      append - True to append, false to overwrite.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • outputFileWrite

      void outputFileWrite(JobBackendRef theJobBackend, int ffd, byte[] buf, int off, int len) throws IOException
      Write the given bytes to the given output file. ffd = 1 refers to the job's standard output stream; ffd = 2 refers to the job's standard error stream; other values refer to a previously opened file.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      ffd - Frontend file descriptor.
      buf - Array of bytes to write.
      off - Index of first byte to write.
      len - Number of bytes to write.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • outputFileFlush

      void outputFileFlush(JobBackendRef theJobBackend, int ffd) throws IOException
      Flush accumulated bytes to the given output file.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      ffd - Frontend file descriptor.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • outputFileClose

      void outputFileClose(JobBackendRef theJobBackend, int ffd) throws IOException
      Close the given output file.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      ffd - Frontend file descriptor.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • inputFileOpen

      void inputFileOpen(JobBackendRef theJobBackend, int bfd, File file) throws IOException
      Open the given input file for reading.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      bfd - Backend file descriptor.
      file - File.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • inputFileRead

      void inputFileRead(JobBackendRef theJobBackend, int ffd, int len) throws IOException
      Read bytes from the given input file. ffd = 1 refers to the job's standard input stream; other values refer to a previously opened file.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      ffd - Frontend file descriptor.
      len - Number of bytes to read.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • inputFileSkip

      void inputFileSkip(JobBackendRef theJobBackend, int ffd, long len) throws IOException
      Skip bytes from the given input file.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      ffd - Frontend file descriptor.
      len - Number of bytes to skip.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • inputFileClose

      void inputFileClose(JobBackendRef theJobBackend, int ffd) throws IOException
      Close the given input file.
      Parameters:
      theJobBackend - Job Backend that is calling this method.
      ffd - Frontend file descriptor.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • reportComment

      void reportComment(JobBackendRef theJobBackend, int rank, String comment) throws IOException
      Report a comment for a process.
      Parameters:
      theJobBackend - Job backend that is calling this method.
      rank - Process rank.
      comment - Comment string.
      Throws:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • close

      void close()
      Close communication with this Job Frontend.