I wanted to study about the basis on which OpenMP API allocates threads to the cores. What factors does it take under consideration while doing so? Can this allocation be modified according to the programmer's needs?
How does OpenMP do thread allocation?
661 Views Asked by Vaishali Aggarwal At
2
There are 2 best solutions below
0
pan8863
On
Yes, the number of threads can definitely be modified as per a programmer's judgment.
Refer to : OpenMp set number of threads for parallel loop depending on variable
By default, OpenMP allocates as many threads as the number of cores on the machine/node (in case of a distributed system) it is running on.
Related Questions in MULTITHREADING
- new thread blocks main thread
- WPF MessageBox Cancel checkbox check
- How to avoid concurrent access to a resource?
- run oncomplete event in async
- Threading Segfault when reading members
- Function timeouts in C and thread
- How are multiple requests to Task.Run handled from a resource management standpoint?
- Acumatica perfomance with threads
- Wait and Notify in Java threads for a given interval
- Different behavior of async with Visual Studio 2013(Windows8.1) and GCC 4.9(Ubuntu14.10)
- How to return blocking queue to the right object?
- background thread using Task.Run
- deletion and cleanup of worker thread in Qt crashes
- Pipeline-like operation using TChan
- implementing in app purchase on android
Related Questions in PARALLEL-PROCESSING
- Async vs Horizontal scaling
- Scattered indices in MPI
- How to perform parallel processes for different groups in a folder?
- Julia parallel programming - Making existing function available to all workers
- Running scala futures somewhat in parallel
- running a thread in parallel
- How to make DGEMM execute sequentially instead of in parallel in Matlab Mex Function
- Running time foreach package
- How to parallelize csh script with nested loop
- SSIS ETL parallel extraction from a AS400 file
- Fill an array with spmd in Matlab
- Distribute lines of code to workers
- Java 8 parallelStream for concurrent Database / REST call
- OutOfRangeException with Parallel.For
- R Nested Foreach Parallelization not Working
Related Questions in OPENMP
- Is it safe to list optional fortran function argument in OpenMP shared clause?
- omp barriers are blocking
- OpenMP SIMD on Power8
- MPI+OpenMP job submission script on LSF
- Does OMP Pragmas nesting have significance?
- How to make DGEMM execute sequentially instead of in parallel in Matlab Mex Function
- Increased speed despite false sharing
- Simple speed up of C++ OpenMP kernel
- Performance issue of OpenMP code called from a pthread
- What preprocessor define does -fopenmp provide?
- OpenMP shared variable seems to be private
- Error with openmp for Nested for-loop
- Convert do/while into parallel do/while loop
- How to measure the load balancing in OpenMP of GCC
- Parallel for loop with reduction and manipulating arrays
Related Questions in MULTICORE
- Is processor cache flushed during context switch in multicore?
- Does MATLAB support the parallelization of supervised machine learning algorithms? Alternatives?
- Memory barriers force cache coherency?
- Shared memory and concurrency on multi-core processors?
- How to do multi core programming in F#
- Meaning of cores and logical processors in intel icore
- Fill array with multiple threads in C
- Can any computer (multi or single core) run many threads at the same time
- Do user created processes in C run parallel by linux on multi core systems?
- How does OpenMP do thread allocation?
- Using multiple core on Zynq
- Multi-thread program(process) on multicore-core processor(s) with hyperthreading
- System.Threading.ThreadPool excluding a core?
- Extracting data from a raster brick using multiple threads
- OpenMP loop gives different result to the same serial loop
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I believe that you're looking for the affinity between open-mouthed threads and hardware threads/cores. The answer is yes, btw.
If you use Intel compilers you can take a look at this site for KMP_AAFFINITY environment variable. https://software.intel.com/en-us/node/522691
If you use GNU compilers you might be interested in these official OpenMP environment variables. https://gcc.gnu.org/onlinedocs/libgomp/OMP_005fPLACES.html https://gcc.gnu.org/onlinedocs/libgomp/OMP_005fPROC_005fBIND.html