omp_lib.f90

Go to the documentation of this file.
00001 ! include/40/omp_lib.f90.var
00002 ! $Revision: 41674 $
00003 ! $Date: 2012-06-05 08:33:35 -0500 (Tue, 05 Jun 2012) $
00004 
00005 ! <copyright>
00006 !    Copyright (c) 1985-2013 Intel Corporation.  All Rights Reserved.
00007 !
00008 !    Redistribution and use in source and binary forms, with or without
00009 !    modification, are permitted provided that the following conditions
00010 !    are met:
00011 !
00012 !      * Redistributions of source code must retain the above copyright
00013 !        notice, this list of conditions and the following disclaimer.
00014 !      * Redistributions in binary form must reproduce the above copyright
00015 !        notice, this list of conditions and the following disclaimer in the
00016 !        documentation and/or other materials provided with the distribution.
00017 !      * Neither the name of Intel Corporation nor the names of its
00018 !        contributors may be used to endorse or promote products derived
00019 !        from this software without specific prior written permission.
00020 !
00021 !    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022 !    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023 !    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00024 !    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00025 !    HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00026 !    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00027 !    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00028 !    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00029 !    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00030 !    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00031 !    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032 !
00033 !
00034 !------------------------------------------------------------------------
00035 !
00036 !    Portions of this software are protected under the following patents:
00037 !        U.S. Patent 5,812,852
00038 !        U.S. Patent 6,792,599
00039 !        U.S. Patent 7,069,556
00040 !        U.S. Patent 7,328,433
00041 !        U.S. Patent 7,500,242
00042 !
00043 ! </copyright>
00044 
00045       module omp_lib_kinds
00046 
00047         use, intrinsic :: iso_c_binding
00048 
00049         integer, parameter :: omp_integer_kind       = c_int
00050         integer, parameter :: omp_logical_kind       = 4
00051         integer, parameter :: omp_real_kind          = c_float
00052         integer, parameter :: kmp_double_kind        = c_double
00053         integer, parameter :: omp_lock_kind          = c_intptr_t
00054         integer, parameter :: omp_nest_lock_kind     = c_intptr_t
00055         integer, parameter :: omp_sched_kind         = omp_integer_kind
00056         integer, parameter :: omp_proc_bind_kind     = omp_integer_kind
00057         integer, parameter :: kmp_pointer_kind       = c_intptr_t
00058         integer, parameter :: kmp_size_t_kind        = c_size_t
00059         integer, parameter :: kmp_affinity_mask_kind = c_intptr_t
00060 
00061       end module omp_lib_kinds
00062 
00063       module omp_lib
00064 
00065         use omp_lib_kinds
00066 
00067         integer (kind=omp_integer_kind), parameter :: openmp_version    = 201107
00068         integer (kind=omp_integer_kind), parameter :: kmp_version_major = 5
00069         integer (kind=omp_integer_kind), parameter :: kmp_version_minor = 0
00070         integer (kind=omp_integer_kind), parameter :: kmp_version_build = 00000000
00071         character(*)               kmp_build_date
00072         parameter( kmp_build_date = '2013-08-22 22:37:00 UTC' )
00073 
00074         integer(kind=omp_sched_kind), parameter :: omp_sched_static  = 1
00075         integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
00076         integer(kind=omp_sched_kind), parameter :: omp_sched_guided  = 3
00077         integer(kind=omp_sched_kind), parameter :: omp_sched_auto    = 4
00078 
00079         integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
00080         integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
00081         integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
00082         integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
00083         integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
00084 
00085         interface
00086 
00087 !         ***
00088 !         *** omp_* entry points
00089 !         ***
00090 
00091           subroutine omp_set_num_threads(nthreads) bind(c)
00092             use omp_lib_kinds
00093             integer (kind=omp_integer_kind), value :: nthreads
00094           end subroutine omp_set_num_threads
00095 
00096           subroutine omp_set_dynamic(enable) bind(c)
00097             use omp_lib_kinds
00098             logical (kind=omp_logical_kind), value :: enable
00099           end subroutine omp_set_dynamic
00100 
00101           subroutine omp_set_nested(enable) bind(c)
00102             use omp_lib_kinds
00103             logical (kind=omp_logical_kind), value :: enable
00104           end subroutine omp_set_nested
00105 
00106           function omp_get_num_threads() bind(c)
00107             use omp_lib_kinds
00108             integer (kind=omp_integer_kind) omp_get_num_threads
00109           end function omp_get_num_threads
00110 
00111           function omp_get_max_threads() bind(c)
00112             use omp_lib_kinds
00113             integer (kind=omp_integer_kind) omp_get_max_threads
00114           end function omp_get_max_threads
00115 
00116           function omp_get_thread_num() bind(c)
00117             use omp_lib_kinds
00118             integer (kind=omp_integer_kind) omp_get_thread_num
00119           end function omp_get_thread_num
00120 
00121           function omp_get_num_procs() bind(c)
00122             use omp_lib_kinds
00123             integer (kind=omp_integer_kind) omp_get_num_procs
00124           end function omp_get_num_procs
00125 
00126           function omp_in_parallel() bind(c)
00127             use omp_lib_kinds
00128             logical (kind=omp_logical_kind) omp_in_parallel
00129           end function omp_in_parallel
00130 
00131           function omp_get_dynamic() bind(c)
00132             use omp_lib_kinds
00133             logical (kind=omp_logical_kind) omp_get_dynamic
00134           end function omp_get_dynamic
00135 
00136           function omp_get_nested() bind(c)
00137             use omp_lib_kinds
00138             logical (kind=omp_logical_kind) omp_get_nested
00139           end function omp_get_nested
00140 
00141           function omp_get_thread_limit() bind(c)
00142             use omp_lib_kinds
00143             integer (kind=omp_integer_kind) omp_get_thread_limit
00144           end function omp_get_thread_limit
00145 
00146           subroutine omp_set_max_active_levels(max_levels) bind(c)
00147             use omp_lib_kinds
00148             integer (kind=omp_integer_kind), value :: max_levels
00149           end subroutine omp_set_max_active_levels
00150 
00151           function omp_get_max_active_levels() bind(c)
00152             use omp_lib_kinds
00153             integer (kind=omp_integer_kind) omp_get_max_active_levels
00154           end function omp_get_max_active_levels
00155 
00156           function omp_get_level() bind(c)
00157             use omp_lib_kinds
00158             integer (kind=omp_integer_kind) :: omp_get_level
00159           end function omp_get_level
00160 
00161           function omp_get_active_level() bind(c)
00162             use omp_lib_kinds
00163             integer (kind=omp_integer_kind) :: omp_get_active_level
00164           end function omp_get_active_level
00165 
00166           function omp_get_ancestor_thread_num(level) bind(c)
00167             use omp_lib_kinds
00168             integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
00169             integer (kind=omp_integer_kind), value :: level
00170           end function omp_get_ancestor_thread_num
00171 
00172           function omp_get_team_size(level) bind(c)
00173             use omp_lib_kinds
00174             integer (kind=omp_integer_kind) omp_get_team_size
00175             integer (kind=omp_integer_kind), value :: level
00176           end function omp_get_team_size
00177 
00178           subroutine omp_set_schedule(kind, modifier) bind(c)
00179             use omp_lib_kinds
00180             integer (kind=omp_sched_kind), value :: kind
00181             integer (kind=omp_integer_kind), value :: modifier
00182           end subroutine omp_set_schedule
00183 
00184           subroutine omp_get_schedule(kind, modifier) bind(c)
00185             use omp_lib_kinds
00186             integer (kind=omp_sched_kind)   :: kind
00187             integer (kind=omp_integer_kind) :: modifier
00188           end subroutine omp_get_schedule
00189 
00190           function omp_get_proc_bind()
00191             use omp_lib_kinds
00192             integer (kind=omp_proc_bind_kind) omp_get_proc_bind
00193           end function omp_get_proc_bind
00194 
00195           function omp_get_wtime() bind(c)
00196             use omp_lib_kinds
00197             real (kind=kmp_double_kind) omp_get_wtime
00198           end function omp_get_wtime
00199 
00200           function omp_get_wtick() bind(c)
00201             use omp_lib_kinds
00202             real (kind=kmp_double_kind) omp_get_wtick
00203           end function omp_get_wtick
00204 
00205           subroutine omp_init_lock(lockvar) bind(c)
00206             use omp_lib_kinds
00207             integer (kind=omp_lock_kind) lockvar
00208           end subroutine omp_init_lock
00209 
00210           subroutine omp_destroy_lock(lockvar) bind(c)
00211             use omp_lib_kinds
00212             integer (kind=omp_lock_kind) lockvar
00213           end subroutine omp_destroy_lock
00214 
00215           subroutine omp_set_lock(lockvar) bind(c)
00216             use omp_lib_kinds
00217             integer (kind=omp_lock_kind) lockvar
00218           end subroutine omp_set_lock
00219 
00220           subroutine omp_unset_lock(lockvar) bind(c)
00221             use omp_lib_kinds
00222             integer (kind=omp_lock_kind) lockvar
00223           end subroutine omp_unset_lock
00224 
00225           function omp_test_lock(lockvar) bind(c)
00226             use omp_lib_kinds
00227             logical (kind=omp_logical_kind) omp_test_lock
00228             integer (kind=omp_lock_kind) lockvar
00229           end function omp_test_lock
00230 
00231           subroutine omp_init_nest_lock(lockvar) bind(c)
00232             use omp_lib_kinds
00233             integer (kind=omp_nest_lock_kind) lockvar
00234           end subroutine omp_init_nest_lock
00235 
00236           subroutine omp_destroy_nest_lock(lockvar) bind(c)
00237             use omp_lib_kinds
00238             integer (kind=omp_nest_lock_kind) lockvar
00239           end subroutine omp_destroy_nest_lock
00240 
00241           subroutine omp_set_nest_lock(lockvar) bind(c)
00242             use omp_lib_kinds
00243             integer (kind=omp_nest_lock_kind) lockvar
00244           end subroutine omp_set_nest_lock
00245 
00246           subroutine omp_unset_nest_lock(lockvar) bind(c)
00247             use omp_lib_kinds
00248             integer (kind=omp_nest_lock_kind) lockvar
00249           end subroutine omp_unset_nest_lock
00250 
00251           function omp_test_nest_lock(lockvar) bind(c)
00252             use omp_lib_kinds
00253             integer (kind=omp_integer_kind) omp_test_nest_lock
00254             integer (kind=omp_nest_lock_kind) lockvar
00255           end function omp_test_nest_lock
00256 
00257 !         ***
00258 !         *** kmp_* entry points
00259 !         ***
00260 
00261           subroutine kmp_set_stacksize(size) bind(c)
00262             use omp_lib_kinds
00263             integer (kind=omp_integer_kind), value :: size
00264           end subroutine kmp_set_stacksize
00265 
00266           subroutine kmp_set_stacksize_s(size) bind(c)
00267             use omp_lib_kinds
00268             integer (kind=kmp_size_t_kind), value :: size
00269           end subroutine kmp_set_stacksize_s
00270 
00271           subroutine kmp_set_blocktime(msec) bind(c)
00272             use omp_lib_kinds
00273             integer (kind=omp_integer_kind), value :: msec
00274           end subroutine kmp_set_blocktime
00275 
00276           subroutine kmp_set_library_serial() bind(c)
00277           end subroutine kmp_set_library_serial
00278 
00279           subroutine kmp_set_library_turnaround() bind(c)
00280           end subroutine kmp_set_library_turnaround
00281 
00282           subroutine kmp_set_library_throughput() bind(c)
00283           end subroutine kmp_set_library_throughput
00284 
00285           subroutine kmp_set_library(libnum) bind(c)
00286             use omp_lib_kinds
00287             integer (kind=omp_integer_kind), value :: libnum
00288           end subroutine kmp_set_library
00289 
00290           subroutine kmp_set_defaults(string) bind(c)
00291             use, intrinsic :: iso_c_binding
00292             character (kind=c_char) :: string(*)
00293           end subroutine kmp_set_defaults
00294 
00295           function kmp_get_stacksize() bind(c)
00296             use omp_lib_kinds
00297             integer (kind=omp_integer_kind) kmp_get_stacksize
00298           end function kmp_get_stacksize
00299 
00300           function kmp_get_stacksize_s() bind(c)
00301             use omp_lib_kinds
00302             integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
00303           end function kmp_get_stacksize_s
00304 
00305           function kmp_get_blocktime() bind(c)
00306             use omp_lib_kinds
00307             integer (kind=omp_integer_kind) kmp_get_blocktime
00308           end function kmp_get_blocktime
00309 
00310           function kmp_get_library() bind(c)
00311             use omp_lib_kinds
00312             integer (kind=omp_integer_kind) kmp_get_library
00313           end function kmp_get_library
00314 
00315           function kmp_set_affinity(mask) bind(c)
00316             use omp_lib_kinds
00317             integer (kind=omp_integer_kind) kmp_set_affinity
00318             integer (kind=kmp_affinity_mask_kind) mask
00319           end function kmp_set_affinity
00320 
00321           function kmp_get_affinity(mask) bind(c)
00322             use omp_lib_kinds
00323             integer (kind=omp_integer_kind) kmp_get_affinity
00324             integer (kind=kmp_affinity_mask_kind) mask
00325           end function kmp_get_affinity
00326 
00327           function kmp_get_affinity_max_proc() bind(c)
00328             use omp_lib_kinds
00329             integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
00330           end function kmp_get_affinity_max_proc
00331 
00332           subroutine kmp_create_affinity_mask(mask) bind(c)
00333             use omp_lib_kinds
00334             integer (kind=kmp_affinity_mask_kind) mask
00335           end subroutine kmp_create_affinity_mask
00336 
00337           subroutine kmp_destroy_affinity_mask(mask) bind(c)
00338             use omp_lib_kinds
00339             integer (kind=kmp_affinity_mask_kind) mask
00340           end subroutine kmp_destroy_affinity_mask
00341 
00342           function kmp_set_affinity_mask_proc(proc, mask) bind(c)
00343             use omp_lib_kinds
00344             integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
00345             integer (kind=omp_integer_kind), value :: proc
00346             integer (kind=kmp_affinity_mask_kind) mask
00347           end function kmp_set_affinity_mask_proc
00348 
00349           function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
00350             use omp_lib_kinds
00351             integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
00352             integer (kind=omp_integer_kind), value :: proc
00353             integer (kind=kmp_affinity_mask_kind) mask
00354           end function kmp_unset_affinity_mask_proc
00355 
00356           function kmp_get_affinity_mask_proc(proc, mask) bind(c)
00357             use omp_lib_kinds
00358             integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
00359             integer (kind=omp_integer_kind), value :: proc
00360             integer (kind=kmp_affinity_mask_kind) mask
00361           end function kmp_get_affinity_mask_proc
00362 
00363           function kmp_malloc(size) bind(c)
00364             use omp_lib_kinds
00365             integer (kind=kmp_pointer_kind) kmp_malloc
00366             integer (kind=kmp_size_t_kind), value :: size
00367           end function kmp_malloc
00368 
00369           function kmp_calloc(nelem, elsize) bind(c)
00370             use omp_lib_kinds
00371             integer (kind=kmp_pointer_kind) kmp_calloc
00372             integer (kind=kmp_size_t_kind), value :: nelem
00373             integer (kind=kmp_size_t_kind), value :: elsize
00374           end function kmp_calloc
00375 
00376           function kmp_realloc(ptr, size) bind(c)
00377             use omp_lib_kinds
00378             integer (kind=kmp_pointer_kind) kmp_realloc
00379             integer (kind=kmp_pointer_kind), value :: ptr
00380             integer (kind=kmp_size_t_kind), value :: size
00381           end function kmp_realloc
00382 
00383           subroutine kmp_free(ptr) bind(c)
00384             use omp_lib_kinds
00385             integer (kind=kmp_pointer_kind), value :: ptr
00386           end subroutine kmp_free
00387 
00388           subroutine kmp_set_warnings_on() bind(c)
00389           end subroutine kmp_set_warnings_on
00390 
00391           subroutine kmp_set_warnings_off() bind(c)
00392           end subroutine kmp_set_warnings_off
00393 
00394         end interface
00395 
00396       end module omp_lib

Generated on 25 Aug 2013 for libomp_oss by  doxygen 1.6.1