{"id":18898171,"url":"https://github.com/vitumenezes/matrix-multiplication-pthreads-openmp","last_synced_at":"2025-04-15T02:24:28.236Z","repository":{"id":125213436,"uuid":"184626031","full_name":"vitumenezes/matrix-multiplication-pthreads-OpenMP","owner":"vitumenezes","description":"Matrix multiplication using the parallel programming paradigm (shared memory) in C with Pthreads and OpenMP","archived":false,"fork":false,"pushed_at":"2019-06-12T17:29:55.000Z","size":545,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T14:11:18.218Z","etag":null,"topics":["c","openmp","parallel-programming","pthreads","shared-memory"],"latest_commit_sha":null,"homepage":"","language":"C","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/vitumenezes.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-02T17:50:39.000Z","updated_at":"2023-05-05T22:09:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b34efe1-bbea-414c-8d4b-48dff448819d","html_url":"https://github.com/vitumenezes/matrix-multiplication-pthreads-OpenMP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitumenezes%2Fmatrix-multiplication-pthreads-OpenMP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitumenezes%2Fmatrix-multiplication-pthreads-OpenMP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitumenezes%2Fmatrix-multiplication-pthreads-OpenMP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitumenezes%2Fmatrix-multiplication-pthreads-OpenMP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitumenezes","download_url":"https://codeload.github.com/vitumenezes/matrix-multiplication-pthreads-OpenMP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248992540,"owners_count":21195066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","openmp","parallel-programming","pthreads","shared-memory"],"created_at":"2024-11-08T08:41:20.740Z","updated_at":"2025-04-15T02:24:28.209Z","avatar_url":"https://github.com/vitumenezes.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Matrix Calculation With Parallel Programming Using Pthreads and OpenMP (Shared Memory)\n\nPrograms built for the subject \"Special Topics in Internet of Things\" of the bachelor's degree in information technology - BTI of the Federal University of Rio Grande do Norte - UFRN.\n\n## The problem\n\nThe work requires the multiplication between two matrices A and B resulting in a matrix C. By definition, the matrices must be squares, that is, the number of rows is equal to the number of columns. Both the serial implementation and the parallel implementation were made.\n\n## The solutions\n\n### Serial\n\nThe serial program is easy to understand, and some comments were made to improve that.\n\nTo run:\n\nCompilation: `gcc -g -Wall -o serial_matrix serial_matrix_calc.c`  \n\nExecution: `./serial_matrix SZ_OF_PROBLEM`\n\n`SZ_OF_PROBLEM` is a **int** that represents the number of lines of the matrix.\n\n### Parallel\n\nThe parallel implementation was constructed so that each thread created individually calculates a random element of the array C. For this, an auxiliary structure (stack) was created. The elements (pairs x and y) are drawn and stacked so that the threads remove them. This removal occurs in a critical region controlled by a Mutex, in the case of the implementation in pthread.\n\nTo run:\n\nCompilation: `gcc -g -Wall -o matrix matrix_calc.c -lpthread`\n\nExecution: `./matrix SZ_OF_THREADS SZ_OF_PROBLEM`\n\n`SZ_OF_PROBLEM` is a **int** that represents the number of lines of the matrix.  \n`SZ_OF_THREADS` is a **int** that represents the number of threads used.\n\n## Scripts and outputs\n\nTwo scripts were created to atutomate programs. The run-time outputs will ve in the **time_de_exec.txt** and **time_de_exec_serial.txt**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitumenezes%2Fmatrix-multiplication-pthreads-openmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitumenezes%2Fmatrix-multiplication-pthreads-openmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitumenezes%2Fmatrix-multiplication-pthreads-openmp/lists"}