Openmp Runtime
Openmp Runtime
Format:
#include <omp.h>
double omp_get_wtime (void)
Format:
#include <omp.h>
int omp_get_num_threads(void)
Format:
#include <omp.h>
int omp_get_thread_num (void)
• Without specifying tid as private this would result in incorrect execution – how?
• What if line 8 was inserted in line 5 instead?
omp_set_dynamic
Purpose:
• Enables or disables dynamic adjustment (by the run time system) of the number of threads available
for execution of parallel regions
•
Format:
#include <omp.h>
void omp_set_dynamic (int dynamic_threads)
Notes & Restrictions:
• If dynamic_threads evaluates to non-zero, then the mechanism is enabled, otherwise it is disabled
• The omp_set_dynamic routine has precedence over the omp_dynamic environment variable
• The default setting is implementation dependent
• Must be called from a serial section of the program
omp_get_dynamic
Purpose:
• Used to determine if dynamic thread adjustment is enabled or disabled
Format:
#include <omp.h>
int omp_get_dynamic (void)
Notes & Restrictions:
• non-zero will be returned if dynamic thread adjustment is enabled, and zero otherwise