COMPSs Matrix Multiplication, out-of-core using files
**Name:** Matrix Multiplication
**Contact Person:** support-compss@bsc.es
**Access Level:** public
**License Agreement:** Apache2
**Platform:** COMPSs
# Description
Matrix multiplication is a binary operation that takes a pair of matrices and produces another matrix.
If A is an n×m matrix and B is an m×p matrix, the result AB of their multiplication is an n×p matrix defined only if the number of columns m in A is equal to the number of rows m in B. When multiplying A and B, the elements of the rows in A are multiplied with corresponding columns in B.
In this implementation, A and B are square matrices (same number of rows and columns), and so it is the result matrix C. Each matrix is divided in N blocks of M doubles. The multiplication of two blocks is done by a multiply task method with a simple three-nested-loop implementation. When executed with COMPSs, the main program generates N^3^ tasks arranged as N^2^ chains of N tasks in the dependency graph.
# Versions
There are three versions of Matrix Multiplication, depending on the data types used to store the blocks.
## Version 1
''files'', where the matrix blocks are stored in files.
## Version 2
''objects'', where the matrix blocks are represented by objects.
## Version 3
''arrays'', where the matrix blocks are stored in arrays.
# Execution instructions
Usage:
```
runcompss matmul.files.Matmul numberOfBlocks blockSize
runcompss matmul.objects.Matmul numberOfBlocks blockSize
runcompss matmul.arrays.Matmul numberOfBlocks blockSize
```
where:
* numberOfBlocks: Number of blocks inside each matrix
* blockSize: Size of each block
# Execution Example
```
runcompss matmul.objects.Matmul 16 4
runcompss matmul.files.Matmul 16 4
runcompss matmul.arrays.Matmul 16 4
```
# Build
## Option 1: Native java
```
cd ~/tutorial_apps/java/matmul/; javac src/main/java/matmul/*/*.java
cd src/main/java/; jar cf matmul.jar matmul/
cd ../../../; mv src/main/java/matmul.jar jar/
```
## Option 2: Maven
```
cd ~/tutorial_apps/java/matmul/
mvn clean package
```
- Publisher
- [<#ROCrate::Organization https://ror.org/05sd8tv96 @properties={"@id"=>"https://ror.org/05sd8tv96", "@type"=>"Organization", "name"=>"Barcelona Supercomputing Center"}>]
- License
- Apache-2.0
Contents
-
Matmul.java
Size: 4503
Format: text/plain
-
complete_graph.svg
Size: 41971
Format: [["image/svg+xml", <#ROCrate::ContextualEntity https://www.nationalarchives.gov.uk/PRONOM/fmt/92 @properties={"@id"=>"https://www.nationalarchives.gov.uk/PRONOM/fmt/92", "@type"=>"WebSite", "name"=>"Scalable Vector Graphics"}>]]
-
MatmulItf.java
Size: 932
Format: text/plain
-
Matmul.java
Size: 3844
Format: text/plain
-
Block.java
Size: 2598
Format: text/plain
-
MatmulItf.java
Size: 1162
Format: text/plain
-
MatmulImpl.java
Size: 1182
Format: text/plain
-
Matmul.java
Size: 3615
Format: text/plain
-
MatmulItf.java
Size: 1464
Format: text/plain
-
MatmulImpl.java
Size: 940
Format: text/plain
-
App_Profile.json
Size: 342
Format: ["application/json", <#ROCrate::ContextualEntity https://www.nationalarchives.gov.uk/PRONOM/fmt/817 @properties={"@id"=>"https://www.nationalarchives.gov.uk/PRONOM/fmt/817", "@type"=>"WebSite", "name"=>"JSON Data Interchange Format"}>]
-
compss_command_line_arguments.txt
Size: 24
Format: text/plain
-
Block.java
Size: 4341
Format: text/plain
-
project.xml
Size: 289
-
resources.xml
Size: 983
-
pom.xml
Size: 4804
-
Readme
Size: 2092
-
ro-crate-info.yaml
Size: 2823
-
A.0.0
Size: 299
-
A.0.1
Size: 298
-
A.0.2
Size: 298
-
A.0.3
Size: 301
-
A.1.0
Size: 296
-
A.1.1
Size: 299
-
A.1.2
Size: 299
-
A.1.3
Size: 298
-
A.2.0
Size: 296
-
A.2.1
Size: 300
-
A.2.2
Size: 300
-
A.2.3
Size: 300
-
A.3.0
Size: 298
-
A.3.1
Size: 304
-
A.3.2
Size: 300
-
A.3.3
Size: 299
-
B.0.0
Size: 298
-
B.0.1
Size: 293
-
B.0.2
Size: 302
-
B.0.3
Size: 301
-
B.1.0
Size: 300
-
B.1.1
Size: 297
-
B.1.2
Size: 299
-
B.1.3
Size: 299
-
B.2.0
Size: 299
-
B.2.1
Size: 297
-
B.2.2
Size: 302
-
B.2.3
Size: 300
-
B.3.0
Size: 296
-
B.3.1
Size: 297
-
B.3.2
Size: 296
-
B.3.3
Size: 297
-
C.0.0
Size: 295
-
C.0.1
Size: 295
-
C.0.2
Size: 301
-
C.0.3
Size: 301
-
C.1.0
Size: 296
-
C.1.1
Size: 296
-
C.1.2
Size: 295
-
C.1.3
Size: 296
-
C.2.0
Size: 295
-
C.2.1
Size: 298
-
C.2.2
Size: 299
-
C.2.3
Size: 294
-
C.3.0
Size: 299
-
C.3.1
Size: 297
-
C.3.2
Size: 299
-
C.3.3
Size: 297