GithubHelp home page GithubHelp logo

matrices's Introduction

Matrices

CS3014 Lab 1: Parallel matrix multiplication

9th February 2015

Complex matrix times matrix multiplication is one of the most important and commonly-performed operations in computational science. The purpose of this labs is to better understand vectorization, code optimiation and parallelization by writing an efficient matrix multiplication routine.

The machine is stoker.scss.tcd.ie. This machine has four processors. Each processor has eight out-of-order pipelined, superscalar cores. And each core has two-way simultaneous multithreading.

To compile with SSE on stoker you should:

  • #include<x86intrin.h> in your C/C++ code
  • compile your program with: gcc -O3 -msse4 file.c To comile with OpenMP, add the flag -fopenmp.

To write an efficient matrix multiplication routine you will need an efficient basic algorithm, but it is also important that you take account of issues such as locality of data access and multiple available processor cores.

Your routine should be written in C/C++, and multiply arrays of double-precision numbers. You may consult books, papers and online sources, but all sources should be acknowledged in your submission. All the submitted code should be your own, however.

Your routine will work on matrices of the following type: struct complex { float real; float imag; };

Your routine should have the following prototype: void matmul(struct complex ** A, struct complex ** B, struct complex ** C, int a_dim1, int a_dim2, int b_dim2)

Where A, B and C are two dimensional arrays of complex numbers with dimensions that make them compatible for multiplication (that is a_dim2 == b_dim1).

The work for this lab should be carried out in pairs, and each pair of students will make a joint submission. The submission should take the form of a working, well-written, commented piece of code, and a 1-2 page docuement descirbing the efforts made to make the code efficient. Both members of the team should be able to fully explain all the code, and should be prepared to stand up in front of the class and speak about their solution.

Your routine should be capable of operating efficiently on a range of matrix sizes and shapes. You must use the following test harness to test and time your code: https://www.scss.tcd.ie/David.Gregg/cs3014/labs/complex-matmul-harness.c

The marks you get for this lab will depend on two things. First, the mark will depend on the code itself --- its correctness, quality and the optimization ideas it contains. Secondly your make will depend on the running time of the code. The faster your code compared to that of other teams, the higher the mark you will get.

Submission details will be agreed after discussion in class.

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.