OpenMP Support function

  • A partial list of the OpenMP library functions:

      Function Name Meaning
      void omp_set_num_threads(int nthread)
       
      Set the size of the thread team
      Note:   used outside parallel region
      int omp_get_num_threads(void)
       
       
      Returns the number of threads currently in the thread team
      Note:   used inside parallel region
      int omp_get_max_threads(void)
       
       
      Returns the maximum number of threads in a thread team (typically equal to # processors)
      int omp_get_num_procs(void) Returns the number of processors (CPUs)
      int omp_get_thread_num(void) Returns the thread ID of this thread
      "boolean" omp_in_parallel(void)
       
      Returns TRUE if the section of code is executing is parallel
      void omp_init_lock(omp_lock_t *lock)
       
      Initializes the lock variable lock (initially: unlocked)
      void omp_set_lock(omp_lock_t *lock) Locks the lock variable lock
      void omp_unset_lock(omp_lock_t *lock) Unlocks the lock variable lock
      int omp_test_lock(omp_lock_t *lock)
       
       
       
      Attempts to the lock variable lock, but does not block if the lock is unavailable.
      Returns true if successful (locked!)
      Returns false if unsuccessful