mirror of
https://gitlab.com/Trygve/contour-creator.git
synced 2024-11-21 14:50:18 +00:00
Wrote on lab 5 about parallelization and definitions.
This commit is contained in:
parent
0319f2ae29
commit
781b96215a
@ -2,6 +2,10 @@
|
||||
## 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".
|
||||
|
||||
## 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.
|
||||
|
||||
|
||||
# 30. Draft slides:
|
||||
See slides.pdf
|
||||
|
||||
@ -11,8 +15,24 @@ See slides.pdf
|
||||
# 32 Special interest functionality and responsibilities
|
||||
Per now we dont have time to add any extra functionality.
|
||||
|
||||
33. Programming project: Progress on data structure implementation
|
||||
# 33. Programming project: Progress on data structure implementation
|
||||
|
||||
...
|
||||
|
||||
34. Parallelization
|
||||
# 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.
|
||||
|
||||
````
|
||||
#pragma omp parallel
|
||||
{
|
||||
std::vector<CellMap> vec_private;
|
||||
#pragma omp for
|
||||
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