Back to the table of contents
# The calculations on a supercomputer

## 13.1 Parallel polynomial computations

## 13.2 Parallel matrix computations

In order to solve computational problems that require large computation time or large amounts of memory, the system has special functions that provide the user with resources of supercomputer. These functions allow you to perform calculations on a dedicated set of cores. The number of kernels ordered by the user.

You have the following functions ( * 3ar-functions*) that apply to supercomputer:

1) matMultPar1x8 — calculation of the matrix product;

2) adjointDetPar — computation of the adjoint matrix and determinant;

3) charPolPar — computation of the characteristic polynomial of a matrix;

4) polMultPar — computation of the product of two polynomials;

5) BellmanEquationParA — solution of a homogeneous Bellman equation $Ax=x$;

6) BellmanEquationParA,b — solution of an inhomogeneous Bellman equation $Ax+b=x$;

7) BellmanInequalityParA — solution of a homogeneous Bellman inequality $Ax\leq x$;

8) BellmanInequalityParA,b — solution of an inhomogeneous Bellman inequality $Ax+b\leq x$;

%1) gbasisPar — computation of Grobner basis;

%2) adjointPar — computation of the adjoint matrix;

%3) adjointDetPar — computation of the adjoint matrix and determinant of the matrix;

%4) echelonFormPar — computation of the matrix echelon form;

%%5) inversePar — computation of the inverse matrix;

%6) detPar — computation of the determinant of the matrix;

%7) kernelPar — computation of the kernel of a linear operator;

Before applying any of these functions, the user must specify the parameters that define the parallel environment:

$ TOTALNODES $ — total number of processors (cores), which provides for the computation

$ PROCPERNODE $ — number of cores on a single node,

$ CLUSTERTIME $ — maximum time (in minutes) execution of the program, after which the program is forced to end.

$MAXCLUSTERMEMORY$ — amount of memory allocated for the JVM for a one process (for -Xmx parameter).

To set the number of cores on a single node the user must know what a cluster is used and how many cores it is available on the node. By default, the $ TOTALPROCNUMBER $ and $ NODEPROCNUMBER $ installed so that all the cores were used per node, and $ CLUSTERTIME = 1 $.

The user can change the number of cores on a single node. This is an important feature, since the memory on a single node is used by all $ NODEPROCNUMBER $ cores. Consequently, the user can regulate the size of of RAM that is available to one core.

For parallel computation of the polynomial product you can use the multiplyPar(p1, p2), where $ p1 $, $ p2 $ — given polynomials.

No result yet

%% For parallel computing Grobner basis you must use the % gbasisPar([p1, p2, p3,…, pn]), where $p1, p2, p3,…, pn$ — polynomials. % %

No result yet

For parallel computing products of matrices $ m1 $ and $ m2 $ you must use the multiplyPar(m1, m2).

No result yet

For parallel computation of the adjoint matrix for the matrix $ m $ you can use the adjointPar(m). Similarly, for the matrix $ m $ you can perform the calculation of the echelon form echelonFormPar(m), the computation of the determinant detPar(m), computation of the kernel kernelPar(m), the calculation of the characteristic polynomial charPolPar(m). The command adjointDetPar(m) allows us to calculate the determinant and adjoint matrix simultaneously.

No result yet

section {Running your parallel programs} Mathpar allows you to download and execute your parallel programs. Your package must be in the root directory of the project. To ensure that your program is able to interact with the system management tasks, you need to add an initialization string

** QueryResult queryRes = Tools.getDataFromClusterRootNode (args)**

\noindent (immediately after MPI.Init) and the completion string

** Tools.sendFinishMessage (args)**

\noindent (before MPI.Finalize) in your main-method. You can also pass any arguments to your program from the web-interface Mathpartner. Within the program you can get them by calling queryRes.getData (). Below is an example of a parallel program that simply outputs on standard output the arguments passed to it.

No result yet

After that you need to compile the program, and the program folder packed in zip-archive.Then you need to download this file to the server, using the tab "File" and clicking "download file". RAM is divided equally between all cores. For example, if the cluster node has 8GB of memory, then if you request 4 cores on a single processor, each will receive 2GB, and if you have requested one core - then it will get 8GB.

The command to download your zip-archive, which contains java-classes, as follows:

uploadToCluster} {(FileName), where FileName - name of zip-archive.

To view a list of all your downloaded files on a cluster, use the command

showFileList} {().

To run your program, use the command

{runUploadedClass(archieveName, classPath, param0, param1, ...),
where
** archieveName** - the name of the downloaded zip-archive with the program,
** classPath** - the path to the class containing main-method (full path with the packages)
** paramX** - arbitrary parameters specified separated by commas, to be passed to your program.

To monitor the running programs, use the command

{getStatus(taskID)

It is also possible to get a list of all the tasks of the current user with a description of their states:

{showTaskList()

To receive the content from the output stream and error stream, use the commands

{getOut(taskID)

{getErr(taskID)

Files that contain output or error stored on a cluster of two days, zip-archives containing the compiled java-classes are stored for 30 days. Back to the table of contents