Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smt116/zjp-problems
Monte Carlo, Matrix multiplication, Computing Integral - sequential and parallel (MPI) programs.
https://github.com/smt116/zjp-problems
Last synced: 18 days ago
JSON representation
Monte Carlo, Matrix multiplication, Computing Integral - sequential and parallel (MPI) programs.
- Host: GitHub
- URL: https://github.com/smt116/zjp-problems
- Owner: smt116
- Created: 2013-10-19T13:59:13.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-21T12:54:23.000Z (about 11 years ago)
- Last Synced: 2024-04-14T15:03:28.587Z (9 months ago)
- Language: C
- Homepage:
- Size: 242 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zaawansowane Języki Programowania (UG).
Problems:
* monte carlo (computing PI)
* integral (computing integral using trapezoid method)
* matrics multiplicationSequential and parallel (using MPI) programs.
## Compilation - HowTo
#### Compile the static library (helper)
```bash
$ cd c-libs
$ make libs
```#### integral
```bash
$ cd integral
$ make
```#### monte_carlo
```bash
$ cd monte_carlo
$ make
```#### matrix_multiplication
```bash
$ cd matrix_multiplication
$ make
```## Running programs
**Program will not check if input data is correct!**
#### integral
`f(x) = e^(-x^2)` -- you can provide another f(x) in `lib.c`
##### Sequential program
```bash
# a, b - [a, b]
# n - granularity (number of points between a and b)
$ ./seq_app -a -2.5 -b 2.5 -n 100
```##### Parallel program (MPI)
```bash
# np - number of threads
# a, b - [a, b]
# n - granularity (number of points between a and b)
$ ./seq_app -a -2.5 -b 2.5 -n 100
$ mpirun -np 8 par_app -a -2.5 -b 2.5 -n 64
```#### monte_carlo
##### Sequential program
```bash
# --pairs - number of points in [0, a] x [0,b]
# --time - print the time of computing
$ ./seq_app --pairs 1024 --time 1
```##### Parallel program (MPI)
```bash
# -np - number of threads
# --pairs - number of points in [0, a] x [0,b]
# --time - print the time of computing
$ mpirun -np 8 par_app --pairs 1024 --time 1
```#### matrix_multiplication
##### Sequential program
```bash
# -a - dimension of A[a, a]
# -x - dimension of x[a, x]
# --size - size = a = x (will overwrite a and x)
# --maxvalue - max value of each number in matrics (values are random)
$ ./seq_app --size 512
```##### Parallel program (MPI)
```bash
# np - number of threads
# -a - dimension of A[a, a]
# -x - dimension of x[a, x]
# --size - size = a = x (will overwrite a and x)
# --maxvalue - max value of each number in matrics (values are random)
$ mpirun -np 8 par_app --size 512
```