Skip to content

Parallelisation profile

Andrei Ivasko edited this page Aug 3, 2023 · 2 revisions

Parallelisation profile

Overview

This is a new profiling project for measuring the degree of parallelisation in block processing. The degree of parallelisation is measured under idealised conditions: We assume clairvoyance scheduling, i.e., we know the transaction dependencies ahead of time. In an actual implementation, the transaction dependencies can only be known after executing a smart contract, and a rollback might be necessary if a collision with another transaction is found.

This project is supplied with the set of scripts:

  • run_parallel_experiment.sh starts parallelization profile experiment. It executes build/aida-profile parallelisation command under the hood and writes experimental data into an SQLITE3 database with the following schema for each block:
CREATE TABLE parallelprofile (
	block INTEGER,		-- block number
	tBlock INTEGER,		-- sequential execution time of the whole block              
	tSequential INTEGER,	-- sequential execution time of all transactions
	tCritical INTEGER,		-- parallel execution time of all transactions (i.e. critical path)
	tCommit INTEGER,	-- commit time
	speedup FLOAT,		-- achievable speedup
	ubNumProc INTEGER,	-- upper bound on the number of processors required to achieve speedup using Dilworht's theorem
	numTx INTEGER		-- the number of transactions in a block
        CREATE TABLE IF NOT EXISTS txProfile ( --  measuring runtime of individual transaction
         block INTEGER,
	 tx    INTEGER, 
	 duration INTEGER
       );
);
  • knit.R is a rendering script for R Markdown document
  • parallel_experiment.rmd yields the report for parallelisation profile experiment.

Background

Background and more information about the experiment can be found in the slide stack here: Parallelising Block Transactions.

The current speedup is limited for the first 5-46M blocks (~1.3). It would not warrant implementing parallel execution of transactions due to the small number of transactions per block, their dependencies, and the current large commit time. A parallelisation of transactions inside blocks is more feasible with an increasing number of transactions per block.

Requirements

For building/running this tool, the following tools are required:

  • R: make sure the command Rscript is available on your system.
    • To install R and all needed dependencies on Ubuntu, use sudo apt install r-base-core pandoc libcurl4-openssl-dev libssl-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev
    • To install R packages manually (may be necessary for first-time R usage), start an R session by running the command R, and run the command install.packages(c("rmarkdown", "optparse", "tools", "ggplot2", "dplyr", "RSQLite")) inside the R session. You may be prompted to create a user-specific directory for library dependencies. If so, confirm this.
  • linux environment with installed tools hwinfo, free, git, go, sqlite3, and curl.

Build

make aida-profile

Run

The parameters of the parallel experiment script are as follows:

./scripts/run_parallel_experiment.sh <aida-db> <carmen-impl> <carmen-variant> <tosca-impl> <tmp-directory> <startBlock> <endBlock> <output-directory>

Note: The script must run in the main directory of the Aida repository.

The report will be produced in output-directory.

Clone this wiki locally