Jump to: navigation, search
MAPLE
Description: A sophisticated computer algebra system for symbolic and numerical computing
SHARCNET Package information: see MAPLE software page in web portal
Full list of SHARCNET supported software

## Introduction

Maple is a sophisticated computer algebra system for symbolic and numerical computing. Maple Release 15 includes thread and grid toolboxes that support parallel processing on multicore systems and clusters. The access to Maple is restricted to the institutions that have site licenses. The following instructions are institution specific. Please contact your home institution IT department for license information.

## MAPLE 16 And Grid Computing Toolbox Trial license

For those who do not use Grid Computing Toolbox, please skip to the section of your institution site.

A free trial license for MAPLE 16 and the Grid Computing Toolbox provided by Maplesoft is available on SHARCNET clusters, orca and hound, for all ShARCNET users. The usage instructions are

### Path Setting

Add the following lines into your shell .bash_profile file (/home/yourid/.bash_profile)

```#for MAPLE_16 and Grid Computing Toolbox
export PATH=/opt/sharcnet/testing/maple/maple16/bin:\$PATH
```

logout, and login again to effect the setting. To confirm, type 'which maple' should display

```[...:~] which maple
/opt/sharcnet/testing/maple/maple16/bin/maple
```

### Examples

The following is a Maple code checking prime numbers

```primeChecker := proc()
uses Grid;
local nn, thisNode, i, myVal, rslt, rply, t1, t2, b1;

nn := NumNodes();
printf("NumNodes = %a\n", nn);
thisNode := MyNode();
printf("MyNode = %a\n", thisNode);
myVal := rand(1001..10001)();
printf("Value     %a\n", myVal);

b1:= isprime(myVal);
rslt := [ ifactor(myVal), b1];
printf("Computed Result = %a\n", rslt);
if thisNode <> 0 then
printf("Node %d sending   %a\n",thisNode, rslt);
Send(0, rslt);
rply := NULL;
else
rply := rslt;
t1 := time[real]();
for i from 1 to (nn-1) do
printf("Node %d waiting for Receive\n",thisNode);
rslt := Receive(i);
printf("Received     %a\n", rslt);
rply := rply, rslt;
t2 := time[real]();
t1 := t2;
end do;
printf("Sample points = %a\n",[rply]);
end if;
printf("Node %d done, rply = %a \n",thisNode,[rply]);
return [rply];
end proc:

#!ls /opt/sharcnet/openmpi/1.6.2/intel/lib/openmpi

Grid:-Setup("mpi", 'mpidll'="mpi", 'mpiwrapper'="mpiwrapper" ):
randomize(iolib(25)+kernelopts(pid)*10^11);
seq( primeChecker(), i=1..10):
#Grid:-Barrier();
```

For more examples, login to any SHARCNET system and navigate to

```/work/jemmyhu/maple/test/
```

### Running Maple Code as A Batch Job

One in general shall run Maple code (and any code) as a "job" by submitting it to the batch job scheduler. The job scheduler will start your job at a later time once the resources requested, being the CPU(s) or memory size, become available and can be dedicated to your code.

Prepare your Maple input file, name.mpl, in your /work directory, and submit the job from the input file directory. For example, I have the input file 'l00.mpl', use sqsub command (--mpp is to reserve memory, see 'sqsub -h' for details)

```sqsub --mpp=1g -r 1.0h -o l00.mpl.log maple l00.mpl
```

To run Grid, you need to code with Grid, assuming the input file is 'prime2.mpl', use 4 nodes each with 2 cpus (8 cpus in total) to run your job, the sqsub command will be

```sqsub -q mpi -N 4 --ppn 2 --mpp=1g -r 1.0h -o prime2.mpl.log gridlaunch prime2.mpl
```

### GUI / Visualization

MAPLE GUI can only be run on orca's development nodes (orc-dev1, orc-dev2, orc-dev3, orc-dev4). First login to orca.sharcnet.ca with X tunneling option

```ssh -X orca.sharcnet.ca
```

then ssh -X to one of the development nodes, e.g.

```ssh orc-dev3 -X
```

For Windows users, you need to have an X server running on Windows before login to orca. There are a few free X servers for Windows, including cygwin/X, Xming and MobaXterm.

Once you are on an orca development node, you may start the Maple GUI, e.g.

```[jemmyhu@orc130:~/work/maple/test] xmaple
```

### General Notices

We do not know much about MAPLE Grid Computing Toolbox at the present, for Maple coding issues, please go to Maplesoft website for help http://www.maplesoft.com/

## Western University Site

Maple 15 and 16 are available on two large systems: goblin.sharcnet.ca and kraken.sharcnet.ca, as well as several visualization workstations on Western's campus.

On both goblin and kraken, first load module

```module load maple
```

This will add the paths to the binaries and the libraries to the search paths, so that one can invoke maple anywhere without specifying the binary and library paths. The environments set by module will be inherited on the compute nodes when the jobs are dispatched there by the scheduler.

To test the interactive environment, login to viz5-uwo.sharcnet.ca. At the command line, type

```/opt/sharcnet/local/maple/version/bin/maple
```

where version refers to 15 or 16.

Please keep in mind, however, that the interactive use of maple is strongly discouraged. Users are not expected to run any programmes on the login node except for compilation and editing files. User programms running out side the schedule on the login nodes will be terminated by the monito -rring system.

To run Maple code on kraken (recommended), submit jobs using the following command

```sqsub -q serial [ -f bul ] -o mycode.log -r 2.5h --mpp=5G maple mycode.mpl
```

where option -f bul specifies the destination cluster bull (mandatory for kraken only) -o mycode.log specifies the output file name, -r 2.5h specifies the run time estimate (this is mandatory) and --mpp=5G tells the scheduler you need 5GB memory to run the code, so that the scheduler will find the place where there is enough memory to accommodate your code.

If one encounters the error when invoking maple

```Maple initialization error, maple: process limit must be at least 50
```

which indicates the number of user processes allowed on the system is less than 50, one needs to raise the process limit with command

```ulimit -u 100
```

or, if this fails, contact the system administrators.

For running multicore jobs, please contact the local staff [1] for details.

For parallel processing on clusters, one needs the Grid Computing Toolbox (GCT) license, which is sold separately. Currently The University of Western Ontario does not hold the license for GCT. Individuals who want to use Maple GCT must obtain their own license from MapleSoft [2].

## University of Waterloo Site

Please check with local staff[3].

## Brock University Site

Please contact SHARCNET staff[4].