Samples and tools

From JPPFWiki

Jump to: navigation, search

Contents

Main Page > Samples and tools

The samples pack

The JPPF samples pack is a collection of complete, self-contained applications, that demonstrate how JPPF can be applied to very real problems. The range of topics is limited only by our imagination, and we invite everyone in the JPPF community to contribute with ideas, code, links, suggestions, etc...

Each sample application comes with its own Readme.html which explains its purpose, how to run and use it, how to build it. This package will grow over time, with the addition of numerous contributions, which explains the separate packaging.

As of today, the samples pack includes the following applications:

  • Mandlebrot fractals explorer, a very graphical and interactive tool that generates Mandelbrot images and enables their exporation by zooming panning, etc...

screenshot here

  • Sequence Alignment, a graphical tool that performs the search of a DNA or protein sequence in a sequence database

screenshot here

  • Web Search Engine, a simple tool to perform web searches based on a user-specified query

screenshot here

  • Tomcat Port, an integration of the JPPF J2SE client into a web application that can be run into an Apache Tomcat 5.5 or 6.0 container.

Running the demonstrations console

Launching the console

Go to the jppf-x.y.z/demo folder.
Type ant demo.console to run the demo.
This will launch a graphical user interface that will enable you to run various samples using JPPF. You will also be able to specify the parameters for each run. Any value that you type will be automatically saved when you exit the console, then restored the next time you start it.

The matrix multiplication panel

DemoConsole1.gif This panel is for running the multiplication of 2 square matrices A and B. The multiplication algorithm is not optimized and the matrices are considered dense matrices. For a matrix size of N, there will be N JPPF tasks, each multiplying a row (or vector) of A by each column of B. You can specify the following parameters:
  • blocking submission: determines whether the tasks are submitted in blocking mode
  • matrix size: the size of the matrices to multiply
  • iterations: the number of times the multiplication will be performed. This allows to show the performance optimization algorithm, as you will see the elapsed time for each iteration decrease dramatically, down to a near-optimal value.

You start the demo by clicking on the "Run demo" button, and you can interrupt it at any time by clicking on the "Cancel" button.

The long task panel

DemoConsole2.gif This panel is for executing JPPF tasks with a specified duration. You can specify the following parameters:
  • blocking submission: determines whether the tasks are submitted in blocking mode.
  • task length: the duration in milliseconds (elapsed time) of each submitted task.
  • number of tasks: the number of tasks submitted at once, allowing to effectively control the duration of each iteration.
  • number of iterations: the number of times the tasks you specified will be run. This allows to show the performance optimization algorithm, as you will see the elapsed time for each iteration decrease dramatically, down to a near-optimal value.

You start the demo by clicking on the "Run demo" button, and you can interrupt it at any time by clicking on the "Cancel" button.

The configuration panel

DemoConsole3.gif This panel this panel enables you to configure how the client connects to the JPPF server, and the number of nodes that will be spawned on each run. You can specify the following parameters:
  • number of server connections: specifies how many connections the client will open with the server, effectively defining a connection pool. The tasks submitted by the client will then be balanced between the connections in the pool.
  • number of nodes: specifies how many nodes will be started before the demo is actually executed. This parameter is especially interesting if you have a multi-core or multi-processor machine.

Running the command line demonstrations and tools

Running the "Matrix" demo

Go to the jppf-x.y.z/demo folder.
Type ant run.demo2 to run the demo.
This demo performs the multiplication of 2 square matrices a number of times (default is 5 times, matrix size is 300*300).
The multiplication is divided in as many tasks as there are lines in the first matrix (i.e. 300 by default). Each task can be executed in parallel.
The demo parameters can be changed in the file jppf-x.y.z/demo/config/jppf-client.properties.
The source for this demo can be found in the sample.matrix package of the demo module

Running the "Task Notification" demo

Go to the jppf-x.y.z/demo folder.
Type ant run.demo5 to run the demo.
This sample demonstrates the use of the JPPF remote monitoring capabilities, to request and receive events from the tasks being executed in a node.

It uses the following features:

  • connect to the server's management interface
  • query the server for its attached nodes
  • connect to the nodes' management interface and query for notifications from the tasks

The source for this demo can be found in the sample.notification package of the demo module

Running The "Non-Blocking Client" demo

Go to the jppf-x.y.z/demo folder.
Type ant run.demo3 to run the demo.
This demo runs the Matrix Multiplication demo with an asynchronous task submission mechanism.
While running, it will display a message on the console, each time the server sends a notification that the execution of a task bundle was completed.
The demo parameters can be changed in the file jppf-x.y.z/demo/config/jppf-client.properties
The source for this demo can be found in the sample.matrix package of the demo module

Running The "Connection Pool" demo

Go to the jppf-x.y.z/demo folder.
Type ant run.demo4 to run the demo.
This demo runs muliple matrix multiplications concurrently using a pool of connections to the JPPF server.
The demo parameters can be changed in the file jppf-x.y.z/demo/config/jppf-client-pool.properties
The source for this demo can be found in the sample.matrix.clientpool package of the demo module

Running The "Long Task" demo

Go to the jppf-x.y.z/demo folder.
Type ant run.demo1 to run the demo.
This demo runs a number of tasks with a fixed execution length (default is 10 tasks, 1 second each). Each task can be executed in parallel.
The demo parameters can easily be changed in the file jppf-x.y.z/demo/config/jppf-client.properties
The source for this demo can be found in the sample.tasklength package of the demo module

Running the monitoring and administration tool

Install the framework distribution as specified above.
Go to the jppf-x.y.z/demo folder and type ant run.ui to run the graphical user interface.

Running the XML-based UI Builder

This tool is still experimental and aims at providing a graphical tool to generate JPPF UIs. It uses a framework, developed by the JPPF team, that dynamically generates a graphical user interface from a set of XML descriptors. This tool generates the actual UI, as a hierarchy of Swing components. It does not generate the UI source code.
Interactions between UI components, and between the UI and the rest of the Java application, is implemented using a set of scripts embedded in the XML descriptors.
JPPF currently uses Javascript, however a facility is in place to plug-in any other Java-compatible script language (for instance: Groovy or JPython, and many others.
For instance, both this tool and the JPPF administration tool are built on top of this framework.
You may take a look at their XML/Javascript source in the distribution at this location: jppf-x.y.z/admin/src/resources/org/jppf/ui/options/xml
Install the framework distribution as specified above.
Go to the jppf-x.y.z/demo folder and type ant run.ui.builder to run the builder graphical user interface.

Personal tools