PyCOMPSs Matrix Multiplication with Objects (inputs generated by the code)
Version 1

Workflow Type: COMPSs

Name: Matrix multiplication with Objects
Contact Person:
Access Level: public
License Agreement: Apache2
Platform: COMPSs


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.

Execution instructions


runcompss --lang=python src/ numberOfBlocks blockSize


  • numberOfBlocks: Number of blocks inside each matrix
  • blockSize: Size of each block

Execution Examples

runcompss --lang=python src/ 16 4
runcompss src/ 16 4
python -m pycompss src/ 16 4


No build is required

Click and drag the diagram to pan, double click or use the controls to zoom.

Version History

COMPSs (earliest) Created 27th Oct 2023 at 14:22 by Raül Sirvent

The run was done using COMPSs, in a laptop (macOS)

Frozen 8e4ee36
help Creators and Submitter
Additional credit

The Workflows and Distributed Computing Team (

Conejero, J. (2023). PyCOMPSs Matrix Multiplication with Objects (inputs generated by the code). WorkflowHub.

Views: 385

Created: 27th Oct 2023 at 14:22

Last updated: 27th Oct 2023 at 14:28

help Attributions


Total size: 2.67 MB
Powered by
Copyright © 2008 - 2023 The University of Manchester and HITS gGmbH