OpenMP: An excellent API to implement parallel programs based on multithreadingParallel programming is one of the most important branches of Computer Science that can be used to improve the efficiency and performance of the multi-core processing machines by the concurrent execution of the instructions provided by parallel program. In parallel programming, large complex problems are decomposed into the smaller parts, and then these parts are executed concurrently. Thereafter, the results obtained from all parts are combined to get the final result. Various APIs have been introduced which are capable of designing efficient parallel programs. OpenMP is one of such API that can be used to design parallel programs based on HPC (high performance computing). OpenMP is an open-source API that used multithreading concepts to perform parallel programming. OpenMP API support number of programming languages, such as C, C++ and FORTRAN on diversified parallel architectures. In order to make programs parallel, OpenMP can be inserted into it in the form of compiler directives. After using OpenMP the programs becomes scalable and adapts themselves easily to be executed on multi-core environment. There are various methods of parallel programming like Shared Memory Model, Thread Based Parallelism, Explicit Parallelism, Fork-Join Model etc. OpenMP programming is based on the fork-join concept of the parallel programming.
Fork-Join Model of OpenMP Fork-Join Model (Source - http://www.ocgy.ubc.ca/~yzq/books/OpenMP.html)
The part of the parallel program which is meant to be executed in parallel is marked using compiler directives which instructs the system to generate the threads before executing the parallel region. Each thread is identified using thread_ID which can be accessed by a function omp_get_thread_num() of OpenMP API. The integer is used to depict the thread_ID of the threads. The thread_ID of the master thread is 0. After finishing with the parallel region all threads join back into master thread which continues the execution of the program till the end. Conclusion By - Dr Sapna Saxena, Associate Professor, CSE, Chitkara University H.P.
About Technology Connect
Aim of this weekly newsletter is to share with students & faculty the latest developments, technologies, updates in the field Electronics & Computer Science and there by promoting knowledge sharing. All our readers are welcome to contribute content to Technology Connect. Just drop an email to the editor. The first Volume of Technology Connect featured 21 Issues published between June 2015 and December 2015. This is Volume 2. Happy Reading!
Disclaimer:The content of this newsletter is contributed by Chitkara University faculty & taken from resources that are believed to be reliable.The content is verified by editorial team to best of its accuracy but editorial team denies any ownership pertaining to validation of the source & accuracy of the content. The objective of the newsletter is only limited to spread awareness among faculty & students about technology and not to impose or influence decision of individuals.
|