00001 #ifndef _OMP_H_DEF 00002 #define _OMP_H_DEF 00003 00004 /* 00005 From the specification 3.0, Chapter 3.1, page 108 00006 What to put into this file: 00007 * The prototypes of all the runtime library routines, with "C" linkage 00008 * The type omp_lock_t 00009 * The type omp_nest_lock_t 00010 * The type omp_sched_t 00011 00012 Specification 3.0 page 302 00013 D.1 Example of the omp.h Header File 00014 * */ 00015 00016 typedef void *omp_lock_t; /* represented as a pointer */ 00017 typedef void *omp_nest_lock_t; /* represented as a pointer */ 00018 00019 typedef enum omp_sched_t 00020 { 00021 omp_sched_static = 1, 00022 omp_sched_dynamic = 2, 00023 omp_sched_guided = 3, 00024 omp_sched_auto = 4 00025 } omp_sched_t; 00026 00027 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif 00031 00032 /* 00033 * Execution Environment Functions 00034 */ 00035 void omp_set_num_threads(int num); 00036 int omp_get_num_threads(void); 00037 int omp_get_max_threads(void); 00038 int omp_get_thread_num(void); 00039 int omp_get_num_procs(void); 00040 00041 int omp_in_parallel(void); 00042 void omp_set_dynamic(int dynamic_thds); 00043 int omp_get_dynamic(void); 00044 00045 void omp_set_nested(int n_nested); 00046 int omp_get_nested(void); 00047 00048 /* 00049 * Timer routine 00050 */ 00051 double omp_get_wtime(void); 00052 double omp_get_wtick(void); 00053 00054 /* 00055 * Lock Functions 00056 */ 00057 void omp_init_lock(omp_lock_t *lock); 00058 void omp_init_nest_lock(omp_nest_lock_t *lock); 00059 void omp_destroy_lock(omp_lock_t *lock); 00060 void omp_destroy_nest_lock(omp_nest_lock_t *lock); 00061 void omp_set_lock(omp_lock_t *lock); 00062 void omp_set_nest_lock(omp_nest_lock_t *lock); 00063 void omp_unset_lock(omp_lock_t *lock); 00064 void omp_unset_nest_lock(omp_nest_lock_t *lock); 00065 int omp_test_lock(omp_lock_t *lock); 00066 int omp_test_nest_lock(omp_nest_lock_t *lock); 00067 00068 /* 00069 * Other internal variables 00070 */ 00071 void omp_set_schedule (omp_sched_t, int); 00072 void omp_get_schedule (omp_sched_t *, int *); 00073 int omp_get_thread_limit (void); 00074 void omp_set_max_active_levels (int); 00075 int omp_get_max_active_levels (void); 00076 int omp_get_level (void); 00077 int omp_get_ancestor_thread_num (int); 00078 int omp_get_team_size (int); 00079 int omp_get_active_level (void); 00080 00081 /* 00082 * FORTRAN Execution Environment Function Wrappers 00083 * Fortran stuff should be handled in omp_lib.h 00084 void omp_set_num_threads_(int *num); 00085 int omp_get_num_threads_(void); 00086 int omp_get_max_threads_(void); 00087 int omp_get_thread_num_(void); 00088 int omp_get_num_procs_(void); 00089 int omp_in_parallel_(void); 00090 void omp_set_dynamic_(int *dynamic_thds); 00091 int omp_get_dynamic_(void); 00092 void omp_set_nested_(int *n_nested); 00093 int omp_get_nested_(void); 00094 00095 * FORTRAN Lock Function Wrappers 00096 typedef unsigned int _omf77Lock_t; 00097 void omp_init_lock_(_omf77Lock_t *lock); 00098 void omp_init_nest_lock_(_omf77Lock_t *lock); 00099 void omp_destroy_lock_(_omf77Lock_t *lock); 00100 void omp_destroy_nest_lock_(_omf77Lock_t *lock); 00101 void omp_set_lock_(_omf77Lock_t *lock); 00102 void omp_set_nest_lock_(_omf77Lock_t *lock); 00103 void omp_unset_lock_(_omf77Lock_t *lock); 00104 void omp_unset_nest_lock_(_omf77Lock_t *lock); 00105 int omp_test_lock_(_omf77Lock_t *lock); 00106 int omp_test_nest_lock_(_omf77Lock_t *lock); 00107 00108 */ 00109 #ifdef __cplusplus 00110 } /* closing brace for extern "C" */ 00111 #endif 00112 00113 #endif /* _OMP_H_DEF */ 00114
1.4.7