Contents Previous Next Index
|
3 Grid Computing Toolbox
|
|
|
3.1 Introduction to the Grid Computing Toolbox
|
|
|
Overview
|
|
The Grid Computing Toolbox provides tools for performing Maple computations in parallel, allowing you to distribute computations across a network of workstations, a supercomputer, or the CPUs of a multiprocessor machine. It includes a personal grid server, allowing you to simulate and test your parallel applications before running them on a real grid network.
Features of this toolbox include:
•
|
A self-assembling grid in local networks, with an easy-to-use interactive interface for launching parallel jobs.
|
•
|
Integration with job scheduling systems, such as PBS.
|
•
|
High-level parallelization operations, such as map and seq, as well as a generic, parallel divide-and-conquer algorithm.
|
•
|
Automatic deadlock detection and recovery.
|
|
|
Requirements
|
|
Before installing the Grid Computing Toolbox, you must install and activate Maple 16. For details and installation instructions, see the Install.html file on the product CD.
You need a purchase code to activate the Grid Computing Toolbox. This code has been emailed to you. If you have not received your purchase code, contact Maplesoft Customer Service at custservice@maplesoft.com (US and Canada), or the Maplesoft reseller in your region. For a list of resellers, visit http://www.maplesoft.com/contact/international/index.aspx.
Note that if you do not have a valid Grid license, the Grid Computing Toolbox will run in a limited capacity, allowing at most one server per machine and eight nodes in a job.
After installation, the GridComputing.mw file appears on your desktop (Windows and Macintosh) or in your home directory (Linux). Open this file.
|
|
|
3.2 Getting Started with the Grid Computing Toolbox
|
|
|
Establishing a Server and Network
|
|
You can run a server on your desktop machine to develop and test your parallel applications. The Personal Grid Server Personal Grid Server worksheet is an interactive Maple document that can help you start a personal server with any number of nodes.
The following Maple commands are a guideline for configuring your computer for a personal server. The given broadcast mask should ensure that you will not be added to any Grid networks. Note that these settings can be set by default. See the Install.html file for instructions. Configuration details can be found on the Grid/Properties help page.
>
|
|
>
|
|
| (1.2.1.1) |
To run Grid Computing applications on a network of machines, you must start Grid servers on each machine that you want to be part of the network. The toolbox will automatically detect new machines as they are added to the network, or you can turn off auto-discovery for use in a controlled environment, such as a PBS setup.
You will need to re-configure the Grid so that you can create or be added to a Grid network. Change the broadcastAddress and broadcastPort to your network's settings, and then start a server with those settings.
A few simple interactive examples using multiple nodes over multiple machines are in the Grid ComputingGrid Computing worksheet.
You are now ready to use the Grid Computing Toolbox, either on your own computer as a test server, or on a network of computers to run parallel applications.
|
|
Help with Grid Computing
|
|
For a list of commands in Maple to support the Grid Computing Toolbox, see the Grid help page.
|
|
|
3.3 Working with the Grid Computing Toolbox
|
|
As mentioned in the previous section, a few simple examples using multiple nodes over multiple machines can be found in the Grid ComputingGrid Computing worksheet.
The following provides a sample of the commands required to execute such examples. To begin, start a personal server using the local settings from the previous section, or use your network settings to connect with other computers running servers in the Grid Computing Toolbox. The code for this example can be found in the Grid Computing worksheet.
>
|
|
>
|
|
| (1.3.1) |
Define the application or procedure that you want to perform, call it sampleCode. Then execute the following commands to deploy the application sampleCode over the network.
>
|
|
>
|
|
>
|
|
| (1.3.2) |
>
|
|
| (1.3.3) |
When you are finished, make sure to close the connection before you close Maple, by executing the following command.
>
|
|
| (1.3.4) |
The following is a more detailed example of how you can use the Grid Computing Toolbox to create and perform parallel applications on a network of computers.
|
Example
|
|
Consider a fractal, specifically a Julia set, that you want to create and display in Maple. For any more than a few iterations, this can take a long time on a single computer. But you can divide the construction between an arbitrary sized network of computers by using the Grid Computing Toolbox.
First define a Julia set as a procedure, which will determine the color of the plot at point . A Julia set is formally defined as
where is a constant.
>
|
|
Here it is assumed that for m over 30, the sequence z converges. Increasing this number will make the computation more accurate, but take much more time. Define the constant and an appropriate view and grid size for this fractal. If c is changed, then v and gridsize may also need to be changed for the fractal to display properly.
>
|
|
>
|
|
>
|
|
To display the fractal as a plot, use the Julia Set as the color. The procedure plotsegment displays the fractal, and is called by the nodes of the grid separately for each section of the plot.
>
|
|
Define the procedure to be run by the LaunchDefine the procedure to be run by the Launch command, which includes a procedure for splitting up the computation.
>
|
|
Restart the Grid with your computer as the server, as in the above example. Configure the server for your network to run this example over a Grid.
>
|
|
| (1.3.1.1) |
>
|
|
| (1.3.1.2) |
Now you are ready to perform the computation and display the results. Ensure that you pass all assigned variables to the Launch command, or they will not be available on the other nodes of the grid.
The printer is specified as printf, but could be any method of output, including writing to a text area component or a text file. The procedure provides a mechanism for you to stop the computation at any time, on all nodes. In this example, it is always false, so the computation cannot be stopped.
>
|
|
>
|
|
>
|
|
|
With the basic tools shown here, you are now ready to use the Grid Computing Toolbox to solve many large mathematical problems. See the Maple help system for more information about the commands used in this guide, or more examples illustrating how the Grid Computing Toolbox can help you.
|
|
Contents Previous Next Index
|