{"id":16073277,"url":"https://github.com/nemat-al/parallel_programing_codes","last_synced_at":"2025-04-05T10:26:31.662Z","repository":{"id":234524319,"uuid":"789046045","full_name":"nemat-al/Parallel_Programing_Codes","owner":"nemat-al","description":"Tasks for Parallel Programing Course @ ITMO University ","archived":false,"fork":false,"pushed_at":"2024-04-19T17:06:19.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T21:19:24.768Z","etag":null,"topics":["c-plus-plus","mpi","openmp","parallel-programming"],"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/nemat-al.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}},"created_at":"2024-04-19T15:48:13.000Z","updated_at":"2024-04-19T15:49:36.000Z","dependencies_parsed_at":"2024-04-19T17:57:16.104Z","dependency_job_id":"1c9ba9d6-99e6-4f03-9021-b556eb811e95","html_url":"https://github.com/nemat-al/Parallel_Programing_Codes","commit_stats":null,"previous_names":["nemat-al/parallel_programing_codes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemat-al%2FParallel_Programing_Codes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemat-al%2FParallel_Programing_Codes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemat-al%2FParallel_Programing_Codes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemat-al%2FParallel_Programing_Codes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nemat-al","download_url":"https://codeload.github.com/nemat-al/Parallel_Programing_Codes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247321379,"owners_count":20919980,"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-plus-plus","mpi","openmp","parallel-programming"],"created_at":"2024-10-09T08:05:41.200Z","updated_at":"2025-04-05T10:26:31.642Z","avatar_url":"https://github.com/nemat-al.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Parallel Programing Codes\nImplementing Tasks in OpenMP/MPI C++.\n\nThe tasks are assignements for Parallel Programing Course at ITMO university.\n\n#### 1.[Counting words in a line - OpenMp](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//OMP_Counting_words.cpp)\nThe program aims to count words in a line. Any sequence of characters without separators is considered a word. Separators are spaces, tabs, newlines.\n\n\n#### 2.[Finding the maximum value of a vector - OpenMp](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//OMP_Max_Vector.cpp)\nThe main goal of the program is to find the maximum value of a vector. In order to achieve that, I use the OpenMP reduction clause.\nThe program also studies the dependence of the runtime on the number of threads used (from 1 to 10)\nfor a vector that contains 1,000,000 elements.\n\n\n#### 3.[Matrix multiplication - OpenMp](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//OMP_Mat_Mult.cpp)\nThe program implements two dimension matrix multiplication with different loop orders.\nFor each loop order, the computation is done for one thread then for multiple threads\nfrom 2 to 10. For each case the time of execution and the efficiency are measured. The\narrays are shared among threads, meanwhile the indices are private to prevent different\nthreads from editing them simultaneously.\n\n\n#### 4.[Dot product of vectors - MPI](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//MPI_Dot_product_vectors_7.cpp)\nMPI program that implements the dot product of two vectors distributed\nbetween processes. Two vectors with a size of at least 1,000,000 elements are\ninitialized at process zero and filled with “1”, then they are sent in equal parts to all\nprocesses. Parts of vectors are scalar multiplied on each process, the result is sent to\nthe root process and summed up. The total is displayed\n\n\n#### 5.[Bandwidth measurement - MPI](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//MPI_Bandwidth_measurement_8.cpp)\nMPI program in which two processes exchange messages, the time per exchange iteration is measured, and the dependence of the exchange time on the\nmessage length is studied. \nThe latency and maximum achievable bandwidth of the communication network are calculated.\nThe message length in bytes and the throughput in MB/s is displayed. \nThe length of the message is changed in a loop starting from 1 element and increase to 1,000,000 elements, increasing by 10 times at each\niteration.\n\n\n#### 6.MPI_Reduce - MPI\n[MPI program](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//MPI_Vector_Addition_PTP_9.cpp) in which the global vector addition operation is modeled by a doubling (cascade) scheme using point-to-point data transfers. \n[Another execution](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//MPI_Vector_Addition_Reduce_9_1.cpp) is done using the MPI_Reduce procedure on as many processes as possible.\n\nEach process stores an array of 1,000,000 elements equal to ‘1’\n\n#### 7.[Combined reception and transmission of messages - MPI](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//MPI_Ring_Topology_Exchange_11.cpp)\nMPI program for ring topology exchange using the MPI_Sendrecv() function.\n\n \n#### 8.[Delayed interactions. Scheme of an iterative method with exchange over a ring topology using pending requests - MPI](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//MPI_Ring_Topology_12.cpp)\nMPI allows for non-blocking operations to form whole packets of requests for\ncommunication operations MPI_Send_init and MPI_Recv_init, which are started by the\nMPI_Start or MPI_Startall functions. Checking for completion of execution is performed by\nconventional means using the functions of the WAIT and TEST families.\n\n\n#### 9.[Collective process interactions. Barrier - MPI](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//MPI_Barrier_13.cpp)\nFinding out which process will perform the multiplication of two 500x500 square matrices faster\n\n\n#### 10.[Custom global operations. Custom global function - MPI](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//MPI_Gobal_14.cpp)\nIn the program each thread initializes integer array. The array values are generated in a way\nrelated to the threas’s rank number.\nIn order to gather all the arrays in the root thread, the function MPI_Reduce was used.\nA function max_fun() was initialized to find the maximum value at each position of array.\nIn order to check the correctness of execution, the MPI_MAX operation in the MPI_Reduce()\nfunction was used. \n\n\n#### 11.[Parallel I / O. Working with files. Access to data. Buffered reading from a file. - MPI](https://github.com/nemat-al/Parallel_Programing_Codes/blob/main//MPI_Buffered_Read_File_20.cpp)\nIn order to implement the tasks, several functions were used:\nMPI_File_open() to open a file.\nMPI_File_write() to write the content in the file.\nMPI_File_close() to close the opened file.\nMPI_File_set_view() to select where to start typing inside the file.\nMPI_File_delete() to delete a file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemat-al%2Fparallel_programing_codes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemat-al%2Fparallel_programing_codes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemat-al%2Fparallel_programing_codes/lists"}