{"id":15015396,"url":"https://github.com/ghonimo/heat-diffusion-grid-simulation-using-mpi-ece588","last_synced_at":"2026-04-02T01:13:25.170Z","repository":{"id":227987449,"uuid":"753426458","full_name":"Ghonimo/Heat-Diffusion-Grid-Simulation-using-MPI-ECE588","owner":"Ghonimo","description":"This repository contains the code and documentation for a parallelized heat diffusion simulator implemented using the Message Passing Interface (MPI). It simulates the diffusion of heat across a 2D grid, using a finite difference method to calculate temperature changes over time. This program was designed for Portland State University ECE 588 Class","archived":false,"fork":false,"pushed_at":"2024-03-02T23:37:33.000Z","size":4844,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T00:18:07.536Z","etag":null,"topics":["c","heatmap","mpi","mpi-applications","mpich","parallel-computing","parallel-programming","perl","portland-state-university"],"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/Ghonimo.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":"2024-02-06T05:05:00.000Z","updated_at":"2024-03-16T04:36:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"88fc780d-1205-4824-8042-e1619a637338","html_url":"https://github.com/Ghonimo/Heat-Diffusion-Grid-Simulation-using-MPI-ECE588","commit_stats":null,"previous_names":["ghonimo/heat-diffusion-grid-simulation-using-mpi-ece588"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghonimo%2FHeat-Diffusion-Grid-Simulation-using-MPI-ECE588","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghonimo%2FHeat-Diffusion-Grid-Simulation-using-MPI-ECE588/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghonimo%2FHeat-Diffusion-Grid-Simulation-using-MPI-ECE588/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghonimo%2FHeat-Diffusion-Grid-Simulation-using-MPI-ECE588/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ghonimo","download_url":"https://codeload.github.com/Ghonimo/Heat-Diffusion-Grid-Simulation-using-MPI-ECE588/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243313614,"owners_count":20271215,"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","heatmap","mpi","mpi-applications","mpich","parallel-computing","parallel-programming","perl","portland-state-university"],"created_at":"2024-09-24T19:47:21.783Z","updated_at":"2025-12-29T02:05:12.715Z","avatar_url":"https://github.com/Ghonimo.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Heat Distribution Simulation using MPI\n\nThis repository contains a C program designed to simulate heat distribution across a 2D grid. The simulation is parallelized using the Message Passing Interface (MPI) to enhance performance and demonstrate the application of distributed computing in computational physics problems.\n\n## Problem Description\n\nThe program models the temporal evolution of heat distribution on a 2D grid, representing a simplified scenario of heat conduction in a square plate. The simulation uses a finite difference method to approximate the heat equation, with specific initial and boundary conditions.\n\n### Initial and Boundary Conditions\n\n- **Grid Size**: The computational domain is a 2D grid of size 1000 x 1000 points.\n- **Initial Temperature Distribution**: \n  - All points within the central region defined by coordinates (200, 200) to (800, 800) are initialized to 500 degrees.\n  - The temperature of all other points is set to zero.\n- **Boundary Conditions**: Points on the boundary of the grid maintain a constant temperature of zero throughout the simulation.\n\n### Simulation Parameters\n\nT(x,y)(t) = T(x,y)(t-1) + Cx * (T(x+1,y)(t-1) + T(x-1,y)(t-1) – 2 * T(x,y)(t-1)) \n                      + Cy * (T(x,y+1)(t-1) + T(x,y-1)(t-1) – 2 * T(x,y)(t-1))\n\n\n\nWhere `Cx` and `Cy` are constants that govern the rate of heat transfer along the x and y axes, respectively.\n\n- **Time Steps**: The simulation progresses through 4000 time steps.\n- **Reporting**: After every 200 time steps, the program prints the temperatures at specific grid points: (1, 1), (150,150), (400, 400), (500, 500), (750, 750), and (900,900).\n\n## Implementation Details\n\nThe program is implemented in C and utilizes MPI to distribute the computation across multiple processors within a distributed memory system, aiming for a high degree of parallel speedup. The domain is divided among the MPI processes, each responsible for a portion of the grid. MPI collectives and point-to-point communication are used to synchronize boundary conditions and gather results.\n\n## Building and Running\n\nTo compile the program with MPI, use:\n\n```bash\nmpicc -o HW4_1 HW4_1.c\n```\n\nTo run the compiled binary across a specific number of processes:\n\n```bash\nmpirun -np \u003cnum_processes\u003e ./HW4_1\n```\nTo run in batch more, comparing the performance of with different cores, you can execute the perl script below:\n\n```bash\n./automate/batch_run.pl\n```\n\n## Output\nThe program outputs the temperatures of specified grid points after every 200 timesteps and displays the total runtime in nanoseconds and seconds.\n\n## License\nThis project is open-sourced under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghonimo%2Fheat-diffusion-grid-simulation-using-mpi-ece588","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghonimo%2Fheat-diffusion-grid-simulation-using-mpi-ece588","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghonimo%2Fheat-diffusion-grid-simulation-using-mpi-ece588/lists"}