Coder Social home page Coder Social logo

jakubowiczish / fortran-task1 Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 262 KB

My solution for Fortran assignment - task 1

Fortran 93.68% CMake 6.32%
fortran fortran90 ifort fortran-language fortran-modules matrix-multiplication matrix matrix-computations

fortran-task1's Introduction

My solution for Fortran assignment - task 1

Requirements

  • ifort - Intel Fortran Compiler installed

Run project

In order to run this project, type following commands in the main project directory:

cmake CMakeLists.txt
make all
./mull

Conclusions

You can see below plots that are presenting the results of matrix multiplications - the time it took for every matrix depending on its size (N)

Kind = 4

alt text

  • The advantage of matmul method - that is built in fortran - can be observed especially when kind = 4 and kind = 8. It's significantly faster, probably because of its optimalization and some tricks that are used in its implementation.

  • The second fastest method is bettmull - it does much less operations than naivmull method and the difference is apparent.

  • Dotmull method is slightly faster than naivmull, but the disparity is hardly noticeable for larger matrices.

Kind = 8

alt text

This case is quite similar to the previous one.

  • Matmul method is still the fastest method, betmull somewhat slower.
  • Results for naivmull and dotmull methods are almost the same.

Kind = 16

alt text

Major diffences can be noticed only when kind is equal to 16 and matrices are really large, although this plot does not present it in the most suitable way - I guess logarithmic scale would be better.

The operation of matrix multiplication itself can take significant of time.

There's a huge gap between all methods when the size of matrix is 1280 x 1280.

  • It took almost 130 seconds for naive method to actually multiply matrices
  • Dotmull method was the worst one - operation lasted over 200 seconds!
  • Matmul method was best as usual - 78 seconds in comparison to over 200 is quite magnificent.
  • Betmull method took second place, also as usual - 87 seconds is still pretty nice time.

I honestly believe that everything was done properly, although bear in mind the fact that the results may differ depending on what computer you run this project etc.

fortran-task1's People

Contributors

jakubowiczish avatar

Stargazers

 avatar  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.