From ab59aec0a456d25bedac524be740937fbbe8d5cd Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 12 Jul 2019 17:31:05 +0200 Subject: add initial(unfinished) README --- README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6ae881a --- /dev/null +++ b/README.md @@ -0,0 +1,64 @@ +#Task solution - numerical integration in fortran# +This repository contains the realization of the [third task](http://home.agh.edu.pl/~macwozni/fort/zadanie3.pdf) of the fortran programming language course at AGH in Cracov. + +##Directory structure## + + Makefile + README.md + run.sh + measure_times.sh + src/ + functions.f90 + quadratures.f90 + main.f90 + res/ + 1image_results + 5images_results + times + +###Makefile### +This file contains recipes for building the fortran program and using it to generate files in `res/`. + +###run.sh### +This scripts is called from `Makefile` to compute numerical integrals of some example functions using different quadratures and numbers of integration subintervals. The script uses `./integral`'s output to create `res/1image_results` and `res/5images_results`. + +###measure_times.sh### +Another script, used in `Makefile` to measure computation speed with different numbers of images and write the results to `res/times`. + +###src/### +This directory contains the fortran sources of the project. + +###res/### +This directory contains result data files with running times of the program and computed integrals with their errors. + +##Building## +As a prerequisite, make, gfortran and opencoarrays are required (I already have my grade, so I didn't do ifort 🙃). +Run + + $ make +to build the program executables `integrator` and `integrator_single` (compiled with -fcoarray=single instead of lib). + +##Running## +The executables are `integrator` and `integrator_single`. The first expected argument is '_analytical_' for analytically computed integral or quadrature type ('_newton-cotes_' or '_gauss_') for numerical integral. Second argument is function to be integrated - '_exp_', '_sin_' or '_poly_' (which is some 10 degree polynomial I made up). Third and fourth arguments are start and end of integration interval. Fifth arg is polynomial order (explained later in this README) and and sixth is the number of subintervals. Arguments 5 and 6 are only needed for numerical integrals. +To run a multi-image version: + + $ cafrun -np IMAGES_NUMBER ./integrator ARGUMENTS +For a single image execution: + + $ ./integrator_single ARGUMENTS +Examples: + + $ ./integrator_single analytical exp 0 1 + 1.7182818284590451 + $ cafrun -np 3 ./integrator gauss exp 0 1 2 1000000 + 1.71828182845905E+00 2.22044604925031E-16 +The small second number of the output is the absolute difference between numerically and analytically computed integrals (numerical error). + +Data in `res/` can be regenerated by issuing + + $ make results + +from the main project directory. + +##Numerical integration## +TODO \ No newline at end of file -- cgit v1.2.3