WebSphere Extended Deployment Compute Grid, Version 6.1.1
             Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS


Sample Compute Grid applications

Use the sample Compute Grid applications as a starting point for implementing your own applications. The sample applications are in the <install_root>/installableApps directory.

The provided samples are:

SimpleCI.ear

A simple compute-intensive application that performs compute-intensive mathematical calculations for a specified amount of time.
  1. When installing the SimpleCI.ear file, ensure that the Deploy enterprise beans in Step 1: Select installation options box is cleared.
  2. Test the SimpleCI application with the xJCL in <install_root>/longRunning/SimpleCIxJCL.xml.

PostingsSample.ear

A transactional batch application that mimics account transaction processing.
  1. Test the PostingsSample application with the xJCL in <install_root>/longRunning/postingSampleXJCL.xml.
  2. Before submitting the job, edit the file and supply valid file names on the dynamic cluster where you deployed the PostingsSample.ear application. The PostingsSample.ear file contains entity beans.
  3. Create the database tables and define a datasource for the database before installing the PostingsSample application. The Data Definition Language (DDL) files that you use to create the corresponding database tables and tablespaces are in <install_root>/longRunning/CreatePostingsTablesXxx.ddl and <install_root>/longRunning/CreatePostingsTablespaceXxx.ddl, where Xxx denotes the type of database manager for which the DDL is intended. WebSphere Extended Deployment supports Cloudscape, Derby, DB2, Oracle, and Informix.

Postingv2Sample.ear

This is a revised version of the old postings sample built based on the batch datastream (BDS) framework. It is built using the simple POJO model and packaged using the BatchPackager.
Note: You must have WebSphere Extended Deployment Compute Grid Version 6.1.0.3 and compatible Network Deployment DB2 or Oracle database. This sample does not work with Derby due to multiple simultaneous connections during a step.

Installing Postingv2Sample.ear

  1. Create the database using the appropriate DDL, that is, createPostingsV2TableDB2.ddl or CreatePostingsV2TablesOracle.ddl. For example, DB2 create a DB called ACTDB, then open the DB2 command prompt and run db2 -tf <path to the ddl file>.
  2. Log on to the WebSphere Application Server administrative console and create a XA JDBC provider, choosing an XA datasource as implementation type, and a non-XA JDBC provider, choosing a connection pool datasource as the implementation type.
  3. Create two datasources:
    1. Uses the XA JDBC provider and has the JNDI name jdbc/actdbxa.
    2. Uses the non-XA JDBC Provider and has the JNDI name jdbc/actdbnonxa.
    Note: Make sure the datasources can connect to the database by using the test connection button.
  4. Complete the following steps in the wizard to install the Postingsv2Sample.ear:
    • Choose Show me all installation options and parameters. Select Generate Default Bindings.
    • Step 2: Select the endpoint cluster.
    • Step 3: Set the database type to be that of the LREE database. Do not enter a schema name.
    • Steps 4 - 6: Accept the defaults.
    • Step 7: Ensure the datasource JNDI name is the one used for the LREE database (e.g. jdbc/lree)
    • Step 8: Ensure the datasource JNDI name for the step entity beans is the one used for the LREE database (e.g. jdbc/lree)
    • Step 9: Ensure the JNDI name for the EJB POSTINGSv2SAMPLECursorHoldableJDBCReader is set to jdbc/actdbnonxa
    • Go to the last step and click Finish.
  5. Start the application.

RunningPostingv2Sample.ear

To run:
  1. Open the postingsv2samplexJCL.xml and update the value for postingsDataStream in the substitution-props section to a valid path.
  2. Save and exit.
  3. Open the job management console and submit the previous xJCL.
Avoid trouble: While running the postings job a second time you will see errors in the job logs saying that the account already exists, because in the previous run accounts with the same ID were already created. You can ignore these errors or delete the ACCOUNT table before running the job.gotcha

