Difference between revisions of "GPU621/CamelCaseTeam"
(→C++ Threading - explanation of C++ thread library) |
(→OpenMP Threading - inputting explanation on openmp threading) |
||
Line 25: | Line 25: | ||
== OpenMP Threading == | == OpenMP Threading == | ||
+ | |||
+ | OpenMP threads consists of a parallel region that forks a master thread into multiple child threads that each performs a function in parallel amongst each other and joins back to its parent thread after reaching the end of the parallel region. |
Revision as of 02:09, 22 July 2021
GPU621/DPS921 | Participants | Groups and Projects | Resources | Glossary
Project Name
C++11 Threads Library Comparison to OpenMP
Group Members
Andrei Fedchenko Hung Truong Ren Ren
Overview
Our team will do a research on comparison between c++ 11 threads library and openmp. We will code problems with both libraries to demonstrate the coding differences and do the performance analysis on those two approaches. We will highlight the techniques and best practices to achieve the best performance and avoid the pitfalls.
C++ Threading
C++ threading consists of the creation of a thread that works on a function. By having multiple threads, multiple functions are able to be performed at the same time which enables parallel processing.
template<class Function, class... args>
explicit thread( Function&& f, Args&&... args);
As seen above, a single thread takes a function through overloading and performs the task by passing the arguments to the function parameter which would execute separate to other threads. Once these threads are finished performing their function, the child thread must be joined using the .join() function in the thread library to the parent thread.
OpenMP Threading
OpenMP threads consists of a parallel region that forks a master thread into multiple child threads that each performs a function in parallel amongst each other and joins back to its parent thread after reaching the end of the parallel region.