Giter VIP home page Giter VIP logo

malferrari48 / hpc_assignments_group7 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.13 MB

The set of two assignments made during the "High performance computing" course: one with OpenMP and the other with CUDA. Profiling was also done in both. My final grade was 28/30 including the oral exam.

License: MIT License

Makefile 5.27% Cuda 15.07% C 79.66%
cuda openmp threads perf polybench gprof

hpc_assignments_group7's Introduction

HPC OpenMP assignment Group 7

Authors

Francesco Malferrari (193103), Gianluca Siligardi (185068) and Andrea Somenzi (232254)

Description

This is the exam project for UniMORE High Performance Computing course. The goal is to minimize the execution time of the DynProg solver of the Polybench C library through:

  • Profiling and bottleneck research
  • Code rewriting
  • Parallelization with
    • OpenMP
    • CUDA

Folders in the repository

  • /dynprog : original version of the file assigned
  • /fast_dynprog : the fastest version of the written dynprog. It has been uploaded for completeness, however it has an error due to the precision of floating point type.
  • /OpenMP
  • /Cuda

OpenMP folder

This folder contains the sources of the first assignment:

  • the rewritten DynProg rew_dynprog.c in /rew_dynprog
  • the OpenMP parallelization of the rewritten DynProg parallel_dynprog.c in /parallel_dynprog
  • the OpenMP parallelization over Nvidia Jetson Nano GPU of the rewritten DynProg gpu_dynprog.c in /gpu_dynprog

Visuals

/OpenMP folder contains also the presentation of the results of the first assignment.

Cuda folder

This folder contains the sources of the second assignment:

  • Makefile: the Makefile for .cu files
  • cuda_dynprog.cu: the CUDA optimization of the rewritten version of dynprog.c

Visuals

/Cuda folder contains also the presentation of the results of the second assignment.

How to compile

Into each directory run this command:

make EXT_CFLAGS="-DPOLYBENCH_TIME -DPOLYBENCH_DUMP_ARRAYS" clean all run

You can also specify the dataset size adding the flag DATASET and writing one of the listed in the header file /dynprog/dynprog.h, for example:

make EXT_CFLAGS="-DLARGE_DATASET -DPOLYBENCH_TIME -DPOLYBENCH_DUMP_ARRAYS" clean all run

Alternatively, if you want to use datasets not present in the header file, you can replace the flag DATASET whith the following flags setted with numbers of your interest:

-DLENGTH=10000 -DTSTEPS=20

It is also possible to specify the number of threads with the following flag:

"-DNTHREADS=4" 

but in our case having a four threads machine, it was defined in the code.

Before running these commands, to compile gpu_dynprog.c, you must run

module load clang/11.0.0 cuda/10.0

to load the cuda library.

hpc_assignments_group7's People

Contributors

malferrari avatar sommy88 avatar marcus20000 avatar malferrari48 avatar

Watchers

 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.