{"id":18617593,"url":"https://github.com/jamiewarb/parallelcwk2","last_synced_at":"2025-11-03T08:30:29.200Z","repository":{"id":82181733,"uuid":"48172461","full_name":"Jamiewarb/ParallelCwk2","owner":"Jamiewarb","description":"The second coursework for Final Year Bath Comp Sci, Parallel Unit (Open MPI)","archived":false,"fork":false,"pushed_at":"2015-12-24T15:02:09.000Z","size":1577,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T03:42:38.409Z","etag":null,"topics":[],"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/Jamiewarb.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}},"created_at":"2015-12-17T12:12:14.000Z","updated_at":"2016-11-28T13:20:11.000Z","dependencies_parsed_at":"2023-03-16T06:01:09.213Z","dependency_job_id":null,"html_url":"https://github.com/Jamiewarb/ParallelCwk2","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/Jamiewarb%2FParallelCwk2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jamiewarb%2FParallelCwk2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jamiewarb%2FParallelCwk2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jamiewarb%2FParallelCwk2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jamiewarb","download_url":"https://codeload.github.com/Jamiewarb/ParallelCwk2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239412507,"owners_count":19634016,"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":[],"created_at":"2024-11-07T03:41:24.073Z","updated_at":"2025-11-03T08:30:29.165Z","avatar_url":"https://github.com/Jamiewarb.png","language":"C","readme":"# Parallel Computing - Coursework 2 (Open MPI)\nThe second coursework for Final Year Bath Comp Sci, Parallel Computing unit\n\n####Contents\nThis zip contains 3 folders:  \nSource, Values and Testing\n\n**Source** - the actual compilable .c code  \n**Values** - the .txt file with the numbers that the program will use  \n**Testing** - the testing document, the values utilised by it and the test output logs  \n\n####Compiling and Running\nCompile sequential.c using `gcc -Wall -o sequential sequential.c -lrt`  \nCompile ompi-parallel.c using `mpicc -Wall -o ompi-parallel ompi-parallel.c`\n\nBoth programs can be run with these possible flags:  \n-debug : The level of debug output: 0, 1, 2, 3 (*default: 1*)  \n-d : integer length of the square array (*default: 1000*)  \n-p : how precise the relaxation needs to be before the program ends, as a double (*default: 0.0001*)  \n-g : (1 or 0) 0 to use values from file specified, 1 to generate them randomly (*default: 0*)  \n-f : string, path of the textfile to use (*default: ../Values/values.txt*)  \n\nFor example: \n* `./sequential -debug 2 -d 500 -p 0.01 -f values.txt`\n* `mpirun -np 16 ./ompi-parallel -debug 1 -d 10000 -p 0.001`  \n\nExcluding a flag will use the default value.\n\n####Value Sets\nBy default, the program reads from the text file at Values/values.txt, as generating numbers makes testing more obtuse.  \nCapability to run with generated numbers is, however, provided through -g 1.  \n\nThe program will read doubles from a file until enough have been read.  \nReaching EOF will rewind the file and continue reading from the start.\n\n####How does ompi-parallel code work?\n* Initially, the master thread creates a matrix from an input file, looping through the file more than once if necessary.  \n* Next, the master sets a start and end row for itself and each other process, then sends out the specific chunks of\nthe matrix to each process, including an extra row top and bottom, used in the relaxation process.  \n* The master and all the slaves then relax their own portion of the matrix.  \n* Each process tells the master if it went out of precision or not. If any process went out of precision, the Master tells everyone\nthat they need to continue.  \n* When they continue, each process sends its top and bottom editable rows to its neighbouring processes. It also receives a top and bottom\nun-editable row from those neighbouring processes. This is all the thread needs for its next iteration.  \n* Once an iteration occurs where all processes stay within precision, the processes finally send their chunk of the matrix back to\nthe master thread, who combines it all for the finished result.  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiewarb%2Fparallelcwk2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamiewarb%2Fparallelcwk2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiewarb%2Fparallelcwk2/lists"}