{"id":25983653,"url":"https://github.com/leonardogemin/parallelcomputing_unipd","last_synced_at":"2026-04-20T07:03:01.006Z","repository":{"id":189534015,"uuid":"671654436","full_name":"leonardoGemin/ParallelComputing_UniPd","owner":"leonardoGemin","description":"Project for the course of Parallel Computing - University of Padua.","archived":false,"fork":false,"pushed_at":"2023-08-21T06:39:59.000Z","size":365,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T10:44:49.097Z","etag":null,"topics":["c","mpi","parallel-computing"],"latest_commit_sha":null,"homepage":"","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leonardoGemin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-27T20:30:04.000Z","updated_at":"2023-09-28T13:18:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7afcecc-167d-4e66-8e36-5ddcc8fc5911","html_url":"https://github.com/leonardoGemin/ParallelComputing_UniPd","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.2222222222222222,"last_synced_commit":"c54a4af91750ef41ec6de0dfbb72c546f671fd98"},"previous_names":["leonardogemin/parallelcomputing_unipd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leonardoGemin/ParallelComputing_UniPd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardoGemin%2FParallelComputing_UniPd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardoGemin%2FParallelComputing_UniPd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardoGemin%2FParallelComputing_UniPd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardoGemin%2FParallelComputing_UniPd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leonardoGemin","download_url":"https://codeload.github.com/leonardoGemin/ParallelComputing_UniPd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardoGemin%2FParallelComputing_UniPd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32036803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","mpi","parallel-computing"],"created_at":"2025-03-05T10:31:39.507Z","updated_at":"2026-04-20T07:03:00.988Z","avatar_url":"https://github.com/leonardoGemin.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Parallel Computing \nMSc project experiences at UNIPD.\n\n\n## Requirements\nInstall MPI: `sudo apt install libcr-dev mpich mpich-doc`\n\n\n## Sequential version\nGiven two square matrices `A` and `B` of same size, `C` is compute as follows:\n\n```\nfor (i = 0; i \u003c SIZE; i++)\n    for (j = 0; j \u003c SIZE; j++)\n        for (k = 0; k \u003c SIZE; k++)\n            C[i][j] += A[i][k] * B[k][j]\n```\n\n* Compile with `gcc -o sequential -O3 sequential.c`\n* Run with `./sequential \u003cSIZE\u003e [unlock verbose mode]`\n\n\n## Parallel version\nGiven two square matrices `A` and `B` of same size, `C` is compute exploiting parallelization.\n\nThere are three variants of optimization:\n1. Just the parallelization of the algorithm, called \"mono\"\n2. \"mono\" + transposition of matrix `B` in order to read both `A` and `B` matrices row-wise order during the inner loop. This leads to less cache misses.\n3. \"mono\" + changing of the order of the loops: from `i-j-k` to `k-i-j`. In this way `A[i][k]` is constant in the inner loop, while `B` and `C` are scanned in row-wise order.\n\n* Compile with `mpicc -o parallel -O3 parallel.c`\n* Run with `mpirun -np \u003cNUM-OF-PROCESSORS\u003e ./parallel \u003cSIZE\u003e \u003cVARIANT: 0 | 1 | 2\u003e [unlock verbose mode]`\n\n\n## How to run on CAPRI server\nPrepare a slurm file called `test.slurm` (just for example) like \n```\n#!/bin/bash\n\n#SBATCH --job-name mmult\n#SBATCH --output 2048_monokij_8.out\n#SBATCH --error 2048_monokij_8.err\n#SBATCH --mail-user leonardo.gemin@studenti.unipd.it\n#SBATCH --mail-type ALL\n#SBATCH --time 10:00\n#SBATCH --ntasks 8\n#SBATCH --partition allgroups\n#SBATCH --mem 200M\n\n\nmpicc -o parallel -O3 parallel.c\n\nfor ((i = 0; i \u003c 10; i++)) do\n    mpirun -np 8 ./parallel 2048 2\ndone\n```\nand submit the job through `sbatch test.slurm`.\n\n\n## Project report\nClick [here](/report/main.pdf) to see the report of the project.\n\n\n## Authors\n* [Massimiliano Viola](https://github.com/massimilianoviola)\n* [Leonardo Gemin](https://github.com/leonardoGemin)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonardogemin%2Fparallelcomputing_unipd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleonardogemin%2Fparallelcomputing_unipd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonardogemin%2Fparallelcomputing_unipd/lists"}