Code Monkey home page Code Monkey logo

hpc-project's Introduction

HIGH PERFOMANCE COMPUTING PROJECT

Parallelization of the Game of Life in openMP, MPI and CUDA

Compilation and Execution

With Makefile and Script


Compilation


In the folder Project there is the makefile that compiles the OpenMP, MPI, the sequential version repectively in the folder OpenMP, MPI and Project. So, is possible to compile these file with the make command from bash. All the bin files will be located in the folder bin.

Execution


In each folder MPI,OpenMP and Project there are the scripts bash that execute the program with the parameters mentioned in the report . The MPI script doesn't shows the evolution also for the small dimensions ( number of columns < 1000 ). If you want see the evolution on the terminal for small dimentions, change in the MPI script, the flag not_show_evolution from 1 to 0.
To execute with the script, in the folder in which is located the script:

bash name_of_the_script.sh

Without Makefile and Script


In the folder in which are contained the files, Project for the serial, MPI, OpenMp and CUDA for the other.

Common execution parameters:
  • nRows, nCols are respectively the number of rows and columns of the Game of Life grid.
  • timesteps are the number of time step with which execute the game.

Serial


Compilation


No Vectorization
icc -O0 glife_sequential.c -o gol_sequntial
With Vectorization
icc -O3 -ipo -xHost glife_sequential.c -o gol_sequntial

Execution

./gol_sequential nRows nCols timesteps

OpenMP


Compilation

icc experiment03.c -qopenmp -o gol_omp

Execution

./gol_omp nRows nCols timesteps number_of_threads

MPI


Compilation

mpiicc main_MPI.c ../utils.c mpi_utils.c -o gol_mpi

Execution


MPI execution parameters:

  • host_list_n.txt is file that contains the list of the host used, and n must be replace with the number of nodes ( 1, 2, 4, 8). These files are located in the folder MPI/hostfile, and there is a file for each nuber of node.

  • n_process_per_host is the number of process that each node must executes.

  • tot_procesess is the total number of processes.

  • Version ( 1 or 2) is the display version used. The experiments are made with the version 2.

  • show_result is a flag that indicates if show or not the evolution of the game in the terminal for nCols lower than 1000. 0 to see the evolution on the terminal, 1 otherwise.

  • nNodes is the number of nodes of the cluster used, and must be the same of the hostfile choosen (1, 2, 4, 8).

mpiexec -hostfile host_list_n.txt -perhost n_process_per_host -np tot_procesesses ./gol_mpi nRows nCols timesteps version show_result nNodes

CUDA


Compilation

nvcc  gol_cuda.cu -o gol_cuda

Execution

In this case, the parameter number_of_threads must be a multiple of 32, and the max is 1024.

./gol_cuda nRows nCols number_of_threads

Contributors:

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.