2023-12-12 15:34:54 +00:00
|
|
|
# Project for PWR
|
2024-01-13 13:00:04 +00:00
|
|
|
Project in python for module "Praktikum Wissenschaftliches Rechnen" in "Applied Mathematics" at *TU Bergakademie Freiberg*.
|
2023-12-12 13:31:09 +00:00
|
|
|
|
2023-12-12 15:34:54 +00:00
|
|
|
# Task
|
2024-07-27 13:44:21 +00:00
|
|
|
Implement MPI parallel Matrix and Vector classes in Python and apply them to a numerical problem / algorithm.
|
|
|
|
1. Diagonalmatrix times vector
|
|
|
|
2. Matrix from exercise 1 times vector
|
|
|
|
3. Conjugated Gradient
|
|
|
|
|
|
|
|
# Structure of mains
|
|
|
|
## Timings in Shell
|
|
|
|
If you want to measure time with `time` and the whole program, then use the `main_[name].py` files.
|
|
|
|
Within the files you can set the size `n` of the matrix and vector.
|
|
|
|
See pbs script [pwr_project.script](./pbs_scripts/pwr_project.script) for automatic use on the cluster.
|
|
|
|
Following pythin scripts are the entry point for the tasks:
|
|
|
|
- [Diagonalmatrix times Vector](./src/main_diag_vec.py): [main_diag_vec.py](./src/main_diag_vec.py)
|
|
|
|
- [Matrix from exercise 1 times Vector](./src/main_matrix_vec.py): [main_matrix_vec.py](./src/main_matrix_vec.py)
|
|
|
|
- [CG](./src/main_cg.py): [main_cg.py](./src/main_cg.py)
|
|
|
|
|
|
|
|
## Specific timings
|
|
|
|
If you want to measure only the times a operation needs (without initializing),
|
|
|
|
then use the `main_[name]_timeit.py` files.
|
|
|
|
The matrix/vector size `n` must be provided via command line,
|
|
|
|
e.g. `python3 main_cg.py 100` for the CG with a matrix size of `100`.
|
|
|
|
See pbs script [pwr_project_timeit.script](./pbs_scripts/pwr_project_timeit.script) for automatic use on the cluster.
|
|
|
|
Following pythin scripts are the entry point for the tasks:
|
|
|
|
- [Diagonalmatrix times Vector](./src/main_diag_vec_timeit.py): [main_diag_vec.py](./src/main_diag_vec_timeit.py)
|
|
|
|
- [Matrix from exercise 1 times Vector](./src/main_matrix_vec_timeit.py): [main_matrix_vec.py](./src/main_matrix_vec_timeit.py)
|
|
|
|
- [CG](./src/main_cg_timeit.py): [main_cg.py](./src/main_cg_timeit.py)
|
|
|
|
|
|
|
|
## Weak scaling
|
|
|
|
For the weak scaling measurements use pbs script [pwr_project_timeit_weak.script](./pbs_scripts/pwr_project_timeit_weak.script).
|