- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is it possible to set the threads dynamically depending on system configuration in openMP.
here system configuration means dual core(or)quad core.
here system configuration means dual core(or)quad core.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
normally, the OpenMP runtime automatically chooses the thread count such that all cores on your system receive one thread and the system is not overloaded. However, this does not take into account if cores are utilizied by other applications. Please note that OpenMP does not differentiate physical cores and logical cores available with Hyper Threading.
If you want to set the number of threads manually you've got these options:
Cheers,
-michael
normally, the OpenMP runtime automatically chooses the thread count such that all cores on your system receive one thread and the system is not overloaded. However, this does not take into account if cores are utilizied by other applications. Please note that OpenMP does not differentiate physical cores and logical cores available with Hyper Threading.
If you want to set the number of threads manually you've got these options:
- set the environment variable OMP_NUM_THREADS to the number of threads. For example "export OMP_NUM_THREADS=16" in a Linux bash shell will set the number of thread to 16 for all OpenMP application launched through that bash shell.
- Use the OpenMP runtime call omp_set_num_threads(n) to set the number of threads from within the application. You can use omp_get_num_procs() to determine the number of cores in your system.
- Add a the num_threads clause to your parallel regions to explicitly specify the thread count for each parallel region individually.
Cheers,
-michael
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page