mirror of
https://gitlab.com/Trygve/contour-creator.git
synced 2024-11-23 07:40:17 +00:00
Update documentation
This commit is contained in:
parent
c94a59616a
commit
6469a26cf1
2
Doxyfile
2
Doxyfile
@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8
|
||||
# title of most generated pages and in a few other places.
|
||||
# The default value is: My Project.
|
||||
|
||||
PROJECT_NAME = "Marching Squares"
|
||||
PROJECT_NAME = "Contour Creator"
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
|
18
README.md
18
README.md
@ -6,8 +6,19 @@ This is our project for the INF205: Resource-efficient programming course
|
||||
- [x] Run the marching squares algorithm and produce a "cellmap"
|
||||
- [ ] Use a lookuptable to produce a vector file from the "cellmap"
|
||||
## Dependencies
|
||||
- GDAL
|
||||
- GDAL >= 3.5
|
||||
- OpenMP
|
||||
- CMake
|
||||
|
||||
If you want to clone the repo with the example files you need [git-lfs](https://git-lfs.com/) installed and activated with ´git lfs install´
|
||||
To install the packages on Fedora run
|
||||
```
|
||||
dnf install g++ git-lfs cmake gdal-devel
|
||||
```
|
||||
on Debian:
|
||||
```
|
||||
apt install g++ git-lfs cmake libgdal-dev
|
||||
```
|
||||
## How to build:
|
||||
```
|
||||
mkdir build
|
||||
@ -16,3 +27,8 @@ cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||
cmake --build . --parallel
|
||||
```
|
||||
Then you can run `./contour-creator PATH/TO/HEIGTHMAP.TIF`
|
||||
Run an example file: `./contour-creator "../example_files/Follo 2014-dtm.tif"`
|
||||
Currently the program outputs to ´out.shp´ in the current directory.
|
||||
|
||||
## Docs
|
||||
[Doxygen output](https://trygve.gitlab.io/contour-creator/)
|
@ -1,6 +1,10 @@
|
||||
# 29. Glossary:
|
||||
% INF205 Lab 5
|
||||
% Esther and Trygve
|
||||
% April 23 2024
|
||||
|
||||
# 29. Glossary contributions:
|
||||
## dynamic library
|
||||
Dynamic libraries are libraries are pre compiled and often provided by the operating system, as opposed to compiling it as part of your project. This saves space as each program dont need its own "copy".
|
||||
Dynamic libraries are libraries that are pre compiled and often provided by the operating system, as opposed to compiling them as part of your project. This saves space as each program dont need its own "copy".
|
||||
|
||||
## command-line arguments
|
||||
Command-line arguments are extra commands that we enter after the program's executable name so that the functionality of the program changes.
|
||||
@ -10,19 +14,37 @@ Command-line arguments are extra commands that we enter after the program's exec
|
||||
See slides.pdf
|
||||
|
||||
# 31. Basic functionality and validation per
|
||||
...
|
||||
|
||||
We ran a simple benchmark against gdal_contour as the reference implementation using `time` in the shell. My laptop has a 6 core AMD Ryzen 5 PRO 5675U running linux 6.8. The average of three tests was:
|
||||
```
|
||||
Ours: 33,53 s
|
||||
Reference: 4,46 s
|
||||
```
|
||||
This is despite the reference gdal implementation beinge single threaded and our being paritally paralell. We think we will gaing a significant speedup from optimizing the part of he program drawing the contours into a file. Right now its a placeholder that just creates points, not lines.
|
||||
This innital gap in performance leaves us a lot of room to improve and it will be interesting to see what the final performance will be.
|
||||
The plan is to create a more sophisticated benchmark program in c++, but for now we just use the time command
|
||||
|
||||
Memory usage is also very big because of our datastructure for CellMap. It is storing essentially a line in a 2d array, so most of the items are 0. We will try to fix this by making a cell type that stores its coordinates or by getting rid of the cellmap entirely.
|
||||
|
||||
The source code is available at [https://gitlab.com/Trygve/contour-creator](https://gitlab.com/Trygve/contour-creator) with instructions in the readme for building and running.
|
||||
If you want to view the .shp file you can use this simple webapp: [https://mapshaper.org/](https://mapshaper.org/)
|
||||
|
||||
# 32 Special interest functionality and responsibilities
|
||||
Per now we dont have time to add any extra functionality.
|
||||
It does not seem like we will have time to add any extra functionality.
|
||||
|
||||
# 33. Programming project: Progress on data structure implementation
|
||||
|
||||
...
|
||||
![ER diagram](ER_diagram.svg)
|
||||
|
||||
We need to create destructors to call free on data in HeightMap and cells in Cells as those are arrays allocated with malloc. The default copy behaviur is fine for our program.
|
||||
|
||||
\newpage
|
||||
|
||||
# 34. Parallelization
|
||||
The following code was used for parallelization using openMP. We haven't had time to test and we have only parallelized half of what is possible. But we can see that it is using all the cores.
|
||||
|
||||
````
|
||||
We are using openMP because we want multiple threads using the same data and the files are small enough to fit into memory (~500mb). To scale it to multiple machines we would use openmp to distrubute seperate iamge tiles to each node.
|
||||
We haven't had time to test the performance and we have only parallelized half of what is possible. But we can see that it is using all the cores.
|
||||
The following code was used for parallelization using openMP, each thread produces one "layer" of the cellmap:
|
||||
```cpp
|
||||
#pragma omp parallel
|
||||
{
|
||||
std::vector<CellMap> vec_private;
|
||||
@ -30,9 +52,8 @@ The following code was used for parallelization using openMP. We haven't had tim
|
||||
for (int i = 1; i <= num_contours; i++)
|
||||
{
|
||||
vec_private.push_back(produce_cellmap(heightmap, heightmap->min + interval*i));
|
||||
std::cout << "Execute thread " << omp_get_num_threads() << " ";
|
||||
}
|
||||
#pragma omp critical
|
||||
vector_contours.insert(vector_contours.end(), vec_private.begin(), vec_private.end());
|
||||
}
|
||||
````
|
||||
```
|
20
documentation/slides.md
Normal file
20
documentation/slides.md
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
title:
|
||||
- "INF205: creating contours using the marching squares algorithm"
|
||||
author:
|
||||
- Trygve og Esther
|
||||
|
||||
---
|
||||
# What are contours
|
||||
|
||||
# Output of our program
|
||||
pretty pictures
|
||||
|
||||
# The logical flow of our program
|
||||
flowchart
|
||||
|
||||
# GDAL
|
||||
What is it?
|
||||
|
||||
# Performance
|
||||
show the benchmarks
|
@ -42,7 +42,6 @@ std::vector<CellMap> vector_cellmap(HeightMap* heightmap, int interval)
|
||||
for (int i = 1; i <= num_contours; i++)
|
||||
{
|
||||
vec_private.push_back(produce_cellmap(heightmap, heightmap->min + interval*i));
|
||||
std::cout << "Execute thread " << omp_get_num_threads() << " ";
|
||||
}
|
||||
#pragma omp critical
|
||||
vector_contours.insert(vector_contours.end(), vec_private.begin(), vec_private.end());
|
||||
|
Loading…
Reference in New Issue
Block a user