Coder Social home page Coder Social logo

lmarzen / heated_plate_openmp Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 71 KB

Solves the 2D steady state heat equation by employing iteration. Uses OpenMP to exploit parallelism with a version for running on CPU and a version that offloads to a GPU target.

License: GNU Lesser General Public License v2.1

C 90.69% Makefile 2.09% Shell 7.22%

heated_plate_openmp's Introduction

heated_plate_openmp

Solves the 2D steady state heat equation by employing iteration. Uses OpenMP to exploit parallelism with a version for running on CPU and a version that offloads to a GPU target.

This project was adapted from John Burkardt's heated_plate_openmp to add OpenMP GPU offload support. His project is licenced under the GNU LGPL and can be found here: https://people.math.sc.edu/Burkardt/c_src/heated_plate/heated_plate.html

Results

-----------------------------------100x100 Matrix
sequential on cpu:
Execution time = 0.032792s
parallel (openmp) on cpu:
Execution time = 0.026418s
parallel (openmp) offloaded to gpu:
Execution time = 0.318115s
-----------------------------------500x500 Matrix
sequential on cpu:
Execution time = 5.845101s
parallel (openmp) on cpu:
Execution time = 1.090781s
parallel (openmp) offloaded to gpu:
Execution time = 3.338174s
-----------------------------------1000x1000 Matrix
sequential on cpu:
Execution time = 27.344904s
parallel (openmp) on cpu:
Execution time = 17.867852s
parallel (openmp) offloaded to gpu:
Execution time = 6.532999s
-----------------------------------5000x5000 Matrix
parallel (openmp) on cpu:
Execution time = 932.651375s
parallel (openmp) offloaded to gpu:
Execution time = 105.804726s

The above results were obtained on the following hardware:

CPU: Intel Core i7-9750H (6 core / 12 thread)

GPU: NVIDIA GeForce GTX 1660 Ti Mobile

Getting Started

See the Makefile for building both the CPU and GPU versions. There is also a benchmark script (benchmark.sh) that will generate the output shown in the results section.

If you are getting segmentation faults on the openmp gpu offload version you may be running out of stack space. Running ulimit -s unlimited may prevent the program from crashing.

heated_plate_openmp's People

Contributors

lmarzen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.