Installing XDCGIVT.ear

  1. Ensure Java is on your PATH variable. Create the database using the appropriate DDL, that is, createFVTTableDB2.ddl and so on. For example, run the following on Derby: java -Djava.ext.dirs=C:/WebSPhere/AppServer/derby/lib -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij CreatefvtTablesDerby.ddl
  2. Log on to the Administrative Console of WAS and create a XA JDBC Provider (choose XA datasource as implementation type) and a non-XA JDBC Provider(choose connection pool datasource as the implementation type)
  3. Create two datasources
    1. Uses the XA JDBC provider and has the JNDI name jdbc/fvtdb
    2. Uses the non-XA JDBC Provider and has the JNDI name jdbc/fvtdbxa.
    Note: Make sure the datasources can connect to the database by using the test connection button.
  4. Complete the following steps in the wizard to install XDCGIVT.ear:
    • Choose Show me all installation options and parameters. Select Generate Default Bindings.
    • Step 2: Select the endpoint cluster.
    • Step 3: Set the database type to be that of the LREE database. Do not enter a schema name.
    • Steps 4 - 6: Accept the defaults.
    • Step 7: Ensure the datasource JNDI name is the one used for the LREE database (e.g. jdbc/lree)
    • Step 8: Ensure the datasource JNDI name for the step entity beans is the one used for the LREE database (e.g. jdbc/lree)
    • Step 9: Ensure the JNDI name for the EJB XDCGIVTCursorHoldableJDBCReader is set to jdbc/actdbnonxa
    • Go to the last step and click Finish.
  5. Start the application.

Running XDCGIVT.ear

This sample includes three xJCLs that do the following:
  • Copies one text file to another and compares the two XDCGIVTtxt2txtxJCL.xml
  • Copies one byte file to another and then compares the two XDCGIVTbyte2bytexJCL.xml
  • Copies a text file to a database and then copies the entries in the database to another file and then compares the two.
To run:
  1. Open the xJCL you want to submit and update the values for inputDatastream and outputDataStream in the substitution-props section to valid paths.
  2. Save and exit.
  3. Open the job management console and submit the previous xJCL.

MandelbrotCI.ear

A compute-intensive application with a Web interface that computes and renders Mandelbrot fractal images. The MandelbrotCI application contains two modules: a Web module that provides the user interface and an Enterprise JavaBean (EJB) module that contains the compute-intensive logic.
  1. When installing the MandelbrotCI.ear file, ensure that the Deploy enterprise beans in Step 1: Select installation options box is cleared.
  2. Deploy the Web module to the same dynamic cluster as the job scheduler.
  3. Deploy the EJB module to a grid endpoint dynamic cluster.
  4. After installation, the URL for the GUI is http://<hostname>:<port>/mandelbrotci/gui, where hostname and port specify the host name and port number of the Web module.
The Web interface provides the controls as shown in the following table:
Table 1. Mandelbrot Web interface controls
Control Description
Zoom in, zoom out Zooms the current view in or out.
Pan up, left, right, down Moves the current view of the image as specified.
Minimum, maximum real, imaginary value Precisely controls what portion of the fractal shows. The zoom and pan controls are shortcuts for modifying these values.
Pixels horizontally, vertically Specifies how large the resulting image is in pixels.
Tiles horizontally, vertically Specifies how many tiles the image is split into for computation. One long-running job is submitted for each tile.
Maximum iterations A parameter of the Mandelbrot algorithm that controls the contrast of the computed image. You do not typically need to adjust this value.
Repeat count Specifies how often the computations repeat. By default, an iteration of the calculations for a tile takes approximately 0.1 seconds on an average machine. Increase this number to lengthen each job.
Reset values Resets the numeric values in the fields.
Restart computation Starts or restarts the specified computation. If any jobs are outstanding from the previous computation, then they are canceled.
Cancel computation Cancels any outstanding jobs.
User ID, password Supplies login credentials. The Mandelbrot application does not have any security constraints. However, the credentials are used to establish user identity for submitting and canceling jobs.

SimpleUtility.jar

Two simple native Java applications that calculate the factorial of a number and count for 60 seconds are contained in the SimpleUtility.jar file, which is located at <install_root>/longRunning.
  1. Test the Factorial application with the xJCL in <install_root>/longRunning/FactorialXJCL.xml. Before submitting the job, edit the file and supply a number by updating <arg line="60"/ >.
  2. Test the SimpleCounter application with the xJCL in <install_root>/longRunning/SimpleCounterXJCL.xml.



Related concepts
The compute-intensive programming model
Managing Compute Grid jobs and their environment
Related tasks
Creating the grid endpoint database
Concept topic    

Terms of Use | Feedback

Last updated: Oct 30, 2009 1:37:06 PM EDT
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r1m1/index.jsp?topic=/com.ibm.websphere.gridmgr.doc/info/reference/cbgsample.html