00001 /* 00002 00003 OpenMP runtime library to be used in conjunction with Open64 Compiler Suites. 00004 00005 Copyright (C) 2003 - 2009 Tsinghua University. 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2.1 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 00021 Contact information: HPC Institute, Department of Computer Science and Technology, 00022 Tsinghua University, Beijing 100084, CHINA, or: 00023 00024 http://hpc.cs.tsinghua.edu.cn 00025 00026 */ 00027 00028 /* 00029 * File: omp.h 00030 * Abstract: the Application Programming Interface of OpenMP 00031 * History: 04/23/2003, built by Jiang Hongshan, Tsinghua Univ. 00032 * 06/09/2005, updated by Liao Chunhua, Univ. of Houston 00033 * 00034 */ 00035 00036 #ifndef _OMP_H 00037 #define _OMP_H 00038 00039 #include <pthread.h> 00040 00041 typedef int omp_int_t; 00042 typedef double omp_wtime_t; 00043 00044 typedef void *omp_lock_t; 00045 typedef void *omp_nest_lock_t; 00046 00047 #ifdef __cplusplus 00048 extern "C"{ 00049 #endif 00050 00051 /* 00052 * Excution Environment Functions 00053 */ 00054 extern void omp_set_num_threads(omp_int_t num); 00055 extern omp_int_t omp_get_num_threads(void); 00056 extern omp_int_t omp_get_max_threads(void); 00057 extern omp_int_t omp_get_thread_num(void); 00058 extern omp_int_t omp_get_num_procs(void); 00059 00060 extern omp_int_t omp_in_parallel(void); 00061 00062 extern void omp_set_dynamic(omp_int_t dynamic); 00063 extern omp_int_t omp_get_dynamic(void); 00064 00065 extern void omp_set_nested(omp_int_t nested); 00066 extern omp_int_t omp_get_nested(void); 00067 00068 /* 00069 * Lock Functions 00070 */ 00071 extern void omp_init_lock(volatile omp_lock_t *lock); 00072 extern void omp_init_nest_lock(volatile omp_nest_lock_t *lock); 00073 00074 extern void omp_destroy_lock(volatile omp_lock_t *lock); 00075 extern void omp_destroy_nest_lock(volatile omp_nest_lock_t *lock); 00076 00077 extern void omp_set_lock(volatile omp_lock_t *lock); 00078 extern void omp_set_nest_lock(volatile omp_nest_lock_t *lock); 00079 00080 extern void omp_unset_lock(volatile omp_lock_t *lock); 00081 extern void omp_unset_nest_lock(volatile omp_nest_lock_t *lock); 00082 00083 extern int omp_test_lock(volatile omp_lock_t *lock); 00084 extern int omp_test_nest_lock(volatile omp_nest_lock_t *lock); 00085 00086 extern omp_wtime_t omp_get_wtick(void); 00087 extern omp_wtime_t omp_get_wtime(void); 00088 00089 #ifdef __cplusplus 00090 } 00091 #endif 00092 00093 #endif /* _OMP_H */
1.5.6