+

Search Tips   |   Advanced Search

Develop a parallel job management application

We can build a transactional batch application as a job and divide the job into subordinate jobs so that the subordinate jobs can run independently and in parallel. We use the parallel job manager to submit and manage the transactional batch jobs.

For transitioning users: Parallel job management applications built for prior versions of WebSphere Batch can run as is on WebSphere Application Server v8.5. However, follow the same procedure as having two xJCl files, an xd.spi.properties file, and a shared library configured for two SPI implementations. When using the application as is, do not do the steps in the following procedure.trns

For transitioning users: We can migrate parallel job management applications to WAS v8.5. Add the API implementation classes to the application EAR. Reauthor the xJCL as described in the following procedure.trns

You develop subordinate jobs for our job so that the subordinate jobs can run independently and in parallel. First develop the criteria that breaks jobs into subordinate jobs. Then build a simple batch application and make the pieces of the application parallel. Finally, create the xJCl for the subordinate jobs so that in another procedure we can deploy the application following another procedure.


Tasks

  1. Develop the criteria that breaks jobs into subordinate jobs.

    For example, divide jobs into subordinate jobs based on bank branches, with the subordinate job for each branch based on the location of the branch. For a given bank branch, have the subordinate job compute the balance of each account at the end of the day based on the daily transactions for each account.

  2. Build a simple batch application to process the information as a job.

  3. Make the pieces of the application parallel.

    Implement the parameter API to divide the job for the batch application into multiple subordinate jobs.

  4. Optional: Collect information about a subordinate job running.

    Use the SubJobCollector API to collect the information.

  5. Optional: Analyze information collected about the subordinate job.

    Use the SubJobAnalyzer API to analyze the information.

  6. Create the xJCL.

    Start with xJCL from the job that we created for the simple batch application.

    1. Specify the run element as a child of the job element.

      1. Set the instances attribute on the run element to multiple.

      2. Set the JVM attribute on the run element to single or multiple.

        Use the single attribute to run all subordinate jobs in the same JVM. Use the multiple attribute to run the subordinate jobs on any valid JVM.

      <run instances="multiple" jvm="multiple">
      

      We can specify the run element as a child of a step. In this situation, the step is run as a parallel job. The contents of the step xJCL are used to generate a one step subordinate job xJCL.

    2. Specify one prop element as a child of the run element for each PJM API.

      1. Specify the PJM API on the name attribute.

        The following APIs are valid for the PJM:

        • com.ibm.websphere.batch.parallel.parameterizer
        • com.ibm.websphere.batch.parallel.synchronization
        • com.ibm.websphere.batch.parallel.subjobanalyzer
        • com.ibm.websphere.batch.parallel.subjobcollector

      2. Set the value attribute to a name for the API.

    3. Include a prop element to specify the subordinate job name.

      1. Set the name attribute to com.ibm.wsspi.batch.parallel.subjob.name.

      2. Set the value attribute to the name of the job.

    4. Optional: Include a prop element to indicate the job count.

      1. Set the name attribute to parallel.jobcount.

      2. Set the value attribute to a value for the job count.

    5. Specify any other job-level properties.

    <run instances="multiple" jvm="multiple">
        <props>
            <prop name="com.ibm.websphere.batch.parallel.parameterizer" 
             value="com.ibm.websphere.samples.spi.MailerParameterizer"/>
            <prop name="com.ibm.websphere.batch.parallel.synchronization" 
             value="com.ibm.websphere.samples.spi.MailerTXSynchronization"/>
            <prop name="com.ibm.websphere.batch.parallel.subjobanalyzer" 
             value="com.ibm.websphere.samples.spi.MailerSubJobAnalyzer"/>
            <prop name="com.ibm.websphere.batch.parallel.subjobcollector" 
             value="com.ibm.websphere.samples.spi.MailerSubJobCollector"/>
            
            <prop name="com.ibm.wsspi.batch.parallel.subjob.name" 
             value="MailerSampleSubJob" />
    			
            <!-- The count of parallel sub jobs to be submitted -->
            <prop name="parallel.jobcount" value="3" />
    
        </props>
      </run>
    
  7. Include the same three step level properties in each step in the xJCL.
    <prop name="com.ibm.wsspi.batch.parallel.jobname" value="${parallel.jobname}" />
    <prop name="com.ibm.wsspi.batch.parallel.logicalTXID" value="${logicalTXID}" />
    <prop name="com.ibm.wsspi.batch.parallel.jobmanager" value="${parallel.jobmanager}" />
    

We have created a job with subordinate jobs that can run independently and in parallel.


What to do next

Deploy the application as we would other batch applications.


Subtopics

  • Developing a simple compute-intensive application
  • Developing a simple transactional batch application
  • Deploy batch applications
  • Samples, v8.5