Home | History | Annotate | Line # | Download | only in libgomp
libgomp.info revision 1.6
      1 This is libgomp.info, produced by makeinfo version 6.1 from
      2 libgomp.texi.
      3 
      4 Copyright (C) 2006-2015 Free Software Foundation, Inc.
      5 
      6    Permission is granted to copy, distribute and/or modify this document
      7 under the terms of the GNU Free Documentation License, Version 1.3 or
      8 any later version published by the Free Software Foundation; with the
      9 Invariant Sections being "Funding Free Software", the Front-Cover texts
     10 being (a) (see below), and with the Back-Cover Texts being (b) (see
     11 below).  A copy of the license is included in the section entitled "GNU
     12 Free Documentation License".
     13 
     14    (a) The FSF's Front-Cover Text is:
     15 
     16    A GNU Manual
     17 
     18    (b) The FSF's Back-Cover Text is:
     19 
     20    You have freedom to copy and modify this GNU Manual, like GNU
     21 software.  Copies published by the Free Software Foundation raise funds
     22 for GNU development.
     23 INFO-DIR-SECTION GNU Libraries
     24 START-INFO-DIR-ENTRY
     25 * libgomp: (libgomp).          GNU Offloading and Multi Processing Runtime Library.
     26 END-INFO-DIR-ENTRY
     27 
     28    This manual documents libgomp, the GNU Offloading and Multi
     29 Processing Runtime library.  This is the GNU implementation of the
     30 OpenMP and OpenACC APIs for parallel and accelerator programming in
     31 C/C++ and Fortran.
     32 
     33    Published by the Free Software Foundation 51 Franklin Street, Fifth
     34 Floor Boston, MA 02110-1301 USA
     35 
     36    Copyright (C) 2006-2015 Free Software Foundation, Inc.
     37 
     38    Permission is granted to copy, distribute and/or modify this document
     39 under the terms of the GNU Free Documentation License, Version 1.3 or
     40 any later version published by the Free Software Foundation; with the
     41 Invariant Sections being "Funding Free Software", the Front-Cover texts
     42 being (a) (see below), and with the Back-Cover Texts being (b) (see
     43 below).  A copy of the license is included in the section entitled "GNU
     44 Free Documentation License".
     45 
     46    (a) The FSF's Front-Cover Text is:
     47 
     48    A GNU Manual
     49 
     50    (b) The FSF's Back-Cover Text is:
     51 
     52    You have freedom to copy and modify this GNU Manual, like GNU
     53 software.  Copies published by the Free Software Foundation raise funds
     54 for GNU development.
     55 
     56 
     57 File: libgomp.info,  Node: Top,  Next: Enabling OpenMP,  Up: (dir)
     58 
     59 Introduction
     60 ************
     61 
     62 This manual documents the usage of libgomp, the GNU Offloading and Multi
     63 Processing Runtime Library.  This includes the GNU implementation of the
     64 OpenMP (http://www.openmp.org) Application Programming Interface (API)
     65 for multi-platform shared-memory parallel programming in C/C++ and
     66 Fortran, and the GNU implementation of the OpenACC
     67 (http://www.openacc.org/) Application Programming Interface (API) for
     68 offloading of code to accelerator devices in C/C++ and Fortran.
     69 
     70    Originally, libgomp implemented the GNU OpenMP Runtime Library.
     71 Based on this, support for OpenACC and offloading (both OpenACC and
     72 OpenMP 4's target construct) has been added later on, and the library's
     73 name changed to GNU Offloading and Multi Processing Runtime Library.
     74 
     75 * Menu:
     76 
     77 * Enabling OpenMP::            How to enable OpenMP for your applications.
     78 * Runtime Library Routines::   The OpenMP runtime application programming
     79                                interface.
     80 * Environment Variables::      Influencing runtime behavior with environment
     81                                variables.
     82 * The libgomp ABI::            Notes on the external ABI presented by libgomp.
     83 * Reporting Bugs::             How to report bugs in the GNU Offloading and
     84                                Multi Processing Runtime Library.
     85 * Copying::                    GNU general public license says
     86                                how you can copy and share libgomp.
     87 * GNU Free Documentation License::
     88                                How you can copy and share this manual.
     89 * Funding::                    How to help assure continued work for free
     90                                software.
     91 * Library Index::              Index of this documentation.
     92 
     93 
     94 File: libgomp.info,  Node: Enabling OpenMP,  Next: Runtime Library Routines,  Prev: Top,  Up: Top
     95 
     96 1 Enabling OpenMP
     97 *****************
     98 
     99 To activate the OpenMP extensions for C/C++ and Fortran, the
    100 compile-time flag '-fopenmp' must be specified.  This enables the OpenMP
    101 directive '#pragma omp' in C/C++ and '!$omp' directives in free form,
    102 'c$omp', '*$omp' and '!$omp' directives in fixed form, '!$' conditional
    103 compilation sentinels in free form and 'c$', '*$' and '!$' sentinels in
    104 fixed form, for Fortran.  The flag also arranges for automatic linking
    105 of the OpenMP runtime library (*note Runtime Library Routines::).
    106 
    107    A complete description of all OpenMP directives accepted may be found
    108 in the OpenMP Application Program Interface (http://www.openmp.org)
    109 manual, version 4.0.
    110 
    111 
    112 File: libgomp.info,  Node: Runtime Library Routines,  Next: Environment Variables,  Prev: Enabling OpenMP,  Up: Top
    113 
    114 2 Runtime Library Routines
    115 **************************
    116 
    117 The runtime routines described here are defined by Section 3 of the
    118 OpenMP specification in version 4.0.  The routines are structured in
    119 following three parts:
    120 
    121 * Menu:
    122 
    123 Control threads, processors and the parallel environment.  They have C
    124 linkage, and do not throw exceptions.
    125 
    126 * omp_get_active_level::        Number of active parallel regions
    127 * omp_get_ancestor_thread_num:: Ancestor thread ID
    128 * omp_get_cancellation::        Whether cancellation support is enabled
    129 * omp_get_default_device::      Get the default device for target regions
    130 * omp_get_dynamic::             Dynamic teams setting
    131 * omp_get_level::               Number of parallel regions
    132 * omp_get_max_active_levels::   Maximum number of active regions
    133 * omp_get_max_threads::         Maximum number of threads of parallel region
    134 * omp_get_nested::              Nested parallel regions
    135 * omp_get_num_devices::         Number of target devices
    136 * omp_get_num_procs::           Number of processors online
    137 * omp_get_num_teams::           Number of teams
    138 * omp_get_num_threads::         Size of the active team
    139 * omp_get_proc_bind::           Whether theads may be moved between CPUs
    140 * omp_get_schedule::            Obtain the runtime scheduling method
    141 * omp_get_team_num::            Get team number
    142 * omp_get_team_size::           Number of threads in a team
    143 * omp_get_thread_limit::        Maximum number of threads
    144 * omp_get_thread_num::          Current thread ID
    145 * omp_in_parallel::             Whether a parallel region is active
    146 * omp_in_final::                Whether in final or included task region
    147 * omp_is_initial_device::       Whether executing on the host device
    148 * omp_set_default_device::      Set the default device for target regions
    149 * omp_set_dynamic::             Enable/disable dynamic teams
    150 * omp_set_max_active_levels::   Limits the number of active parallel regions
    151 * omp_set_nested::              Enable/disable nested parallel regions
    152 * omp_set_num_threads::         Set upper team size limit
    153 * omp_set_schedule::            Set the runtime scheduling method
    154 
    155 Initialize, set, test, unset and destroy simple and nested locks.
    156 
    157 * omp_init_lock::            Initialize simple lock
    158 * omp_set_lock::             Wait for and set simple lock
    159 * omp_test_lock::            Test and set simple lock if available
    160 * omp_unset_lock::           Unset simple lock
    161 * omp_destroy_lock::         Destroy simple lock
    162 * omp_init_nest_lock::       Initialize nested lock
    163 * omp_set_nest_lock::        Wait for and set simple lock
    164 * omp_test_nest_lock::       Test and set nested lock if available
    165 * omp_unset_nest_lock::      Unset nested lock
    166 * omp_destroy_nest_lock::    Destroy nested lock
    167 
    168 Portable, thread-based, wall clock timer.
    169 
    170 * omp_get_wtick::            Get timer precision.
    171 * omp_get_wtime::            Elapsed wall clock time.
    172 
    173 
    174 File: libgomp.info,  Node: omp_get_active_level,  Next: omp_get_ancestor_thread_num,  Up: Runtime Library Routines
    175 
    176 2.1 'omp_get_active_level' - Number of parallel regions
    177 =======================================================
    178 
    179 _Description_:
    180      This function returns the nesting level for the active parallel
    181      blocks, which enclose the calling call.
    182 
    183 _C/C++_
    184      _Prototype_:   'int omp_get_active_level(void);'
    185 
    186 _Fortran_:
    187      _Interface_:   'integer function omp_get_active_level()'
    188 
    189 _See also_:
    190      *note omp_get_level::, *note omp_get_max_active_levels::, *note
    191      omp_set_max_active_levels::
    192 
    193 _Reference_:
    194      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.20.
    195 
    196 
    197 File: libgomp.info,  Node: omp_get_ancestor_thread_num,  Next: omp_get_cancellation,  Prev: omp_get_active_level,  Up: Runtime Library Routines
    198 
    199 2.2 'omp_get_ancestor_thread_num' - Ancestor thread ID
    200 ======================================================
    201 
    202 _Description_:
    203      This function returns the thread identification number for the
    204      given nesting level of the current thread.  For values of LEVEL
    205      outside zero to 'omp_get_level' -1 is returned; if LEVEL is
    206      'omp_get_level' the result is identical to 'omp_get_thread_num'.
    207 
    208 _C/C++_
    209      _Prototype_:   'int omp_get_ancestor_thread_num(int level);'
    210 
    211 _Fortran_:
    212      _Interface_:   'integer function omp_get_ancestor_thread_num(level)'
    213                     'integer level'
    214 
    215 _See also_:
    216      *note omp_get_level::, *note omp_get_thread_num::, *note
    217      omp_get_team_size::
    218 
    219 _Reference_:
    220      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.18.
    221 
    222 
    223 File: libgomp.info,  Node: omp_get_cancellation,  Next: omp_get_default_device,  Prev: omp_get_ancestor_thread_num,  Up: Runtime Library Routines
    224 
    225 2.3 'omp_get_cancellation' - Whether cancellation support is enabled
    226 ====================================================================
    227 
    228 _Description_:
    229      This function returns 'true' if cancellation is activated, 'false'
    230      otherwise.  Here, 'true' and 'false' represent their
    231      language-specific counterparts.  Unless 'OMP_CANCELLATION' is set
    232      true, cancellations are deactivated.
    233 
    234 _C/C++_:
    235      _Prototype_:   'int omp_get_cancellation(void);'
    236 
    237 _Fortran_:
    238      _Interface_:   'logical function omp_get_cancellation()'
    239 
    240 _See also_:
    241      *note OMP_CANCELLATION::
    242 
    243 _Reference_:
    244      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.9.
    245 
    246 
    247 File: libgomp.info,  Node: omp_get_default_device,  Next: omp_get_dynamic,  Prev: omp_get_cancellation,  Up: Runtime Library Routines
    248 
    249 2.4 'omp_get_default_device' - Get the default device for target regions
    250 ========================================================================
    251 
    252 _Description_:
    253      Get the default device for target regions without device clause.
    254 
    255 _C/C++_:
    256      _Prototype_:   'int omp_get_default_device(void);'
    257 
    258 _Fortran_:
    259      _Interface_:   'integer function omp_get_default_device()'
    260 
    261 _See also_:
    262      *note OMP_DEFAULT_DEVICE::, *note omp_set_default_device::
    263 
    264 _Reference_:
    265      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.24.
    266 
    267 
    268 File: libgomp.info,  Node: omp_get_dynamic,  Next: omp_get_level,  Prev: omp_get_default_device,  Up: Runtime Library Routines
    269 
    270 2.5 'omp_get_dynamic' - Dynamic teams setting
    271 =============================================
    272 
    273 _Description_:
    274      This function returns 'true' if enabled, 'false' otherwise.  Here,
    275      'true' and 'false' represent their language-specific counterparts.
    276 
    277      The dynamic team setting may be initialized at startup by the
    278      'OMP_DYNAMIC' environment variable or at runtime using
    279      'omp_set_dynamic'.  If undefined, dynamic adjustment is disabled by
    280      default.
    281 
    282 _C/C++_:
    283      _Prototype_:   'int omp_get_dynamic(void);'
    284 
    285 _Fortran_:
    286      _Interface_:   'logical function omp_get_dynamic()'
    287 
    288 _See also_:
    289      *note omp_set_dynamic::, *note OMP_DYNAMIC::
    290 
    291 _Reference_:
    292      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.8.
    293 
    294 
    295 File: libgomp.info,  Node: omp_get_level,  Next: omp_get_max_active_levels,  Prev: omp_get_dynamic,  Up: Runtime Library Routines
    296 
    297 2.6 'omp_get_level' - Obtain the current nesting level
    298 ======================================================
    299 
    300 _Description_:
    301      This function returns the nesting level for the parallel blocks,
    302      which enclose the calling call.
    303 
    304 _C/C++_
    305      _Prototype_:   'int omp_get_level(void);'
    306 
    307 _Fortran_:
    308      _Interface_:   'integer function omp_level()'
    309 
    310 _See also_:
    311      *note omp_get_active_level::
    312 
    313 _Reference_:
    314      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.17.
    315 
    316 
    317 File: libgomp.info,  Node: omp_get_max_active_levels,  Next: omp_get_max_threads,  Prev: omp_get_level,  Up: Runtime Library Routines
    318 
    319 2.7 'omp_get_max_active_levels' - Maximum number of active regions
    320 ==================================================================
    321 
    322 _Description_:
    323      This function obtains the maximum allowed number of nested, active
    324      parallel regions.
    325 
    326 _C/C++_
    327      _Prototype_:   'int omp_get_max_active_levels(void);'
    328 
    329 _Fortran_:
    330      _Interface_:   'integer function omp_get_max_active_levels()'
    331 
    332 _See also_:
    333      *note omp_set_max_active_levels::, *note omp_get_active_level::
    334 
    335 _Reference_:
    336      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.16.
    337 
    338 
    339 File: libgomp.info,  Node: omp_get_max_threads,  Next: omp_get_nested,  Prev: omp_get_max_active_levels,  Up: Runtime Library Routines
    340 
    341 2.8 'omp_get_max_threads' - Maximum number of threads of parallel region
    342 ========================================================================
    343 
    344 _Description_:
    345      Return the maximum number of threads used for the current parallel
    346      region that does not use the clause 'num_threads'.
    347 
    348 _C/C++_:
    349      _Prototype_:   'int omp_get_max_threads(void);'
    350 
    351 _Fortran_:
    352      _Interface_:   'integer function omp_get_max_threads()'
    353 
    354 _See also_:
    355      *note omp_set_num_threads::, *note omp_set_dynamic::, *note
    356      omp_get_thread_limit::
    357 
    358 _Reference_:
    359      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.3.
    360 
    361 
    362 File: libgomp.info,  Node: omp_get_nested,  Next: omp_get_num_devices,  Prev: omp_get_max_threads,  Up: Runtime Library Routines
    363 
    364 2.9 'omp_get_nested' - Nested parallel regions
    365 ==============================================
    366 
    367 _Description_:
    368      This function returns 'true' if nested parallel regions are
    369      enabled, 'false' otherwise.  Here, 'true' and 'false' represent
    370      their language-specific counterparts.
    371 
    372      Nested parallel regions may be initialized at startup by the
    373      'OMP_NESTED' environment variable or at runtime using
    374      'omp_set_nested'.  If undefined, nested parallel regions are
    375      disabled by default.
    376 
    377 _C/C++_:
    378      _Prototype_:   'int omp_get_nested(void);'
    379 
    380 _Fortran_:
    381      _Interface_:   'logical function omp_get_nested()'
    382 
    383 _See also_:
    384      *note omp_set_nested::, *note OMP_NESTED::
    385 
    386 _Reference_:
    387      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.11.
    388 
    389 
    390 File: libgomp.info,  Node: omp_get_num_devices,  Next: omp_get_num_procs,  Prev: omp_get_nested,  Up: Runtime Library Routines
    391 
    392 2.10 'omp_get_num_devices' - Number of target devices
    393 =====================================================
    394 
    395 _Description_:
    396      Returns the number of target devices.
    397 
    398 _C/C++_:
    399      _Prototype_:   'int omp_get_num_devices(void);'
    400 
    401 _Fortran_:
    402      _Interface_:   'integer function omp_get_num_devices()'
    403 
    404 _Reference_:
    405      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.25.
    406 
    407 
    408 File: libgomp.info,  Node: omp_get_num_procs,  Next: omp_get_num_teams,  Prev: omp_get_num_devices,  Up: Runtime Library Routines
    409 
    410 2.11 'omp_get_num_procs' - Number of processors online
    411 ======================================================
    412 
    413 _Description_:
    414      Returns the number of processors online on that device.
    415 
    416 _C/C++_:
    417      _Prototype_:   'int omp_get_num_procs(void);'
    418 
    419 _Fortran_:
    420      _Interface_:   'integer function omp_get_num_procs()'
    421 
    422 _Reference_:
    423      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.5.
    424 
    425 
    426 File: libgomp.info,  Node: omp_get_num_teams,  Next: omp_get_num_threads,  Prev: omp_get_num_procs,  Up: Runtime Library Routines
    427 
    428 2.12 'omp_get_num_teams' - Number of teams
    429 ==========================================
    430 
    431 _Description_:
    432      Returns the number of teams in the current team region.
    433 
    434 _C/C++_:
    435      _Prototype_:   'int omp_get_num_teams(void);'
    436 
    437 _Fortran_:
    438      _Interface_:   'integer function omp_get_num_teams()'
    439 
    440 _Reference_:
    441      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.26.
    442 
    443 
    444 File: libgomp.info,  Node: omp_get_num_threads,  Next: omp_get_proc_bind,  Prev: omp_get_num_teams,  Up: Runtime Library Routines
    445 
    446 2.13 'omp_get_num_threads' - Size of the active team
    447 ====================================================
    448 
    449 _Description_:
    450      Returns the number of threads in the current team.  In a sequential
    451      section of the program 'omp_get_num_threads' returns 1.
    452 
    453      The default team size may be initialized at startup by the
    454      'OMP_NUM_THREADS' environment variable.  At runtime, the size of
    455      the current team may be set either by the 'NUM_THREADS' clause or
    456      by 'omp_set_num_threads'.  If none of the above were used to define
    457      a specific value and 'OMP_DYNAMIC' is disabled, one thread per CPU
    458      online is used.
    459 
    460 _C/C++_:
    461      _Prototype_:   'int omp_get_num_threads(void);'
    462 
    463 _Fortran_:
    464      _Interface_:   'integer function omp_get_num_threads()'
    465 
    466 _See also_:
    467      *note omp_get_max_threads::, *note omp_set_num_threads::, *note
    468      OMP_NUM_THREADS::
    469 
    470 _Reference_:
    471      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.2.
    472 
    473 
    474 File: libgomp.info,  Node: omp_get_proc_bind,  Next: omp_get_schedule,  Prev: omp_get_num_threads,  Up: Runtime Library Routines
    475 
    476 2.14 'omp_get_proc_bind' - Whether theads may be moved between CPUs
    477 ===================================================================
    478 
    479 _Description_:
    480      This functions returns the currently active thread affinity policy,
    481      which is set via 'OMP_PROC_BIND'.  Possible values are
    482      'omp_proc_bind_false', 'omp_proc_bind_true',
    483      'omp_proc_bind_master', 'omp_proc_bind_close' and
    484      'omp_proc_bind_spread'.
    485 
    486 _C/C++_:
    487      _Prototype_:   'omp_proc_bind_t omp_get_proc_bind(void);'
    488 
    489 _Fortran_:
    490      _Interface_:   'integer(kind=omp_proc_bind_kind) function
    491                     omp_get_proc_bind()'
    492 
    493 _See also_:
    494      *note OMP_PROC_BIND::, *note OMP_PLACES::, *note
    495      GOMP_CPU_AFFINITY::,
    496 
    497 _Reference_:
    498      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.22.
    499 
    500 
    501 File: libgomp.info,  Node: omp_get_schedule,  Next: omp_get_team_num,  Prev: omp_get_proc_bind,  Up: Runtime Library Routines
    502 
    503 2.15 'omp_get_schedule' - Obtain the runtime scheduling method
    504 ==============================================================
    505 
    506 _Description_:
    507      Obtain the runtime scheduling method.  The KIND argument will be
    508      set to the value 'omp_sched_static', 'omp_sched_dynamic',
    509      'omp_sched_guided' or 'omp_sched_auto'.  The second argument,
    510      MODIFIER, is set to the chunk size.
    511 
    512 _C/C++_
    513      _Prototype_:   'void omp_get_schedule(omp_sched_t *kind, int
    514                     *modifier);'
    515 
    516 _Fortran_:
    517      _Interface_:   'subroutine omp_get_schedule(kind, modifier)'
    518                     'integer(kind=omp_sched_kind) kind'
    519                     'integer modifier'
    520 
    521 _See also_:
    522      *note omp_set_schedule::, *note OMP_SCHEDULE::
    523 
    524 _Reference_:
    525      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.13.
    526 
    527 
    528 File: libgomp.info,  Node: omp_get_team_num,  Next: omp_get_team_size,  Prev: omp_get_schedule,  Up: Runtime Library Routines
    529 
    530 2.16 'omp_get_team_num' - Get team number
    531 =========================================
    532 
    533 _Description_:
    534      Returns the team number of the calling thread.
    535 
    536 _C/C++_:
    537      _Prototype_:   'int omp_get_team_num(void);'
    538 
    539 _Fortran_:
    540      _Interface_:   'integer function omp_get_team_num()'
    541 
    542 _Reference_:
    543      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.27.
    544 
    545 
    546 File: libgomp.info,  Node: omp_get_team_size,  Next: omp_get_thread_limit,  Prev: omp_get_team_num,  Up: Runtime Library Routines
    547 
    548 2.17 'omp_get_team_size' - Number of threads in a team
    549 ======================================================
    550 
    551 _Description_:
    552      This function returns the number of threads in a thread team to
    553      which either the current thread or its ancestor belongs.  For
    554      values of LEVEL outside zero to 'omp_get_level', -1 is returned; if
    555      LEVEL is zero, 1 is returned, and for 'omp_get_level', the result
    556      is identical to 'omp_get_num_threads'.
    557 
    558 _C/C++_:
    559      _Prototype_:   'int omp_get_team_size(int level);'
    560 
    561 _Fortran_:
    562      _Interface_:   'integer function omp_get_team_size(level)'
    563                     'integer level'
    564 
    565 _See also_:
    566      *note omp_get_num_threads::, *note omp_get_level::, *note
    567      omp_get_ancestor_thread_num::
    568 
    569 _Reference_:
    570      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.19.
    571 
    572 
    573 File: libgomp.info,  Node: omp_get_thread_limit,  Next: omp_get_thread_num,  Prev: omp_get_team_size,  Up: Runtime Library Routines
    574 
    575 2.18 'omp_get_thread_limit' - Maximum number of threads
    576 =======================================================
    577 
    578 _Description_:
    579      Return the maximum number of threads of the program.
    580 
    581 _C/C++_:
    582      _Prototype_:   'int omp_get_thread_limit(void);'
    583 
    584 _Fortran_:
    585      _Interface_:   'integer function omp_get_thread_limit()'
    586 
    587 _See also_:
    588      *note omp_get_max_threads::, *note OMP_THREAD_LIMIT::
    589 
    590 _Reference_:
    591      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.14.
    592 
    593 
    594 File: libgomp.info,  Node: omp_get_thread_num,  Next: omp_in_parallel,  Prev: omp_get_thread_limit,  Up: Runtime Library Routines
    595 
    596 2.19 'omp_get_thread_num' - Current thread ID
    597 =============================================
    598 
    599 _Description_:
    600      Returns a unique thread identification number within the current
    601      team.  In a sequential parts of the program, 'omp_get_thread_num'
    602      always returns 0.  In parallel regions the return value varies from
    603      0 to 'omp_get_num_threads'-1 inclusive.  The return value of the
    604      master thread of a team is always 0.
    605 
    606 _C/C++_:
    607      _Prototype_:   'int omp_get_thread_num(void);'
    608 
    609 _Fortran_:
    610      _Interface_:   'integer function omp_get_thread_num()'
    611 
    612 _See also_:
    613      *note omp_get_num_threads::, *note omp_get_ancestor_thread_num::
    614 
    615 _Reference_:
    616      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.4.
    617 
    618 
    619 File: libgomp.info,  Node: omp_in_parallel,  Next: omp_in_final,  Prev: omp_get_thread_num,  Up: Runtime Library Routines
    620 
    621 2.20 'omp_in_parallel' - Whether a parallel region is active
    622 ============================================================
    623 
    624 _Description_:
    625      This function returns 'true' if currently running in parallel,
    626      'false' otherwise.  Here, 'true' and 'false' represent their
    627      language-specific counterparts.
    628 
    629 _C/C++_:
    630      _Prototype_:   'int omp_in_parallel(void);'
    631 
    632 _Fortran_:
    633      _Interface_:   'logical function omp_in_parallel()'
    634 
    635 _Reference_:
    636      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.6.
    637 
    638 
    639 File: libgomp.info,  Node: omp_in_final,  Next: omp_is_initial_device,  Prev: omp_in_parallel,  Up: Runtime Library Routines
    640 
    641 2.21 'omp_in_final' - Whether in final or included task region
    642 ==============================================================
    643 
    644 _Description_:
    645      This function returns 'true' if currently running in a final or
    646      included task region, 'false' otherwise.  Here, 'true' and 'false'
    647      represent their language-specific counterparts.
    648 
    649 _C/C++_:
    650      _Prototype_:   'int omp_in_final(void);'
    651 
    652 _Fortran_:
    653      _Interface_:   'logical function omp_in_final()'
    654 
    655 _Reference_:
    656      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.21.
    657 
    658 
    659 File: libgomp.info,  Node: omp_is_initial_device,  Next: omp_set_default_device,  Prev: omp_in_final,  Up: Runtime Library Routines
    660 
    661 2.22 'omp_is_initial_device' - Whether executing on the host device
    662 ===================================================================
    663 
    664 _Description_:
    665      This function returns 'true' if currently running on the host
    666      device, 'false' otherwise.  Here, 'true' and 'false' represent
    667      their language-specific counterparts.
    668 
    669 _C/C++_:
    670      _Prototype_:   'int omp_is_initial_device(void);'
    671 
    672 _Fortran_:
    673      _Interface_:   'logical function omp_is_initial_device()'
    674 
    675 _Reference_:
    676      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.28.
    677 
    678 
    679 File: libgomp.info,  Node: omp_set_default_device,  Next: omp_set_dynamic,  Prev: omp_is_initial_device,  Up: Runtime Library Routines
    680 
    681 2.23 'omp_set_default_device' - Set the default device for target regions
    682 =========================================================================
    683 
    684 _Description_:
    685      Set the default device for target regions without device clause.
    686      The argument shall be a nonnegative device number.
    687 
    688 _C/C++_:
    689      _Prototype_:   'void omp_set_default_device(int device_num);'
    690 
    691 _Fortran_:
    692      _Interface_:   'subroutine omp_set_default_device(device_num)'
    693                     'integer device_num'
    694 
    695 _See also_:
    696      *note OMP_DEFAULT_DEVICE::, *note omp_get_default_device::
    697 
    698 _Reference_:
    699      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.23.
    700 
    701 
    702 File: libgomp.info,  Node: omp_set_dynamic,  Next: omp_set_max_active_levels,  Prev: omp_set_default_device,  Up: Runtime Library Routines
    703 
    704 2.24 'omp_set_dynamic' - Enable/disable dynamic teams
    705 =====================================================
    706 
    707 _Description_:
    708      Enable or disable the dynamic adjustment of the number of threads
    709      within a team.  The function takes the language-specific equivalent
    710      of 'true' and 'false', where 'true' enables dynamic adjustment of
    711      team sizes and 'false' disables it.
    712 
    713 _C/C++_:
    714      _Prototype_:   'void omp_set_dynamic(int dynamic_threads);'
    715 
    716 _Fortran_:
    717      _Interface_:   'subroutine omp_set_dynamic(dynamic_threads)'
    718                     'logical, intent(in) :: dynamic_threads'
    719 
    720 _See also_:
    721      *note OMP_DYNAMIC::, *note omp_get_dynamic::
    722 
    723 _Reference_:
    724      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.7.
    725 
    726 
    727 File: libgomp.info,  Node: omp_set_max_active_levels,  Next: omp_set_nested,  Prev: omp_set_dynamic,  Up: Runtime Library Routines
    728 
    729 2.25 'omp_set_max_active_levels' - Limits the number of active parallel regions
    730 ===============================================================================
    731 
    732 _Description_:
    733      This function limits the maximum allowed number of nested, active
    734      parallel regions.
    735 
    736 _C/C++_
    737      _Prototype_:   'void omp_set_max_active_levels(int max_levels);'
    738 
    739 _Fortran_:
    740      _Interface_:   'subroutine omp_set_max_active_levels(max_levels)'
    741                     'integer max_levels'
    742 
    743 _See also_:
    744      *note omp_get_max_active_levels::, *note omp_get_active_level::
    745 
    746 _Reference_:
    747      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.15.
    748 
    749 
    750 File: libgomp.info,  Node: omp_set_nested,  Next: omp_set_num_threads,  Prev: omp_set_max_active_levels,  Up: Runtime Library Routines
    751 
    752 2.26 'omp_set_nested' - Enable/disable nested parallel regions
    753 ==============================================================
    754 
    755 _Description_:
    756      Enable or disable nested parallel regions, i.e., whether team
    757      members are allowed to create new teams.  The function takes the
    758      language-specific equivalent of 'true' and 'false', where 'true'
    759      enables dynamic adjustment of team sizes and 'false' disables it.
    760 
    761 _C/C++_:
    762      _Prototype_:   'void omp_set_nested(int nested);'
    763 
    764 _Fortran_:
    765      _Interface_:   'subroutine omp_set_nested(nested)'
    766                     'logical, intent(in) :: nested'
    767 
    768 _See also_:
    769      *note OMP_NESTED::, *note omp_get_nested::
    770 
    771 _Reference_:
    772      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.10.
    773 
    774 
    775 File: libgomp.info,  Node: omp_set_num_threads,  Next: omp_set_schedule,  Prev: omp_set_nested,  Up: Runtime Library Routines
    776 
    777 2.27 'omp_set_num_threads' - Set upper team size limit
    778 ======================================================
    779 
    780 _Description_:
    781      Specifies the number of threads used by default in subsequent
    782      parallel sections, if those do not specify a 'num_threads' clause.
    783      The argument of 'omp_set_num_threads' shall be a positive integer.
    784 
    785 _C/C++_:
    786      _Prototype_:   'void omp_set_num_threads(int num_threads);'
    787 
    788 _Fortran_:
    789      _Interface_:   'subroutine omp_set_num_threads(num_threads)'
    790                     'integer, intent(in) :: num_threads'
    791 
    792 _See also_:
    793      *note OMP_NUM_THREADS::, *note omp_get_num_threads::, *note
    794      omp_get_max_threads::
    795 
    796 _Reference_:
    797      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.1.
    798 
    799 
    800 File: libgomp.info,  Node: omp_set_schedule,  Next: omp_init_lock,  Prev: omp_set_num_threads,  Up: Runtime Library Routines
    801 
    802 2.28 'omp_set_schedule' - Set the runtime scheduling method
    803 ===========================================================
    804 
    805 _Description_:
    806      Sets the runtime scheduling method.  The KIND argument can have the
    807      value 'omp_sched_static', 'omp_sched_dynamic', 'omp_sched_guided'
    808      or 'omp_sched_auto'.  Except for 'omp_sched_auto', the chunk size
    809      is set to the value of MODIFIER if positive, or to the default
    810      value if zero or negative.  For 'omp_sched_auto' the MODIFIER
    811      argument is ignored.
    812 
    813 _C/C++_
    814      _Prototype_:   'void omp_set_schedule(omp_sched_t kind, int modifier);'
    815 
    816 _Fortran_:
    817      _Interface_:   'subroutine omp_set_schedule(kind, modifier)'
    818                     'integer(kind=omp_sched_kind) kind'
    819                     'integer modifier'
    820 
    821 _See also_:
    822      *note omp_get_schedule:: *note OMP_SCHEDULE::
    823 
    824 _Reference_:
    825      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.2.12.
    826 
    827 
    828 File: libgomp.info,  Node: omp_init_lock,  Next: omp_set_lock,  Prev: omp_set_schedule,  Up: Runtime Library Routines
    829 
    830 2.29 'omp_init_lock' - Initialize simple lock
    831 =============================================
    832 
    833 _Description_:
    834      Initialize a simple lock.  After initialization, the lock is in an
    835      unlocked state.
    836 
    837 _C/C++_:
    838      _Prototype_:   'void omp_init_lock(omp_lock_t *lock);'
    839 
    840 _Fortran_:
    841      _Interface_:   'subroutine omp_init_lock(svar)'
    842                     'integer(omp_lock_kind), intent(out) :: svar'
    843 
    844 _See also_:
    845      *note omp_destroy_lock::
    846 
    847 _Reference_:
    848      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.3.1.
    849 
    850 
    851 File: libgomp.info,  Node: omp_set_lock,  Next: omp_test_lock,  Prev: omp_init_lock,  Up: Runtime Library Routines
    852 
    853 2.30 'omp_set_lock' - Wait for and set simple lock
    854 ==================================================
    855 
    856 _Description_:
    857      Before setting a simple lock, the lock variable must be initialized
    858      by 'omp_init_lock'.  The calling thread is blocked until the lock
    859      is available.  If the lock is already held by the current thread, a
    860      deadlock occurs.
    861 
    862 _C/C++_:
    863      _Prototype_:   'void omp_set_lock(omp_lock_t *lock);'
    864 
    865 _Fortran_:
    866      _Interface_:   'subroutine omp_set_lock(svar)'
    867                     'integer(omp_lock_kind), intent(inout) :: svar'
    868 
    869 _See also_:
    870      *note omp_init_lock::, *note omp_test_lock::, *note
    871      omp_unset_lock::
    872 
    873 _Reference_:
    874      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.3.3.
    875 
    876 
    877 File: libgomp.info,  Node: omp_test_lock,  Next: omp_unset_lock,  Prev: omp_set_lock,  Up: Runtime Library Routines
    878 
    879 2.31 'omp_test_lock' - Test and set simple lock if available
    880 ============================================================
    881 
    882 _Description_:
    883      Before setting a simple lock, the lock variable must be initialized
    884      by 'omp_init_lock'.  Contrary to 'omp_set_lock', 'omp_test_lock'
    885      does not block if the lock is not available.  This function returns
    886      'true' upon success, 'false' otherwise.  Here, 'true' and 'false'
    887      represent their language-specific counterparts.
    888 
    889 _C/C++_:
    890      _Prototype_:   'int omp_test_lock(omp_lock_t *lock);'
    891 
    892 _Fortran_:
    893      _Interface_:   'logical function omp_test_lock(svar)'
    894                     'integer(omp_lock_kind), intent(inout) :: svar'
    895 
    896 _See also_:
    897      *note omp_init_lock::, *note omp_set_lock::, *note omp_set_lock::
    898 
    899 _Reference_:
    900      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.3.5.
    901 
    902 
    903 File: libgomp.info,  Node: omp_unset_lock,  Next: omp_destroy_lock,  Prev: omp_test_lock,  Up: Runtime Library Routines
    904 
    905 2.32 'omp_unset_lock' - Unset simple lock
    906 =========================================
    907 
    908 _Description_:
    909      A simple lock about to be unset must have been locked by
    910      'omp_set_lock' or 'omp_test_lock' before.  In addition, the lock
    911      must be held by the thread calling 'omp_unset_lock'.  Then, the
    912      lock becomes unlocked.  If one or more threads attempted to set the
    913      lock before, one of them is chosen to, again, set the lock to
    914      itself.
    915 
    916 _C/C++_:
    917      _Prototype_:   'void omp_unset_lock(omp_lock_t *lock);'
    918 
    919 _Fortran_:
    920      _Interface_:   'subroutine omp_unset_lock(svar)'
    921                     'integer(omp_lock_kind), intent(inout) :: svar'
    922 
    923 _See also_:
    924      *note omp_set_lock::, *note omp_test_lock::
    925 
    926 _Reference_:
    927      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.3.4.
    928 
    929 
    930 File: libgomp.info,  Node: omp_destroy_lock,  Next: omp_init_nest_lock,  Prev: omp_unset_lock,  Up: Runtime Library Routines
    931 
    932 2.33 'omp_destroy_lock' - Destroy simple lock
    933 =============================================
    934 
    935 _Description_:
    936      Destroy a simple lock.  In order to be destroyed, a simple lock
    937      must be in the unlocked state.
    938 
    939 _C/C++_:
    940      _Prototype_:   'void omp_destroy_lock(omp_lock_t *lock);'
    941 
    942 _Fortran_:
    943      _Interface_:   'subroutine omp_destroy_lock(svar)'
    944                     'integer(omp_lock_kind), intent(inout) :: svar'
    945 
    946 _See also_:
    947      *note omp_init_lock::
    948 
    949 _Reference_:
    950      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.3.2.
    951 
    952 
    953 File: libgomp.info,  Node: omp_init_nest_lock,  Next: omp_set_nest_lock,  Prev: omp_destroy_lock,  Up: Runtime Library Routines
    954 
    955 2.34 'omp_init_nest_lock' - Initialize nested lock
    956 ==================================================
    957 
    958 _Description_:
    959      Initialize a nested lock.  After initialization, the lock is in an
    960      unlocked state and the nesting count is set to zero.
    961 
    962 _C/C++_:
    963      _Prototype_:   'void omp_init_nest_lock(omp_nest_lock_t *lock);'
    964 
    965 _Fortran_:
    966      _Interface_:   'subroutine omp_init_nest_lock(nvar)'
    967                     'integer(omp_nest_lock_kind), intent(out) :: nvar'
    968 
    969 _See also_:
    970      *note omp_destroy_nest_lock::
    971 
    972 _Reference_:
    973      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.3.1.
    974 
    975 
    976 File: libgomp.info,  Node: omp_set_nest_lock,  Next: omp_test_nest_lock,  Prev: omp_init_nest_lock,  Up: Runtime Library Routines
    977 
    978 2.35 'omp_set_nest_lock' - Wait for and set nested lock
    979 =======================================================
    980 
    981 _Description_:
    982      Before setting a nested lock, the lock variable must be initialized
    983      by 'omp_init_nest_lock'.  The calling thread is blocked until the
    984      lock is available.  If the lock is already held by the current
    985      thread, the nesting count for the lock is incremented.
    986 
    987 _C/C++_:
    988      _Prototype_:   'void omp_set_nest_lock(omp_nest_lock_t *lock);'
    989 
    990 _Fortran_:
    991      _Interface_:   'subroutine omp_set_nest_lock(nvar)'
    992                     'integer(omp_nest_lock_kind), intent(inout) :: nvar'
    993 
    994 _See also_:
    995      *note omp_init_nest_lock::, *note omp_unset_nest_lock::
    996 
    997 _Reference_:
    998      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.3.3.
    999 
   1000 
   1001 File: libgomp.info,  Node: omp_test_nest_lock,  Next: omp_unset_nest_lock,  Prev: omp_set_nest_lock,  Up: Runtime Library Routines
   1002 
   1003 2.36 'omp_test_nest_lock' - Test and set nested lock if available
   1004 =================================================================
   1005 
   1006 _Description_:
   1007      Before setting a nested lock, the lock variable must be initialized
   1008      by 'omp_init_nest_lock'.  Contrary to 'omp_set_nest_lock',
   1009      'omp_test_nest_lock' does not block if the lock is not available.
   1010      If the lock is already held by the current thread, the new nesting
   1011      count is returned.  Otherwise, the return value equals zero.
   1012 
   1013 _C/C++_:
   1014      _Prototype_:   'int omp_test_nest_lock(omp_nest_lock_t *lock);'
   1015 
   1016 _Fortran_:
   1017      _Interface_:   'logical function omp_test_nest_lock(nvar)'
   1018                     'integer(omp_nest_lock_kind), intent(inout) :: nvar'
   1019 
   1020 _See also_:
   1021      *note omp_init_lock::, *note omp_set_lock::, *note omp_set_lock::
   1022 
   1023 _Reference_:
   1024      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.3.5.
   1025 
   1026 
   1027 File: libgomp.info,  Node: omp_unset_nest_lock,  Next: omp_destroy_nest_lock,  Prev: omp_test_nest_lock,  Up: Runtime Library Routines
   1028 
   1029 2.37 'omp_unset_nest_lock' - Unset nested lock
   1030 ==============================================
   1031 
   1032 _Description_:
   1033      A nested lock about to be unset must have been locked by
   1034      'omp_set_nested_lock' or 'omp_test_nested_lock' before.  In
   1035      addition, the lock must be held by the thread calling
   1036      'omp_unset_nested_lock'.  If the nesting count drops to zero, the
   1037      lock becomes unlocked.  If one ore more threads attempted to set
   1038      the lock before, one of them is chosen to, again, set the lock to
   1039      itself.
   1040 
   1041 _C/C++_:
   1042      _Prototype_:   'void omp_unset_nest_lock(omp_nest_lock_t *lock);'
   1043 
   1044 _Fortran_:
   1045      _Interface_:   'subroutine omp_unset_nest_lock(nvar)'
   1046                     'integer(omp_nest_lock_kind), intent(inout) :: nvar'
   1047 
   1048 _See also_:
   1049      *note omp_set_nest_lock::
   1050 
   1051 _Reference_:
   1052      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.3.4.
   1053 
   1054 
   1055 File: libgomp.info,  Node: omp_destroy_nest_lock,  Next: omp_get_wtick,  Prev: omp_unset_nest_lock,  Up: Runtime Library Routines
   1056 
   1057 2.38 'omp_destroy_nest_lock' - Destroy nested lock
   1058 ==================================================
   1059 
   1060 _Description_:
   1061      Destroy a nested lock.  In order to be destroyed, a nested lock
   1062      must be in the unlocked state and its nesting count must equal
   1063      zero.
   1064 
   1065 _C/C++_:
   1066      _Prototype_:   'void omp_destroy_nest_lock(omp_nest_lock_t *);'
   1067 
   1068 _Fortran_:
   1069      _Interface_:   'subroutine omp_destroy_nest_lock(nvar)'
   1070                     'integer(omp_nest_lock_kind), intent(inout) :: nvar'
   1071 
   1072 _See also_:
   1073      *note omp_init_lock::
   1074 
   1075 _Reference_:
   1076      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.3.2.
   1077 
   1078 
   1079 File: libgomp.info,  Node: omp_get_wtick,  Next: omp_get_wtime,  Prev: omp_destroy_nest_lock,  Up: Runtime Library Routines
   1080 
   1081 2.39 'omp_get_wtick' - Get timer precision
   1082 ==========================================
   1083 
   1084 _Description_:
   1085      Gets the timer precision, i.e., the number of seconds between two
   1086      successive clock ticks.
   1087 
   1088 _C/C++_:
   1089      _Prototype_:   'double omp_get_wtick(void);'
   1090 
   1091 _Fortran_:
   1092      _Interface_:   'double precision function omp_get_wtick()'
   1093 
   1094 _See also_:
   1095      *note omp_get_wtime::
   1096 
   1097 _Reference_:
   1098      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.4.2.
   1099 
   1100 
   1101 File: libgomp.info,  Node: omp_get_wtime,  Prev: omp_get_wtick,  Up: Runtime Library Routines
   1102 
   1103 2.40 'omp_get_wtime' - Elapsed wall clock time
   1104 ==============================================
   1105 
   1106 _Description_:
   1107      Elapsed wall clock time in seconds.  The time is measured per
   1108      thread, no guarantee can be made that two distinct threads measure
   1109      the same time.  Time is measured from some "time in the past",
   1110      which is an arbitrary time guaranteed not to change during the
   1111      execution of the program.
   1112 
   1113 _C/C++_:
   1114      _Prototype_:   'double omp_get_wtime(void);'
   1115 
   1116 _Fortran_:
   1117      _Interface_:   'double precision function omp_get_wtime()'
   1118 
   1119 _See also_:
   1120      *note omp_get_wtick::
   1121 
   1122 _Reference_:
   1123      OpenMP specification v4.0 (http://www.openmp.org/), Section 3.4.1.
   1124 
   1125 
   1126 File: libgomp.info,  Node: Environment Variables,  Next: The libgomp ABI,  Prev: Runtime Library Routines,  Up: Top
   1127 
   1128 3 Environment Variables
   1129 ***********************
   1130 
   1131 The environment variables which beginning with 'OMP_' are defined by
   1132 section 4 of the OpenMP specification in version 4.0, while those
   1133 beginning with 'GOMP_' are GNU extensions.
   1134 
   1135 * Menu:
   1136 
   1137 * OMP_CANCELLATION::      Set whether cancellation is activated
   1138 * OMP_DISPLAY_ENV::       Show OpenMP version and environment variables
   1139 * OMP_DEFAULT_DEVICE::    Set the device used in target regions
   1140 * OMP_DYNAMIC::           Dynamic adjustment of threads
   1141 * OMP_MAX_ACTIVE_LEVELS:: Set the maximum number of nested parallel regions
   1142 * OMP_NESTED::            Nested parallel regions
   1143 * OMP_NUM_THREADS::       Specifies the number of threads to use
   1144 * OMP_PROC_BIND::         Whether theads may be moved between CPUs
   1145 * OMP_PLACES::            Specifies on which CPUs the theads should be placed
   1146 * OMP_STACKSIZE::         Set default thread stack size
   1147 * OMP_SCHEDULE::          How threads are scheduled
   1148 * OMP_THREAD_LIMIT::      Set the maximum number of threads
   1149 * OMP_WAIT_POLICY::       How waiting threads are handled
   1150 * GOMP_CPU_AFFINITY::     Bind threads to specific CPUs
   1151 * GOMP_DEBUG::            Enable debugging output
   1152 * GOMP_STACKSIZE::        Set default thread stack size
   1153 * GOMP_SPINCOUNT::        Set the busy-wait spin count
   1154 
   1155 
   1156 File: libgomp.info,  Node: OMP_CANCELLATION,  Next: OMP_DISPLAY_ENV,  Up: Environment Variables
   1157 
   1158 3.1 'OMP_CANCELLATION' - Set whether cancellation is activated
   1159 ==============================================================
   1160 
   1161 _Description_:
   1162      If set to 'TRUE', the cancellation is activated.  If set to 'FALSE'
   1163      or if unset, cancellation is disabled and the 'cancel' construct is
   1164      ignored.
   1165 
   1166 _See also_:
   1167      *note omp_get_cancellation::
   1168 
   1169 _Reference_:
   1170      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.11
   1171 
   1172 
   1173 File: libgomp.info,  Node: OMP_DISPLAY_ENV,  Next: OMP_DEFAULT_DEVICE,  Prev: OMP_CANCELLATION,  Up: Environment Variables
   1174 
   1175 3.2 'OMP_DISPLAY_ENV' - Show OpenMP version and environment variables
   1176 =====================================================================
   1177 
   1178 _Description_:
   1179      If set to 'TRUE', the OpenMP version number and the values
   1180      associated with the OpenMP environment variables are printed to
   1181      'stderr'.  If set to 'VERBOSE', it additionally shows the value of
   1182      the environment variables which are GNU extensions.  If undefined
   1183      or set to 'FALSE', this information will not be shown.
   1184 
   1185 _Reference_:
   1186      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.12
   1187 
   1188 
   1189 File: libgomp.info,  Node: OMP_DEFAULT_DEVICE,  Next: OMP_DYNAMIC,  Prev: OMP_DISPLAY_ENV,  Up: Environment Variables
   1190 
   1191 3.3 'OMP_DEFAULT_DEVICE' - Set the device used in target regions
   1192 ================================================================
   1193 
   1194 _Description_:
   1195      Set to choose the device which is used in a 'target' region, unless
   1196      the value is overridden by 'omp_set_default_device' or by a
   1197      'device' clause.  The value shall be the nonnegative device number.
   1198      If no device with the given device number exists, the code is
   1199      executed on the host.  If unset, device number 0 will be used.
   1200 
   1201 _See also_:
   1202      *note omp_get_default_device::, *note omp_set_default_device::,
   1203 
   1204 _Reference_:
   1205      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.11
   1206 
   1207 
   1208 File: libgomp.info,  Node: OMP_DYNAMIC,  Next: OMP_MAX_ACTIVE_LEVELS,  Prev: OMP_DEFAULT_DEVICE,  Up: Environment Variables
   1209 
   1210 3.4 'OMP_DYNAMIC' - Dynamic adjustment of threads
   1211 =================================================
   1212 
   1213 _Description_:
   1214      Enable or disable the dynamic adjustment of the number of threads
   1215      within a team.  The value of this environment variable shall be
   1216      'TRUE' or 'FALSE'.  If undefined, dynamic adjustment is disabled by
   1217      default.
   1218 
   1219 _See also_:
   1220      *note omp_set_dynamic::
   1221 
   1222 _Reference_:
   1223      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.3
   1224 
   1225 
   1226 File: libgomp.info,  Node: OMP_MAX_ACTIVE_LEVELS,  Next: OMP_NESTED,  Prev: OMP_DYNAMIC,  Up: Environment Variables
   1227 
   1228 3.5 'OMP_MAX_ACTIVE_LEVELS' - Set the maximum number of nested parallel regions
   1229 ===============================================================================
   1230 
   1231 _Description_:
   1232      Specifies the initial value for the maximum number of nested
   1233      parallel regions.  The value of this variable shall be a positive
   1234      integer.  If undefined, the number of active levels is unlimited.
   1235 
   1236 _See also_:
   1237      *note omp_set_max_active_levels::
   1238 
   1239 _Reference_:
   1240      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.9
   1241 
   1242 
   1243 File: libgomp.info,  Node: OMP_NESTED,  Next: OMP_NUM_THREADS,  Prev: OMP_MAX_ACTIVE_LEVELS,  Up: Environment Variables
   1244 
   1245 3.6 'OMP_NESTED' - Nested parallel regions
   1246 ==========================================
   1247 
   1248 _Description_:
   1249      Enable or disable nested parallel regions, i.e., whether team
   1250      members are allowed to create new teams.  The value of this
   1251      environment variable shall be 'TRUE' or 'FALSE'.  If undefined,
   1252      nested parallel regions are disabled by default.
   1253 
   1254 _See also_:
   1255      *note omp_set_nested::
   1256 
   1257 _Reference_:
   1258      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.6
   1259 
   1260 
   1261 File: libgomp.info,  Node: OMP_NUM_THREADS,  Next: OMP_PROC_BIND,  Prev: OMP_NESTED,  Up: Environment Variables
   1262 
   1263 3.7 'OMP_NUM_THREADS' - Specifies the number of threads to use
   1264 ==============================================================
   1265 
   1266 _Description_:
   1267      Specifies the default number of threads to use in parallel regions.
   1268      The value of this variable shall be a comma-separated list of
   1269      positive integers; the value specified the number of threads to use
   1270      for the corresponding nested level.  If undefined one thread per
   1271      CPU is used.
   1272 
   1273 _See also_:
   1274      *note omp_set_num_threads::
   1275 
   1276 _Reference_:
   1277      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.2
   1278 
   1279 
   1280 File: libgomp.info,  Node: OMP_PROC_BIND,  Next: OMP_PLACES,  Prev: OMP_NUM_THREADS,  Up: Environment Variables
   1281 
   1282 3.8 'OMP_PROC_BIND' - Whether theads may be moved between CPUs
   1283 ==============================================================
   1284 
   1285 _Description_:
   1286      Specifies whether threads may be moved between processors.  If set
   1287      to 'TRUE', OpenMP theads should not be moved; if set to 'FALSE'
   1288      they may be moved.  Alternatively, a comma separated list with the
   1289      values 'MASTER', 'CLOSE' and 'SPREAD' can be used to specify the
   1290      thread affinity policy for the corresponding nesting level.  With
   1291      'MASTER' the worker threads are in the same place partition as the
   1292      master thread.  With 'CLOSE' those are kept close to the master
   1293      thread in contiguous place partitions.  And with 'SPREAD' a sparse
   1294      distribution across the place partitions is used.
   1295 
   1296      When undefined, 'OMP_PROC_BIND' defaults to 'TRUE' when
   1297      'OMP_PLACES' or 'GOMP_CPU_AFFINITY' is set and 'FALSE' otherwise.
   1298 
   1299 _See also_:
   1300      *note OMP_PLACES::, *note GOMP_CPU_AFFINITY::, *note
   1301      omp_get_proc_bind::
   1302 
   1303 _Reference_:
   1304      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.4
   1305 
   1306 
   1307 File: libgomp.info,  Node: OMP_PLACES,  Next: OMP_STACKSIZE,  Prev: OMP_PROC_BIND,  Up: Environment Variables
   1308 
   1309 3.9 'OMP_PLACES' - Specifies on which CPUs the theads should be placed
   1310 ======================================================================
   1311 
   1312 _Description_:
   1313      The thread placement can be either specified using an abstract name
   1314      or by an explicit list of the places.  The abstract names
   1315      'threads', 'cores' and 'sockets' can be optionally followed by a
   1316      positive number in parentheses, which denotes the how many places
   1317      shall be created.  With 'threads' each place corresponds to a
   1318      single hardware thread; 'cores' to a single core with the
   1319      corresponding number of hardware threads; and with 'sockets' the
   1320      place corresponds to a single socket.  The resulting placement can
   1321      be shown by setting the 'OMP_DISPLAY_ENV' environment variable.
   1322 
   1323      Alternatively, the placement can be specified explicitly as
   1324      comma-separated list of places.  A place is specified by set of
   1325      nonnegative numbers in curly braces, denoting the denoting the
   1326      hardware threads.  The hardware threads belonging to a place can
   1327      either be specified as comma-separated list of nonnegative thread
   1328      numbers or using an interval.  Multiple places can also be either
   1329      specified by a comma-separated list of places or by an interval.
   1330      To specify an interval, a colon followed by the count is placed
   1331      after after the hardware thread number or the place.  Optionally,
   1332      the length can be followed by a colon and the stride number -
   1333      otherwise a unit stride is assumed.  For instance, the following
   1334      specifies the same places list: '"{0,1,2}, {3,4,6}, {7,8,9},
   1335      {10,11,12}"'; '"{0:3}, {3:3}, {7:3}, {10:3}"'; and '"{0:2}:4:3"'.
   1336 
   1337      If 'OMP_PLACES' and 'GOMP_CPU_AFFINITY' are unset and
   1338      'OMP_PROC_BIND' is either unset or 'false', threads may be moved
   1339      between CPUs following no placement policy.
   1340 
   1341 _See also_:
   1342      *note OMP_PROC_BIND::, *note GOMP_CPU_AFFINITY::, *note
   1343      omp_get_proc_bind::, *note OMP_DISPLAY_ENV::
   1344 
   1345 _Reference_:
   1346      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.5
   1347 
   1348 
   1349 File: libgomp.info,  Node: OMP_STACKSIZE,  Next: OMP_SCHEDULE,  Prev: OMP_PLACES,  Up: Environment Variables
   1350 
   1351 3.10 'OMP_STACKSIZE' - Set default thread stack size
   1352 ====================================================
   1353 
   1354 _Description_:
   1355      Set the default thread stack size in kilobytes, unless the number
   1356      is suffixed by 'B', 'K', 'M' or 'G', in which case the size is,
   1357      respectively, in bytes, kilobytes, megabytes or gigabytes.  This is
   1358      different from 'pthread_attr_setstacksize' which gets the number of
   1359      bytes as an argument.  If the stack size cannot be set due to
   1360      system constraints, an error is reported and the initial stack size
   1361      is left unchanged.  If undefined, the stack size is system
   1362      dependent.
   1363 
   1364 _Reference_:
   1365      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.7
   1366 
   1367 
   1368 File: libgomp.info,  Node: OMP_SCHEDULE,  Next: OMP_THREAD_LIMIT,  Prev: OMP_STACKSIZE,  Up: Environment Variables
   1369 
   1370 3.11 'OMP_SCHEDULE' - How threads are scheduled
   1371 ===============================================
   1372 
   1373 _Description_:
   1374      Allows to specify 'schedule type' and 'chunk size'.  The value of
   1375      the variable shall have the form: 'type[,chunk]' where 'type' is
   1376      one of 'static', 'dynamic', 'guided' or 'auto' The optional 'chunk'
   1377      size shall be a positive integer.  If undefined, dynamic scheduling
   1378      and a chunk size of 1 is used.
   1379 
   1380 _See also_:
   1381      *note omp_set_schedule::
   1382 
   1383 _Reference_:
   1384      OpenMP specification v4.0 (http://www.openmp.org/), Sections 2.7.1
   1385      and 4.1
   1386 
   1387 
   1388 File: libgomp.info,  Node: OMP_THREAD_LIMIT,  Next: OMP_WAIT_POLICY,  Prev: OMP_SCHEDULE,  Up: Environment Variables
   1389 
   1390 3.12 'OMP_THREAD_LIMIT' - Set the maximum number of threads
   1391 ===========================================================
   1392 
   1393 _Description_:
   1394      Specifies the number of threads to use for the whole program.  The
   1395      value of this variable shall be a positive integer.  If undefined,
   1396      the number of threads is not limited.
   1397 
   1398 _See also_:
   1399      *note OMP_NUM_THREADS::, *note omp_get_thread_limit::
   1400 
   1401 _Reference_:
   1402      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.10
   1403 
   1404 
   1405 File: libgomp.info,  Node: OMP_WAIT_POLICY,  Next: GOMP_CPU_AFFINITY,  Prev: OMP_THREAD_LIMIT,  Up: Environment Variables
   1406 
   1407 3.13 'OMP_WAIT_POLICY' - How waiting threads are handled
   1408 ========================================================
   1409 
   1410 _Description_:
   1411      Specifies whether waiting threads should be active or passive.  If
   1412      the value is 'PASSIVE', waiting threads should not consume CPU
   1413      power while waiting; while the value is 'ACTIVE' specifies that
   1414      they should.  If undefined, threads wait actively for a short time
   1415      before waiting passively.
   1416 
   1417 _See also_:
   1418      *note GOMP_SPINCOUNT::
   1419 
   1420 _Reference_:
   1421      OpenMP specification v4.0 (http://www.openmp.org/), Section 4.8
   1422 
   1423 
   1424 File: libgomp.info,  Node: GOMP_CPU_AFFINITY,  Next: GOMP_DEBUG,  Prev: OMP_WAIT_POLICY,  Up: Environment Variables
   1425 
   1426 3.14 'GOMP_CPU_AFFINITY' - Bind threads to specific CPUs
   1427 ========================================================
   1428 
   1429 _Description_:
   1430      Binds threads to specific CPUs.  The variable should contain a
   1431      space-separated or comma-separated list of CPUs.  This list may
   1432      contain different kinds of entries: either single CPU numbers in
   1433      any order, a range of CPUs (M-N) or a range with some stride
   1434      (M-N:S). CPU numbers are zero based.  For example,
   1435      'GOMP_CPU_AFFINITY="0 3 1-2 4-15:2"' will bind the initial thread
   1436      to CPU 0, the second to CPU 3, the third to CPU 1, the fourth to
   1437      CPU 2, the fifth to CPU 4, the sixth through tenth to CPUs 6, 8,
   1438      10, 12, and 14 respectively and then start assigning back from the
   1439      beginning of the list.  'GOMP_CPU_AFFINITY=0' binds all threads to
   1440      CPU 0.
   1441 
   1442      There is no libgomp library routine to determine whether a CPU
   1443      affinity specification is in effect.  As a workaround,
   1444      language-specific library functions, e.g., 'getenv' in C or
   1445      'GET_ENVIRONMENT_VARIABLE' in Fortran, may be used to query the
   1446      setting of the 'GOMP_CPU_AFFINITY' environment variable.  A defined
   1447      CPU affinity on startup cannot be changed or disabled during the
   1448      runtime of the application.
   1449 
   1450      If both 'GOMP_CPU_AFFINITY' and 'OMP_PROC_BIND' are set,
   1451      'OMP_PROC_BIND' has a higher precedence.  If neither has been set
   1452      and 'OMP_PROC_BIND' is unset, or when 'OMP_PROC_BIND' is set to
   1453      'FALSE', the host system will handle the assignment of threads to
   1454      CPUs.
   1455 
   1456 _See also_:
   1457      *note OMP_PLACES::, *note OMP_PROC_BIND::
   1458 
   1459 
   1460 File: libgomp.info,  Node: GOMP_DEBUG,  Next: GOMP_STACKSIZE,  Prev: GOMP_CPU_AFFINITY,  Up: Environment Variables
   1461 
   1462 3.15 'GOMP_DEBUG' - Enable debugging output
   1463 ===========================================
   1464 
   1465 _Description_:
   1466      Enable debugging output.  The variable should be set to '0'
   1467      (disabled, also the default if not set), or '1' (enabled).
   1468 
   1469      If enabled, some debugging output will be printed during execution.
   1470      This is currently not specified in more detail, and subject to
   1471      change.
   1472 
   1473 
   1474 File: libgomp.info,  Node: GOMP_STACKSIZE,  Next: GOMP_SPINCOUNT,  Prev: GOMP_DEBUG,  Up: Environment Variables
   1475 
   1476 3.16 'GOMP_STACKSIZE' - Set default thread stack size
   1477 =====================================================
   1478 
   1479 _Description_:
   1480      Set the default thread stack size in kilobytes.  This is different
   1481      from 'pthread_attr_setstacksize' which gets the number of bytes as
   1482      an argument.  If the stack size cannot be set due to system
   1483      constraints, an error is reported and the initial stack size is
   1484      left unchanged.  If undefined, the stack size is system dependent.
   1485 
   1486 _See also_:
   1487      *note OMP_STACKSIZE::
   1488 
   1489 _Reference_:
   1490      GCC Patches Mailinglist
   1491      (http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00493.html), GCC
   1492      Patches Mailinglist
   1493      (http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00496.html)
   1494 
   1495 
   1496 File: libgomp.info,  Node: GOMP_SPINCOUNT,  Prev: GOMP_STACKSIZE,  Up: Environment Variables
   1497 
   1498 3.17 'GOMP_SPINCOUNT' - Set the busy-wait spin count
   1499 ====================================================
   1500 
   1501 _Description_:
   1502      Determines how long a threads waits actively with consuming CPU
   1503      power before waiting passively without consuming CPU power.  The
   1504      value may be either 'INFINITE', 'INFINITY' to always wait actively
   1505      or an integer which gives the number of spins of the busy-wait
   1506      loop.  The integer may optionally be followed by the following
   1507      suffixes acting as multiplication factors: 'k' (kilo, thousand),
   1508      'M' (mega, million), 'G' (giga, billion), or 'T' (tera, trillion).
   1509      If undefined, 0 is used when 'OMP_WAIT_POLICY' is 'PASSIVE',
   1510      300,000 is used when 'OMP_WAIT_POLICY' is undefined and 30 billion
   1511      is used when 'OMP_WAIT_POLICY' is 'ACTIVE'.  If there are more
   1512      OpenMP threads than available CPUs, 1000 and 100 spins are used for
   1513      'OMP_WAIT_POLICY' being 'ACTIVE' or undefined, respectively; unless
   1514      the 'GOMP_SPINCOUNT' is lower or 'OMP_WAIT_POLICY' is 'PASSIVE'.
   1515 
   1516 _See also_:
   1517      *note OMP_WAIT_POLICY::
   1518 
   1519 
   1520 File: libgomp.info,  Node: The libgomp ABI,  Next: Reporting Bugs,  Prev: Environment Variables,  Up: Top
   1521 
   1522 4 The libgomp ABI
   1523 *****************
   1524 
   1525 The following sections present notes on the external ABI as presented by
   1526 libgomp.  Only maintainers should need them.
   1527 
   1528 * Menu:
   1529 
   1530 * Implementing MASTER construct::
   1531 * Implementing CRITICAL construct::
   1532 * Implementing ATOMIC construct::
   1533 * Implementing FLUSH construct::
   1534 * Implementing BARRIER construct::
   1535 * Implementing THREADPRIVATE construct::
   1536 * Implementing PRIVATE clause::
   1537 * Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses::
   1538 * Implementing REDUCTION clause::
   1539 * Implementing PARALLEL construct::
   1540 * Implementing FOR construct::
   1541 * Implementing ORDERED construct::
   1542 * Implementing SECTIONS construct::
   1543 * Implementing SINGLE construct::
   1544 
   1545 
   1546 File: libgomp.info,  Node: Implementing MASTER construct,  Next: Implementing CRITICAL construct,  Up: The libgomp ABI
   1547 
   1548 4.1 Implementing MASTER construct
   1549 =================================
   1550 
   1551      if (omp_get_thread_num () == 0)
   1552        block
   1553 
   1554    Alternately, we generate two copies of the parallel subfunction and
   1555 only include this in the version run by the master thread.  Surely this
   1556 is not worthwhile though...
   1557 
   1558 
   1559 File: libgomp.info,  Node: Implementing CRITICAL construct,  Next: Implementing ATOMIC construct,  Prev: Implementing MASTER construct,  Up: The libgomp ABI
   1560 
   1561 4.2 Implementing CRITICAL construct
   1562 ===================================
   1563 
   1564 Without a specified name,
   1565 
   1566        void GOMP_critical_start (void);
   1567        void GOMP_critical_end (void);
   1568 
   1569    so that we don't get COPY relocations from libgomp to the main
   1570 application.
   1571 
   1572    With a specified name, use omp_set_lock and omp_unset_lock with name
   1573 being transformed into a variable declared like
   1574 
   1575        omp_lock_t gomp_critical_user_<name> __attribute__((common))
   1576 
   1577    Ideally the ABI would specify that all zero is a valid unlocked
   1578 state, and so we wouldn't need to initialize this at startup.
   1579 
   1580 
   1581 File: libgomp.info,  Node: Implementing ATOMIC construct,  Next: Implementing FLUSH construct,  Prev: Implementing CRITICAL construct,  Up: The libgomp ABI
   1582 
   1583 4.3 Implementing ATOMIC construct
   1584 =================================
   1585 
   1586 The target should implement the '__sync' builtins.
   1587 
   1588    Failing that we could add
   1589 
   1590        void GOMP_atomic_enter (void)
   1591        void GOMP_atomic_exit (void)
   1592 
   1593    which reuses the regular lock code, but with yet another lock object
   1594 private to the library.
   1595 
   1596 
   1597 File: libgomp.info,  Node: Implementing FLUSH construct,  Next: Implementing BARRIER construct,  Prev: Implementing ATOMIC construct,  Up: The libgomp ABI
   1598 
   1599 4.4 Implementing FLUSH construct
   1600 ================================
   1601 
   1602 Expands to the '__sync_synchronize' builtin.
   1603 
   1604 
   1605 File: libgomp.info,  Node: Implementing BARRIER construct,  Next: Implementing THREADPRIVATE construct,  Prev: Implementing FLUSH construct,  Up: The libgomp ABI
   1606 
   1607 4.5 Implementing BARRIER construct
   1608 ==================================
   1609 
   1610        void GOMP_barrier (void)
   1611 
   1612 
   1613 File: libgomp.info,  Node: Implementing THREADPRIVATE construct,  Next: Implementing PRIVATE clause,  Prev: Implementing BARRIER construct,  Up: The libgomp ABI
   1614 
   1615 4.6 Implementing THREADPRIVATE construct
   1616 ========================================
   1617 
   1618 In _most_ cases we can map this directly to '__thread'.  Except that OMP
   1619 allows constructors for C++ objects.  We can either refuse to support
   1620 this (how often is it used?)  or we can implement something akin to
   1621 .ctors.
   1622 
   1623    Even more ideally, this ctor feature is handled by extensions to the
   1624 main pthreads library.  Failing that, we can have a set of entry points
   1625 to register ctor functions to be called.
   1626 
   1627 
   1628 File: libgomp.info,  Node: Implementing PRIVATE clause,  Next: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses,  Prev: Implementing THREADPRIVATE construct,  Up: The libgomp ABI
   1629 
   1630 4.7 Implementing PRIVATE clause
   1631 ===============================
   1632 
   1633 In association with a PARALLEL, or within the lexical extent of a
   1634 PARALLEL block, the variable becomes a local variable in the parallel
   1635 subfunction.
   1636 
   1637    In association with FOR or SECTIONS blocks, create a new automatic
   1638 variable within the current function.  This preserves the semantic of
   1639 new variable creation.
   1640 
   1641 
   1642 File: libgomp.info,  Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses,  Next: Implementing REDUCTION clause,  Prev: Implementing PRIVATE clause,  Up: The libgomp ABI
   1643 
   1644 4.8 Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses
   1645 ========================================================================
   1646 
   1647 This seems simple enough for PARALLEL blocks.  Create a private struct
   1648 for communicating between the parent and subfunction.  In the parent,
   1649 copy in values for scalar and "small" structs; copy in addresses for
   1650 others TREE_ADDRESSABLE types.  In the subfunction, copy the value into
   1651 the local variable.
   1652 
   1653    It is not clear what to do with bare FOR or SECTION blocks.  The only
   1654 thing I can figure is that we do something like:
   1655 
   1656      #pragma omp for firstprivate(x) lastprivate(y)
   1657      for (int i = 0; i < n; ++i)
   1658        body;
   1659 
   1660    which becomes
   1661 
   1662      {
   1663        int x = x, y;
   1664 
   1665        // for stuff
   1666 
   1667        if (i == n)
   1668          y = y;
   1669      }
   1670 
   1671    where the "x=x" and "y=y" assignments actually have different uids
   1672 for the two variables, i.e.  not something you could write directly in
   1673 C. Presumably this only makes sense if the "outer" x and y are global
   1674 variables.
   1675 
   1676    COPYPRIVATE would work the same way, except the structure broadcast
   1677 would have to happen via SINGLE machinery instead.
   1678 
   1679 
   1680 File: libgomp.info,  Node: Implementing REDUCTION clause,  Next: Implementing PARALLEL construct,  Prev: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses,  Up: The libgomp ABI
   1681 
   1682 4.9 Implementing REDUCTION clause
   1683 =================================
   1684 
   1685 The private struct mentioned in the previous section should have a
   1686 pointer to an array of the type of the variable, indexed by the thread's
   1687 TEAM_ID.  The thread stores its final value into the array, and after
   1688 the barrier, the master thread iterates over the array to collect the
   1689 values.
   1690 
   1691 
   1692 File: libgomp.info,  Node: Implementing PARALLEL construct,  Next: Implementing FOR construct,  Prev: Implementing REDUCTION clause,  Up: The libgomp ABI
   1693 
   1694 4.10 Implementing PARALLEL construct
   1695 ====================================
   1696 
   1697        #pragma omp parallel
   1698        {
   1699          body;
   1700        }
   1701 
   1702    becomes
   1703 
   1704        void subfunction (void *data)
   1705        {
   1706          use data;
   1707          body;
   1708        }
   1709 
   1710        setup data;
   1711        GOMP_parallel_start (subfunction, &data, num_threads);
   1712        subfunction (&data);
   1713        GOMP_parallel_end ();
   1714 
   1715        void GOMP_parallel_start (void (*fn)(void *), void *data, unsigned num_threads)
   1716 
   1717    The FN argument is the subfunction to be run in parallel.
   1718 
   1719    The DATA argument is a pointer to a structure used to communicate
   1720 data in and out of the subfunction, as discussed above with respect to
   1721 FIRSTPRIVATE et al.
   1722 
   1723    The NUM_THREADS argument is 1 if an IF clause is present and false,
   1724 or the value of the NUM_THREADS clause, if present, or 0.
   1725 
   1726    The function needs to create the appropriate number of threads and/or
   1727 launch them from the dock.  It needs to create the team structure and
   1728 assign team ids.
   1729 
   1730        void GOMP_parallel_end (void)
   1731 
   1732    Tears down the team and returns us to the previous
   1733 'omp_in_parallel()' state.
   1734 
   1735 
   1736 File: libgomp.info,  Node: Implementing FOR construct,  Next: Implementing ORDERED construct,  Prev: Implementing PARALLEL construct,  Up: The libgomp ABI
   1737 
   1738 4.11 Implementing FOR construct
   1739 ===============================
   1740 
   1741        #pragma omp parallel for
   1742        for (i = lb; i <= ub; i++)
   1743          body;
   1744 
   1745    becomes
   1746 
   1747        void subfunction (void *data)
   1748        {
   1749          long _s0, _e0;
   1750          while (GOMP_loop_static_next (&_s0, &_e0))
   1751          {
   1752            long _e1 = _e0, i;
   1753            for (i = _s0; i < _e1; i++)
   1754              body;
   1755          }
   1756          GOMP_loop_end_nowait ();
   1757        }
   1758 
   1759        GOMP_parallel_loop_static (subfunction, NULL, 0, lb, ub+1, 1, 0);
   1760        subfunction (NULL);
   1761        GOMP_parallel_end ();
   1762 
   1763        #pragma omp for schedule(runtime)
   1764        for (i = 0; i < n; i++)
   1765          body;
   1766 
   1767    becomes
   1768 
   1769        {
   1770          long i, _s0, _e0;
   1771          if (GOMP_loop_runtime_start (0, n, 1, &_s0, &_e0))
   1772            do {
   1773              long _e1 = _e0;
   1774              for (i = _s0, i < _e0; i++)
   1775                body;
   1776            } while (GOMP_loop_runtime_next (&_s0, _&e0));
   1777          GOMP_loop_end ();
   1778        }
   1779 
   1780    Note that while it looks like there is trickiness to propagating a
   1781 non-constant STEP, there isn't really.  We're explicitly allowed to
   1782 evaluate it as many times as we want, and any variables involved should
   1783 automatically be handled as PRIVATE or SHARED like any other variables.
   1784 So the expression should remain evaluable in the subfunction.  We can
   1785 also pull it into a local variable if we like, but since its supposed to
   1786 remain unchanged, we can also not if we like.
   1787 
   1788    If we have SCHEDULE(STATIC), and no ORDERED, then we ought to be able
   1789 to get away with no work-sharing context at all, since we can simply
   1790 perform the arithmetic directly in each thread to divide up the
   1791 iterations.  Which would mean that we wouldn't need to call any of these
   1792 routines.
   1793 
   1794    There are separate routines for handling loops with an ORDERED
   1795 clause.  Bookkeeping for that is non-trivial...
   1796 
   1797 
   1798 File: libgomp.info,  Node: Implementing ORDERED construct,  Next: Implementing SECTIONS construct,  Prev: Implementing FOR construct,  Up: The libgomp ABI
   1799 
   1800 4.12 Implementing ORDERED construct
   1801 ===================================
   1802 
   1803        void GOMP_ordered_start (void)
   1804        void GOMP_ordered_end (void)
   1805 
   1806 
   1807 File: libgomp.info,  Node: Implementing SECTIONS construct,  Next: Implementing SINGLE construct,  Prev: Implementing ORDERED construct,  Up: The libgomp ABI
   1808 
   1809 4.13 Implementing SECTIONS construct
   1810 ====================================
   1811 
   1812 A block as
   1813 
   1814        #pragma omp sections
   1815        {
   1816          #pragma omp section
   1817          stmt1;
   1818          #pragma omp section
   1819          stmt2;
   1820          #pragma omp section
   1821          stmt3;
   1822        }
   1823 
   1824    becomes
   1825 
   1826        for (i = GOMP_sections_start (3); i != 0; i = GOMP_sections_next ())
   1827          switch (i)
   1828            {
   1829            case 1:
   1830              stmt1;
   1831              break;
   1832            case 2:
   1833              stmt2;
   1834              break;
   1835            case 3:
   1836              stmt3;
   1837              break;
   1838            }
   1839        GOMP_barrier ();
   1840 
   1841 
   1842 File: libgomp.info,  Node: Implementing SINGLE construct,  Prev: Implementing SECTIONS construct,  Up: The libgomp ABI
   1843 
   1844 4.14 Implementing SINGLE construct
   1845 ==================================
   1846 
   1847 A block like
   1848 
   1849        #pragma omp single
   1850        {
   1851          body;
   1852        }
   1853 
   1854    becomes
   1855 
   1856        if (GOMP_single_start ())
   1857          body;
   1858        GOMP_barrier ();
   1859 
   1860    while
   1861 
   1862        #pragma omp single copyprivate(x)
   1863          body;
   1864 
   1865    becomes
   1866 
   1867        datap = GOMP_single_copy_start ();
   1868        if (datap == NULL)
   1869          {
   1870            body;
   1871            data.x = x;
   1872            GOMP_single_copy_end (&data);
   1873          }
   1874        else
   1875          x = datap->x;
   1876        GOMP_barrier ();
   1877 
   1878 
   1879 File: libgomp.info,  Node: Reporting Bugs,  Next: Copying,  Prev: The libgomp ABI,  Up: Top
   1880 
   1881 5 Reporting Bugs
   1882 ****************
   1883 
   1884 Bugs in the GNU Offloading and Multi Processing Runtime Library should
   1885 be reported via Bugzilla (http://gcc.gnu.org/bugzilla/).  Please add
   1886 "openacc", or "openmp", or both to the keywords field in the bug report,
   1887 as appropriate.
   1888 
   1889 
   1890 File: libgomp.info,  Node: Copying,  Next: GNU Free Documentation License,  Prev: Reporting Bugs,  Up: Top
   1891 
   1892 GNU General Public License
   1893 **************************
   1894 
   1895                         Version 3, 29 June 2007
   1896 
   1897      Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
   1898 
   1899      Everyone is permitted to copy and distribute verbatim copies of this
   1900      license document, but changing it is not allowed.
   1901 
   1902 Preamble
   1903 ========
   1904 
   1905 The GNU General Public License is a free, copyleft license for software
   1906 and other kinds of works.
   1907 
   1908    The licenses for most software and other practical works are designed
   1909 to take away your freedom to share and change the works.  By contrast,
   1910 the GNU General Public License is intended to guarantee your freedom to
   1911 share and change all versions of a program-to make sure it remains free
   1912 software for all its users.  We, the Free Software Foundation, use the
   1913 GNU General Public License for most of our software; it applies also to
   1914 any other work released this way by its authors.  You can apply it to
   1915 your programs, too.
   1916 
   1917    When we speak of free software, we are referring to freedom, not
   1918 price.  Our General Public Licenses are designed to make sure that you
   1919 have the freedom to distribute copies of free software (and charge for
   1920 them if you wish), that you receive source code or can get it if you
   1921 want it, that you can change the software or use pieces of it in new
   1922 free programs, and that you know you can do these things.
   1923 
   1924    To protect your rights, we need to prevent others from denying you
   1925 these rights or asking you to surrender the rights.  Therefore, you have
   1926 certain responsibilities if you distribute copies of the software, or if
   1927 you modify it: responsibilities to respect the freedom of others.
   1928 
   1929    For example, if you distribute copies of such a program, whether
   1930 gratis or for a fee, you must pass on to the recipients the same
   1931 freedoms that you received.  You must make sure that they, too, receive
   1932 or can get the source code.  And you must show them these terms so they
   1933 know their rights.
   1934 
   1935    Developers that use the GNU GPL protect your rights with two steps:
   1936 (1) assert copyright on the software, and (2) offer you this License
   1937 giving you legal permission to copy, distribute and/or modify it.
   1938 
   1939    For the developers' and authors' protection, the GPL clearly explains
   1940 that there is no warranty for this free software.  For both users' and
   1941 authors' sake, the GPL requires that modified versions be marked as
   1942 changed, so that their problems will not be attributed erroneously to
   1943 authors of previous versions.
   1944 
   1945    Some devices are designed to deny users access to install or run
   1946 modified versions of the software inside them, although the manufacturer
   1947 can do so.  This is fundamentally incompatible with the aim of
   1948 protecting users' freedom to change the software.  The systematic
   1949 pattern of such abuse occurs in the area of products for individuals to
   1950 use, which is precisely where it is most unacceptable.  Therefore, we
   1951 have designed this version of the GPL to prohibit the practice for those
   1952 products.  If such problems arise substantially in other domains, we
   1953 stand ready to extend this provision to those domains in future versions
   1954 of the GPL, as needed to protect the freedom of users.
   1955 
   1956    Finally, every program is threatened constantly by software patents.
   1957 States should not allow patents to restrict development and use of
   1958 software on general-purpose computers, but in those that do, we wish to
   1959 avoid the special danger that patents applied to a free program could
   1960 make it effectively proprietary.  To prevent this, the GPL assures that
   1961 patents cannot be used to render the program non-free.
   1962 
   1963    The precise terms and conditions for copying, distribution and
   1964 modification follow.
   1965 
   1966 TERMS AND CONDITIONS
   1967 ====================
   1968 
   1969   0. Definitions.
   1970 
   1971      "This License" refers to version 3 of the GNU General Public
   1972      License.
   1973 
   1974      "Copyright" also means copyright-like laws that apply to other
   1975      kinds of works, such as semiconductor masks.
   1976 
   1977      "The Program" refers to any copyrightable work licensed under this
   1978      License.  Each licensee is addressed as "you".  "Licensees" and
   1979      "recipients" may be individuals or organizations.
   1980 
   1981      To "modify" a work means to copy from or adapt all or part of the
   1982      work in a fashion requiring copyright permission, other than the
   1983      making of an exact copy.  The resulting work is called a "modified
   1984      version" of the earlier work or a work "based on" the earlier work.
   1985 
   1986      A "covered work" means either the unmodified Program or a work
   1987      based on the Program.
   1988 
   1989      To "propagate" a work means to do anything with it that, without
   1990      permission, would make you directly or secondarily liable for
   1991      infringement under applicable copyright law, except executing it on
   1992      a computer or modifying a private copy.  Propagation includes
   1993      copying, distribution (with or without modification), making
   1994      available to the public, and in some countries other activities as
   1995      well.
   1996 
   1997      To "convey" a work means any kind of propagation that enables other
   1998      parties to make or receive copies.  Mere interaction with a user
   1999      through a computer network, with no transfer of a copy, is not
   2000      conveying.
   2001 
   2002      An interactive user interface displays "Appropriate Legal Notices"
   2003      to the extent that it includes a convenient and prominently visible
   2004      feature that (1) displays an appropriate copyright notice, and (2)
   2005      tells the user that there is no warranty for the work (except to
   2006      the extent that warranties are provided), that licensees may convey
   2007      the work under this License, and how to view a copy of this
   2008      License.  If the interface presents a list of user commands or
   2009      options, such as a menu, a prominent item in the list meets this
   2010      criterion.
   2011 
   2012   1. Source Code.
   2013 
   2014      The "source code" for a work means the preferred form of the work
   2015      for making modifications to it.  "Object code" means any non-source
   2016      form of a work.
   2017 
   2018      A "Standard Interface" means an interface that either is an
   2019      official standard defined by a recognized standards body, or, in
   2020      the case of interfaces specified for a particular programming
   2021      language, one that is widely used among developers working in that
   2022      language.
   2023 
   2024      The "System Libraries" of an executable work include anything,
   2025      other than the work as a whole, that (a) is included in the normal
   2026      form of packaging a Major Component, but which is not part of that
   2027      Major Component, and (b) serves only to enable use of the work with
   2028      that Major Component, or to implement a Standard Interface for
   2029      which an implementation is available to the public in source code
   2030      form.  A "Major Component", in this context, means a major
   2031      essential component (kernel, window system, and so on) of the
   2032      specific operating system (if any) on which the executable work
   2033      runs, or a compiler used to produce the work, or an object code
   2034      interpreter used to run it.
   2035 
   2036      The "Corresponding Source" for a work in object code form means all
   2037      the source code needed to generate, install, and (for an executable
   2038      work) run the object code and to modify the work, including scripts
   2039      to control those activities.  However, it does not include the
   2040      work's System Libraries, or general-purpose tools or generally
   2041      available free programs which are used unmodified in performing
   2042      those activities but which are not part of the work.  For example,
   2043      Corresponding Source includes interface definition files associated
   2044      with source files for the work, and the source code for shared
   2045      libraries and dynamically linked subprograms that the work is
   2046      specifically designed to require, such as by intimate data
   2047      communication or control flow between those subprograms and other
   2048      parts of the work.
   2049 
   2050      The Corresponding Source need not include anything that users can
   2051      regenerate automatically from other parts of the Corresponding
   2052      Source.
   2053 
   2054      The Corresponding Source for a work in source code form is that
   2055      same work.
   2056 
   2057   2. Basic Permissions.
   2058 
   2059      All rights granted under this License are granted for the term of
   2060      copyright on the Program, and are irrevocable provided the stated
   2061      conditions are met.  This License explicitly affirms your unlimited
   2062      permission to run the unmodified Program.  The output from running
   2063      a covered work is covered by this License only if the output, given
   2064      its content, constitutes a covered work.  This License acknowledges
   2065      your rights of fair use or other equivalent, as provided by
   2066      copyright law.
   2067 
   2068      You may make, run and propagate covered works that you do not
   2069      convey, without conditions so long as your license otherwise
   2070      remains in force.  You may convey covered works to others for the
   2071      sole purpose of having them make modifications exclusively for you,
   2072      or provide you with facilities for running those works, provided
   2073      that you comply with the terms of this License in conveying all
   2074      material for which you do not control copyright.  Those thus making
   2075      or running the covered works for you must do so exclusively on your
   2076      behalf, under your direction and control, on terms that prohibit
   2077      them from making any copies of your copyrighted material outside
   2078      their relationship with you.
   2079 
   2080      Conveying under any other circumstances is permitted solely under
   2081      the conditions stated below.  Sublicensing is not allowed; section
   2082      10 makes it unnecessary.
   2083 
   2084   3. Protecting Users' Legal Rights From Anti-Circumvention Law.
   2085 
   2086      No covered work shall be deemed part of an effective technological
   2087      measure under any applicable law fulfilling obligations under
   2088      article 11 of the WIPO copyright treaty adopted on 20 December
   2089      1996, or similar laws prohibiting or restricting circumvention of
   2090      such measures.
   2091 
   2092      When you convey a covered work, you waive any legal power to forbid
   2093      circumvention of technological measures to the extent such
   2094      circumvention is effected by exercising rights under this License
   2095      with respect to the covered work, and you disclaim any intention to
   2096      limit operation or modification of the work as a means of
   2097      enforcing, against the work's users, your or third parties' legal
   2098      rights to forbid circumvention of technological measures.
   2099 
   2100   4. Conveying Verbatim Copies.
   2101 
   2102      You may convey verbatim copies of the Program's source code as you
   2103      receive it, in any medium, provided that you conspicuously and
   2104      appropriately publish on each copy an appropriate copyright notice;
   2105      keep intact all notices stating that this License and any
   2106      non-permissive terms added in accord with section 7 apply to the
   2107      code; keep intact all notices of the absence of any warranty; and
   2108      give all recipients a copy of this License along with the Program.
   2109 
   2110      You may charge any price or no price for each copy that you convey,
   2111      and you may offer support or warranty protection for a fee.
   2112 
   2113   5. Conveying Modified Source Versions.
   2114 
   2115      You may convey a work based on the Program, or the modifications to
   2116      produce it from the Program, in the form of source code under the
   2117      terms of section 4, provided that you also meet all of these
   2118      conditions:
   2119 
   2120        a. The work must carry prominent notices stating that you
   2121           modified it, and giving a relevant date.
   2122 
   2123        b. The work must carry prominent notices stating that it is
   2124           released under this License and any conditions added under
   2125           section 7.  This requirement modifies the requirement in
   2126           section 4 to "keep intact all notices".
   2127 
   2128        c. You must license the entire work, as a whole, under this
   2129           License to anyone who comes into possession of a copy.  This
   2130           License will therefore apply, along with any applicable
   2131           section 7 additional terms, to the whole of the work, and all
   2132           its parts, regardless of how they are packaged.  This License
   2133           gives no permission to license the work in any other way, but
   2134           it does not invalidate such permission if you have separately
   2135           received it.
   2136 
   2137        d. If the work has interactive user interfaces, each must display
   2138           Appropriate Legal Notices; however, if the Program has
   2139           interactive interfaces that do not display Appropriate Legal
   2140           Notices, your work need not make them do so.
   2141 
   2142      A compilation of a covered work with other separate and independent
   2143      works, which are not by their nature extensions of the covered
   2144      work, and which are not combined with it such as to form a larger
   2145      program, in or on a volume of a storage or distribution medium, is
   2146      called an "aggregate" if the compilation and its resulting
   2147      copyright are not used to limit the access or legal rights of the
   2148      compilation's users beyond what the individual works permit.
   2149      Inclusion of a covered work in an aggregate does not cause this
   2150      License to apply to the other parts of the aggregate.
   2151 
   2152   6. Conveying Non-Source Forms.
   2153 
   2154      You may convey a covered work in object code form under the terms
   2155      of sections 4 and 5, provided that you also convey the
   2156      machine-readable Corresponding Source under the terms of this
   2157      License, in one of these ways:
   2158 
   2159        a. Convey the object code in, or embodied in, a physical product
   2160           (including a physical distribution medium), accompanied by the
   2161           Corresponding Source fixed on a durable physical medium
   2162           customarily used for software interchange.
   2163 
   2164        b. Convey the object code in, or embodied in, a physical product
   2165           (including a physical distribution medium), accompanied by a
   2166           written offer, valid for at least three years and valid for as
   2167           long as you offer spare parts or customer support for that
   2168           product model, to give anyone who possesses the object code
   2169           either (1) a copy of the Corresponding Source for all the
   2170           software in the product that is covered by this License, on a
   2171           durable physical medium customarily used for software
   2172           interchange, for a price no more than your reasonable cost of
   2173           physically performing this conveying of source, or (2) access
   2174           to copy the Corresponding Source from a network server at no
   2175           charge.
   2176 
   2177        c. Convey individual copies of the object code with a copy of the
   2178           written offer to provide the Corresponding Source.  This
   2179           alternative is allowed only occasionally and noncommercially,
   2180           and only if you received the object code with such an offer,
   2181           in accord with subsection 6b.
   2182 
   2183        d. Convey the object code by offering access from a designated
   2184           place (gratis or for a charge), and offer equivalent access to
   2185           the Corresponding Source in the same way through the same
   2186           place at no further charge.  You need not require recipients
   2187           to copy the Corresponding Source along with the object code.
   2188           If the place to copy the object code is a network server, the
   2189           Corresponding Source may be on a different server (operated by
   2190           you or a third party) that supports equivalent copying
   2191           facilities, provided you maintain clear directions next to the
   2192           object code saying where to find the Corresponding Source.
   2193           Regardless of what server hosts the Corresponding Source, you
   2194           remain obligated to ensure that it is available for as long as
   2195           needed to satisfy these requirements.
   2196 
   2197        e. Convey the object code using peer-to-peer transmission,
   2198           provided you inform other peers where the object code and
   2199           Corresponding Source of the work are being offered to the
   2200           general public at no charge under subsection 6d.
   2201 
   2202      A separable portion of the object code, whose source code is
   2203      excluded from the Corresponding Source as a System Library, need
   2204      not be included in conveying the object code work.
   2205 
   2206      A "User Product" is either (1) a "consumer product", which means
   2207      any tangible personal property which is normally used for personal,
   2208      family, or household purposes, or (2) anything designed or sold for
   2209      incorporation into a dwelling.  In determining whether a product is
   2210      a consumer product, doubtful cases shall be resolved in favor of
   2211      coverage.  For a particular product received by a particular user,
   2212      "normally used" refers to a typical or common use of that class of
   2213      product, regardless of the status of the particular user or of the
   2214      way in which the particular user actually uses, or expects or is
   2215      expected to use, the product.  A product is a consumer product
   2216      regardless of whether the product has substantial commercial,
   2217      industrial or non-consumer uses, unless such uses represent the
   2218      only significant mode of use of the product.
   2219 
   2220      "Installation Information" for a User Product means any methods,
   2221      procedures, authorization keys, or other information required to
   2222      install and execute modified versions of a covered work in that
   2223      User Product from a modified version of its Corresponding Source.
   2224      The information must suffice to ensure that the continued
   2225      functioning of the modified object code is in no case prevented or
   2226      interfered with solely because modification has been made.
   2227 
   2228      If you convey an object code work under this section in, or with,
   2229      or specifically for use in, a User Product, and the conveying
   2230      occurs as part of a transaction in which the right of possession
   2231      and use of the User Product is transferred to the recipient in
   2232      perpetuity or for a fixed term (regardless of how the transaction
   2233      is characterized), the Corresponding Source conveyed under this
   2234      section must be accompanied by the Installation Information.  But
   2235      this requirement does not apply if neither you nor any third party
   2236      retains the ability to install modified object code on the User
   2237      Product (for example, the work has been installed in ROM).
   2238 
   2239      The requirement to provide Installation Information does not
   2240      include a requirement to continue to provide support service,
   2241      warranty, or updates for a work that has been modified or installed
   2242      by the recipient, or for the User Product in which it has been
   2243      modified or installed.  Access to a network may be denied when the
   2244      modification itself materially and adversely affects the operation
   2245      of the network or violates the rules and protocols for
   2246      communication across the network.
   2247 
   2248      Corresponding Source conveyed, and Installation Information
   2249      provided, in accord with this section must be in a format that is
   2250      publicly documented (and with an implementation available to the
   2251      public in source code form), and must require no special password
   2252      or key for unpacking, reading or copying.
   2253 
   2254   7. Additional Terms.
   2255 
   2256      "Additional permissions" are terms that supplement the terms of
   2257      this License by making exceptions from one or more of its
   2258      conditions.  Additional permissions that are applicable to the
   2259      entire Program shall be treated as though they were included in
   2260      this License, to the extent that they are valid under applicable
   2261      law.  If additional permissions apply only to part of the Program,
   2262      that part may be used separately under those permissions, but the
   2263      entire Program remains governed by this License without regard to
   2264      the additional permissions.
   2265 
   2266      When you convey a copy of a covered work, you may at your option
   2267      remove any additional permissions from that copy, or from any part
   2268      of it.  (Additional permissions may be written to require their own
   2269      removal in certain cases when you modify the work.)  You may place
   2270      additional permissions on material, added by you to a covered work,
   2271      for which you have or can give appropriate copyright permission.
   2272 
   2273      Notwithstanding any other provision of this License, for material
   2274      you add to a covered work, you may (if authorized by the copyright
   2275      holders of that material) supplement the terms of this License with
   2276      terms:
   2277 
   2278        a. Disclaiming warranty or limiting liability differently from
   2279           the terms of sections 15 and 16 of this License; or
   2280 
   2281        b. Requiring preservation of specified reasonable legal notices
   2282           or author attributions in that material or in the Appropriate
   2283           Legal Notices displayed by works containing it; or
   2284 
   2285        c. Prohibiting misrepresentation of the origin of that material,
   2286           or requiring that modified versions of such material be marked
   2287           in reasonable ways as different from the original version; or
   2288 
   2289        d. Limiting the use for publicity purposes of names of licensors
   2290           or authors of the material; or
   2291 
   2292        e. Declining to grant rights under trademark law for use of some
   2293           trade names, trademarks, or service marks; or
   2294 
   2295        f. Requiring indemnification of licensors and authors of that
   2296           material by anyone who conveys the material (or modified
   2297           versions of it) with contractual assumptions of liability to
   2298           the recipient, for any liability that these contractual
   2299           assumptions directly impose on those licensors and authors.
   2300 
   2301      All other non-permissive additional terms are considered "further
   2302      restrictions" within the meaning of section 10.  If the Program as
   2303      you received it, or any part of it, contains a notice stating that
   2304      it is governed by this License along with a term that is a further
   2305      restriction, you may remove that term.  If a license document
   2306      contains a further restriction but permits relicensing or conveying
   2307      under this License, you may add to a covered work material governed
   2308      by the terms of that license document, provided that the further
   2309      restriction does not survive such relicensing or conveying.
   2310 
   2311      If you add terms to a covered work in accord with this section, you
   2312      must place, in the relevant source files, a statement of the
   2313      additional terms that apply to those files, or a notice indicating
   2314      where to find the applicable terms.
   2315 
   2316      Additional terms, permissive or non-permissive, may be stated in
   2317      the form of a separately written license, or stated as exceptions;
   2318      the above requirements apply either way.
   2319 
   2320   8. Termination.
   2321 
   2322      You may not propagate or modify a covered work except as expressly
   2323      provided under this License.  Any attempt otherwise to propagate or
   2324      modify it is void, and will automatically terminate your rights
   2325      under this License (including any patent licenses granted under the
   2326      third paragraph of section 11).
   2327 
   2328      However, if you cease all violation of this License, then your
   2329      license from a particular copyright holder is reinstated (a)
   2330      provisionally, unless and until the copyright holder explicitly and
   2331      finally terminates your license, and (b) permanently, if the
   2332      copyright holder fails to notify you of the violation by some
   2333      reasonable means prior to 60 days after the cessation.
   2334 
   2335      Moreover, your license from a particular copyright holder is
   2336      reinstated permanently if the copyright holder notifies you of the
   2337      violation by some reasonable means, this is the first time you have
   2338      received notice of violation of this License (for any work) from
   2339      that copyright holder, and you cure the violation prior to 30 days
   2340      after your receipt of the notice.
   2341 
   2342      Termination of your rights under this section does not terminate
   2343      the licenses of parties who have received copies or rights from you
   2344      under this License.  If your rights have been terminated and not
   2345      permanently reinstated, you do not qualify to receive new licenses
   2346      for the same material under section 10.
   2347 
   2348   9. Acceptance Not Required for Having Copies.
   2349 
   2350      You are not required to accept this License in order to receive or
   2351      run a copy of the Program.  Ancillary propagation of a covered work
   2352      occurring solely as a consequence of using peer-to-peer
   2353      transmission to receive a copy likewise does not require
   2354      acceptance.  However, nothing other than this License grants you
   2355      permission to propagate or modify any covered work.  These actions
   2356      infringe copyright if you do not accept this License.  Therefore,
   2357      by modifying or propagating a covered work, you indicate your
   2358      acceptance of this License to do so.
   2359 
   2360   10. Automatic Licensing of Downstream Recipients.
   2361 
   2362      Each time you convey a covered work, the recipient automatically
   2363      receives a license from the original licensors, to run, modify and
   2364      propagate that work, subject to this License.  You are not
   2365      responsible for enforcing compliance by third parties with this
   2366      License.
   2367 
   2368      An "entity transaction" is a transaction transferring control of an
   2369      organization, or substantially all assets of one, or subdividing an
   2370      organization, or merging organizations.  If propagation of a
   2371      covered work results from an entity transaction, each party to that
   2372      transaction who receives a copy of the work also receives whatever
   2373      licenses to the work the party's predecessor in interest had or
   2374      could give under the previous paragraph, plus a right to possession
   2375      of the Corresponding Source of the work from the predecessor in
   2376      interest, if the predecessor has it or can get it with reasonable
   2377      efforts.
   2378 
   2379      You may not impose any further restrictions on the exercise of the
   2380      rights granted or affirmed under this License.  For example, you
   2381      may not impose a license fee, royalty, or other charge for exercise
   2382      of rights granted under this License, and you may not initiate
   2383      litigation (including a cross-claim or counterclaim in a lawsuit)
   2384      alleging that any patent claim is infringed by making, using,
   2385      selling, offering for sale, or importing the Program or any portion
   2386      of it.
   2387 
   2388   11. Patents.
   2389 
   2390      A "contributor" is a copyright holder who authorizes use under this
   2391      License of the Program or a work on which the Program is based.
   2392      The work thus licensed is called the contributor's "contributor
   2393      version".
   2394 
   2395      A contributor's "essential patent claims" are all patent claims
   2396      owned or controlled by the contributor, whether already acquired or
   2397      hereafter acquired, that would be infringed by some manner,
   2398      permitted by this License, of making, using, or selling its
   2399      contributor version, but do not include claims that would be
   2400      infringed only as a consequence of further modification of the
   2401      contributor version.  For purposes of this definition, "control"
   2402      includes the right to grant patent sublicenses in a manner
   2403      consistent with the requirements of this License.
   2404 
   2405      Each contributor grants you a non-exclusive, worldwide,
   2406      royalty-free patent license under the contributor's essential
   2407      patent claims, to make, use, sell, offer for sale, import and
   2408      otherwise run, modify and propagate the contents of its contributor
   2409      version.
   2410 
   2411      In the following three paragraphs, a "patent license" is any
   2412      express agreement or commitment, however denominated, not to
   2413      enforce a patent (such as an express permission to practice a
   2414      patent or covenant not to sue for patent infringement).  To "grant"
   2415      such a patent license to a party means to make such an agreement or
   2416      commitment not to enforce a patent against the party.
   2417 
   2418      If you convey a covered work, knowingly relying on a patent
   2419      license, and the Corresponding Source of the work is not available
   2420      for anyone to copy, free of charge and under the terms of this
   2421      License, through a publicly available network server or other
   2422      readily accessible means, then you must either (1) cause the
   2423      Corresponding Source to be so available, or (2) arrange to deprive
   2424      yourself of the benefit of the patent license for this particular
   2425      work, or (3) arrange, in a manner consistent with the requirements
   2426      of this License, to extend the patent license to downstream
   2427      recipients.  "Knowingly relying" means you have actual knowledge
   2428      that, but for the patent license, your conveying the covered work
   2429      in a country, or your recipient's use of the covered work in a
   2430      country, would infringe one or more identifiable patents in that
   2431      country that you have reason to believe are valid.
   2432 
   2433      If, pursuant to or in connection with a single transaction or
   2434      arrangement, you convey, or propagate by procuring conveyance of, a
   2435      covered work, and grant a patent license to some of the parties
   2436      receiving the covered work authorizing them to use, propagate,
   2437      modify or convey a specific copy of the covered work, then the
   2438      patent license you grant is automatically extended to all
   2439      recipients of the covered work and works based on it.
   2440 
   2441      A patent license is "discriminatory" if it does not include within
   2442      the scope of its coverage, prohibits the exercise of, or is
   2443      conditioned on the non-exercise of one or more of the rights that
   2444      are specifically granted under this License.  You may not convey a
   2445      covered work if you are a party to an arrangement with a third
   2446      party that is in the business of distributing software, under which
   2447      you make payment to the third party based on the extent of your
   2448      activity of conveying the work, and under which the third party
   2449      grants, to any of the parties who would receive the covered work
   2450      from you, a discriminatory patent license (a) in connection with
   2451      copies of the covered work conveyed by you (or copies made from
   2452      those copies), or (b) primarily for and in connection with specific
   2453      products or compilations that contain the covered work, unless you
   2454      entered into that arrangement, or that patent license was granted,
   2455      prior to 28 March 2007.
   2456 
   2457      Nothing in this License shall be construed as excluding or limiting
   2458      any implied license or other defenses to infringement that may
   2459      otherwise be available to you under applicable patent law.
   2460 
   2461   12. No Surrender of Others' Freedom.
   2462 
   2463      If conditions are imposed on you (whether by court order, agreement
   2464      or otherwise) that contradict the conditions of this License, they
   2465      do not excuse you from the conditions of this License.  If you
   2466      cannot convey a covered work so as to satisfy simultaneously your
   2467      obligations under this License and any other pertinent obligations,
   2468      then as a consequence you may not convey it at all.  For example,
   2469      if you agree to terms that obligate you to collect a royalty for
   2470      further conveying from those to whom you convey the Program, the
   2471      only way you could satisfy both those terms and this License would
   2472      be to refrain entirely from conveying the Program.
   2473 
   2474   13. Use with the GNU Affero General Public License.
   2475 
   2476      Notwithstanding any other provision of this License, you have
   2477      permission to link or combine any covered work with a work licensed
   2478      under version 3 of the GNU Affero General Public License into a
   2479      single combined work, and to convey the resulting work.  The terms
   2480      of this License will continue to apply to the part which is the
   2481      covered work, but the special requirements of the GNU Affero
   2482      General Public License, section 13, concerning interaction through
   2483      a network will apply to the combination as such.
   2484 
   2485   14. Revised Versions of this License.
   2486 
   2487      The Free Software Foundation may publish revised and/or new
   2488      versions of the GNU General Public License from time to time.  Such
   2489      new versions will be similar in spirit to the present version, but
   2490      may differ in detail to address new problems or concerns.
   2491 
   2492      Each version is given a distinguishing version number.  If the
   2493      Program specifies that a certain numbered version of the GNU
   2494      General Public License "or any later version" applies to it, you
   2495      have the option of following the terms and conditions either of
   2496      that numbered version or of any later version published by the Free
   2497      Software Foundation.  If the Program does not specify a version
   2498      number of the GNU General Public License, you may choose any
   2499      version ever published by the Free Software Foundation.
   2500 
   2501      If the Program specifies that a proxy can decide which future
   2502      versions of the GNU General Public License can be used, that
   2503      proxy's public statement of acceptance of a version permanently
   2504      authorizes you to choose that version for the Program.
   2505 
   2506      Later license versions may give you additional or different
   2507      permissions.  However, no additional obligations are imposed on any
   2508      author or copyright holder as a result of your choosing to follow a
   2509      later version.
   2510 
   2511   15. Disclaimer of Warranty.
   2512 
   2513      THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
   2514      APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
   2515      COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
   2516      WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
   2517      INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   2518      MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
   2519      RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
   2520      SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
   2521      NECESSARY SERVICING, REPAIR OR CORRECTION.
   2522 
   2523   16. Limitation of Liability.
   2524 
   2525      IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
   2526      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
   2527      AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
   2528      DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
   2529      CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
   2530      THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
   2531      BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
   2532      PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
   2533      PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
   2534      THE POSSIBILITY OF SUCH DAMAGES.
   2535 
   2536   17. Interpretation of Sections 15 and 16.
   2537 
   2538      If the disclaimer of warranty and limitation of liability provided
   2539      above cannot be given local legal effect according to their terms,
   2540      reviewing courts shall apply local law that most closely
   2541      approximates an absolute waiver of all civil liability in
   2542      connection with the Program, unless a warranty or assumption of
   2543      liability accompanies a copy of the Program in return for a fee.
   2544 
   2545 END OF TERMS AND CONDITIONS
   2546 ===========================
   2547 
   2548 How to Apply These Terms to Your New Programs
   2549 =============================================
   2550 
   2551 If you develop a new program, and you want it to be of the greatest
   2552 possible use to the public, the best way to achieve this is to make it
   2553 free software which everyone can redistribute and change under these
   2554 terms.
   2555 
   2556    To do so, attach the following notices to the program.  It is safest
   2557 to attach them to the start of each source file to most effectively
   2558 state the exclusion of warranty; and each file should have at least the
   2559 "copyright" line and a pointer to where the full notice is found.
   2560 
   2561      ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
   2562      Copyright (C) YEAR NAME OF AUTHOR
   2563 
   2564      This program is free software: you can redistribute it and/or modify
   2565      it under the terms of the GNU General Public License as published by
   2566      the Free Software Foundation, either version 3 of the License, or (at
   2567      your option) any later version.
   2568 
   2569      This program is distributed in the hope that it will be useful, but
   2570      WITHOUT ANY WARRANTY; without even the implied warranty of
   2571      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   2572      General Public License for more details.
   2573 
   2574      You should have received a copy of the GNU General Public License
   2575      along with this program.  If not, see <http://www.gnu.org/licenses/>.
   2576 
   2577    Also add information on how to contact you by electronic and paper
   2578 mail.
   2579 
   2580    If the program does terminal interaction, make it output a short
   2581 notice like this when it starts in an interactive mode:
   2582 
   2583      PROGRAM Copyright (C) YEAR NAME OF AUTHOR
   2584      This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
   2585      This is free software, and you are welcome to redistribute it
   2586      under certain conditions; type 'show c' for details.
   2587 
   2588    The hypothetical commands 'show w' and 'show c' should show the
   2589 appropriate parts of the General Public License.  Of course, your
   2590 program's commands might be different; for a GUI interface, you would
   2591 use an "about box".
   2592 
   2593    You should also get your employer (if you work as a programmer) or
   2594 school, if any, to sign a "copyright disclaimer" for the program, if
   2595 necessary.  For more information on this, and how to apply and follow
   2596 the GNU GPL, see <http://www.gnu.org/licenses/>.
   2597 
   2598    The GNU General Public License does not permit incorporating your
   2599 program into proprietary programs.  If your program is a subroutine
   2600 library, you may consider it more useful to permit linking proprietary
   2601 applications with the library.  If this is what you want to do, use the
   2602 GNU Lesser General Public License instead of this License.  But first,
   2603 please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
   2604 
   2605 
   2606 File: libgomp.info,  Node: GNU Free Documentation License,  Next: Funding,  Prev: Copying,  Up: Top
   2607 
   2608 GNU Free Documentation License
   2609 ******************************
   2610 
   2611                      Version 1.3, 3 November 2008
   2612 
   2613      Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
   2614      <http://fsf.org/>
   2615 
   2616      Everyone is permitted to copy and distribute verbatim copies
   2617      of this license document, but changing it is not allowed.
   2618 
   2619   0. PREAMBLE
   2620 
   2621      The purpose of this License is to make a manual, textbook, or other
   2622      functional and useful document "free" in the sense of freedom: to
   2623      assure everyone the effective freedom to copy and redistribute it,
   2624      with or without modifying it, either commercially or
   2625      noncommercially.  Secondarily, this License preserves for the
   2626      author and publisher a way to get credit for their work, while not
   2627      being considered responsible for modifications made by others.
   2628 
   2629      This License is a kind of "copyleft", which means that derivative
   2630      works of the document must themselves be free in the same sense.
   2631      It complements the GNU General Public License, which is a copyleft
   2632      license designed for free software.
   2633 
   2634      We have designed this License in order to use it for manuals for
   2635      free software, because free software needs free documentation: a
   2636      free program should come with manuals providing the same freedoms
   2637      that the software does.  But this License is not limited to
   2638      software manuals; it can be used for any textual work, regardless
   2639      of subject matter or whether it is published as a printed book.  We
   2640      recommend this License principally for works whose purpose is
   2641      instruction or reference.
   2642 
   2643   1. APPLICABILITY AND DEFINITIONS
   2644 
   2645      This License applies to any manual or other work, in any medium,
   2646      that contains a notice placed by the copyright holder saying it can
   2647      be distributed under the terms of this License.  Such a notice
   2648      grants a world-wide, royalty-free license, unlimited in duration,
   2649      to use that work under the conditions stated herein.  The
   2650      "Document", below, refers to any such manual or work.  Any member
   2651      of the public is a licensee, and is addressed as "you".  You accept
   2652      the license if you copy, modify or distribute the work in a way
   2653      requiring permission under copyright law.
   2654 
   2655      A "Modified Version" of the Document means any work containing the
   2656      Document or a portion of it, either copied verbatim, or with
   2657      modifications and/or translated into another language.
   2658 
   2659      A "Secondary Section" is a named appendix or a front-matter section
   2660      of the Document that deals exclusively with the relationship of the
   2661      publishers or authors of the Document to the Document's overall
   2662      subject (or to related matters) and contains nothing that could
   2663      fall directly within that overall subject.  (Thus, if the Document
   2664      is in part a textbook of mathematics, a Secondary Section may not
   2665      explain any mathematics.)  The relationship could be a matter of
   2666      historical connection with the subject or with related matters, or
   2667      of legal, commercial, philosophical, ethical or political position
   2668      regarding them.
   2669 
   2670      The "Invariant Sections" are certain Secondary Sections whose
   2671      titles are designated, as being those of Invariant Sections, in the
   2672      notice that says that the Document is released under this License.
   2673      If a section does not fit the above definition of Secondary then it
   2674      is not allowed to be designated as Invariant.  The Document may
   2675      contain zero Invariant Sections.  If the Document does not identify
   2676      any Invariant Sections then there are none.
   2677 
   2678      The "Cover Texts" are certain short passages of text that are
   2679      listed, as Front-Cover Texts or Back-Cover Texts, in the notice
   2680      that says that the Document is released under this License.  A
   2681      Front-Cover Text may be at most 5 words, and a Back-Cover Text may
   2682      be at most 25 words.
   2683 
   2684      A "Transparent" copy of the Document means a machine-readable copy,
   2685      represented in a format whose specification is available to the
   2686      general public, that is suitable for revising the document
   2687      straightforwardly with generic text editors or (for images composed
   2688      of pixels) generic paint programs or (for drawings) some widely
   2689      available drawing editor, and that is suitable for input to text
   2690      formatters or for automatic translation to a variety of formats
   2691      suitable for input to text formatters.  A copy made in an otherwise
   2692      Transparent file format whose markup, or absence of markup, has
   2693      been arranged to thwart or discourage subsequent modification by
   2694      readers is not Transparent.  An image format is not Transparent if
   2695      used for any substantial amount of text.  A copy that is not
   2696      "Transparent" is called "Opaque".
   2697 
   2698      Examples of suitable formats for Transparent copies include plain
   2699      ASCII without markup, Texinfo input format, LaTeX input format,
   2700      SGML or XML using a publicly available DTD, and standard-conforming
   2701      simple HTML, PostScript or PDF designed for human modification.
   2702      Examples of transparent image formats include PNG, XCF and JPG.
   2703      Opaque formats include proprietary formats that can be read and
   2704      edited only by proprietary word processors, SGML or XML for which
   2705      the DTD and/or processing tools are not generally available, and
   2706      the machine-generated HTML, PostScript or PDF produced by some word
   2707      processors for output purposes only.
   2708 
   2709      The "Title Page" means, for a printed book, the title page itself,
   2710      plus such following pages as are needed to hold, legibly, the
   2711      material this License requires to appear in the title page.  For
   2712      works in formats which do not have any title page as such, "Title
   2713      Page" means the text near the most prominent appearance of the
   2714      work's title, preceding the beginning of the body of the text.
   2715 
   2716      The "publisher" means any person or entity that distributes copies
   2717      of the Document to the public.
   2718 
   2719      A section "Entitled XYZ" means a named subunit of the Document
   2720      whose title either is precisely XYZ or contains XYZ in parentheses
   2721      following text that translates XYZ in another language.  (Here XYZ
   2722      stands for a specific section name mentioned below, such as
   2723      "Acknowledgements", "Dedications", "Endorsements", or "History".)
   2724      To "Preserve the Title" of such a section when you modify the
   2725      Document means that it remains a section "Entitled XYZ" according
   2726      to this definition.
   2727 
   2728      The Document may include Warranty Disclaimers next to the notice
   2729      which states that this License applies to the Document.  These
   2730      Warranty Disclaimers are considered to be included by reference in
   2731      this License, but only as regards disclaiming warranties: any other
   2732      implication that these Warranty Disclaimers may have is void and
   2733      has no effect on the meaning of this License.
   2734 
   2735   2. VERBATIM COPYING
   2736 
   2737      You may copy and distribute the Document in any medium, either
   2738      commercially or noncommercially, provided that this License, the
   2739      copyright notices, and the license notice saying this License
   2740      applies to the Document are reproduced in all copies, and that you
   2741      add no other conditions whatsoever to those of this License.  You
   2742      may not use technical measures to obstruct or control the reading
   2743      or further copying of the copies you make or distribute.  However,
   2744      you may accept compensation in exchange for copies.  If you
   2745      distribute a large enough number of copies you must also follow the
   2746      conditions in section 3.
   2747 
   2748      You may also lend copies, under the same conditions stated above,
   2749      and you may publicly display copies.
   2750 
   2751   3. COPYING IN QUANTITY
   2752 
   2753      If you publish printed copies (or copies in media that commonly
   2754      have printed covers) of the Document, numbering more than 100, and
   2755      the Document's license notice requires Cover Texts, you must
   2756      enclose the copies in covers that carry, clearly and legibly, all
   2757      these Cover Texts: Front-Cover Texts on the front cover, and
   2758      Back-Cover Texts on the back cover.  Both covers must also clearly
   2759      and legibly identify you as the publisher of these copies.  The
   2760      front cover must present the full title with all words of the title
   2761      equally prominent and visible.  You may add other material on the
   2762      covers in addition.  Copying with changes limited to the covers, as
   2763      long as they preserve the title of the Document and satisfy these
   2764      conditions, can be treated as verbatim copying in other respects.
   2765 
   2766      If the required texts for either cover are too voluminous to fit
   2767      legibly, you should put the first ones listed (as many as fit
   2768      reasonably) on the actual cover, and continue the rest onto
   2769      adjacent pages.
   2770 
   2771      If you publish or distribute Opaque copies of the Document
   2772      numbering more than 100, you must either include a machine-readable
   2773      Transparent copy along with each Opaque copy, or state in or with
   2774      each Opaque copy a computer-network location from which the general
   2775      network-using public has access to download using public-standard
   2776      network protocols a complete Transparent copy of the Document, free
   2777      of added material.  If you use the latter option, you must take
   2778      reasonably prudent steps, when you begin distribution of Opaque
   2779      copies in quantity, to ensure that this Transparent copy will
   2780      remain thus accessible at the stated location until at least one
   2781      year after the last time you distribute an Opaque copy (directly or
   2782      through your agents or retailers) of that edition to the public.
   2783 
   2784      It is requested, but not required, that you contact the authors of
   2785      the Document well before redistributing any large number of copies,
   2786      to give them a chance to provide you with an updated version of the
   2787      Document.
   2788 
   2789   4. MODIFICATIONS
   2790 
   2791      You may copy and distribute a Modified Version of the Document
   2792      under the conditions of sections 2 and 3 above, provided that you
   2793      release the Modified Version under precisely this License, with the
   2794      Modified Version filling the role of the Document, thus licensing
   2795      distribution and modification of the Modified Version to whoever
   2796      possesses a copy of it.  In addition, you must do these things in
   2797      the Modified Version:
   2798 
   2799        A. Use in the Title Page (and on the covers, if any) a title
   2800           distinct from that of the Document, and from those of previous
   2801           versions (which should, if there were any, be listed in the
   2802           History section of the Document).  You may use the same title
   2803           as a previous version if the original publisher of that
   2804           version gives permission.
   2805 
   2806        B. List on the Title Page, as authors, one or more persons or
   2807           entities responsible for authorship of the modifications in
   2808           the Modified Version, together with at least five of the
   2809           principal authors of the Document (all of its principal
   2810           authors, if it has fewer than five), unless they release you
   2811           from this requirement.
   2812 
   2813        C. State on the Title page the name of the publisher of the
   2814           Modified Version, as the publisher.
   2815 
   2816        D. Preserve all the copyright notices of the Document.
   2817 
   2818        E. Add an appropriate copyright notice for your modifications
   2819           adjacent to the other copyright notices.
   2820 
   2821        F. Include, immediately after the copyright notices, a license
   2822           notice giving the public permission to use the Modified
   2823           Version under the terms of this License, in the form shown in
   2824           the Addendum below.
   2825 
   2826        G. Preserve in that license notice the full lists of Invariant
   2827           Sections and required Cover Texts given in the Document's
   2828           license notice.
   2829 
   2830        H. Include an unaltered copy of this License.
   2831 
   2832        I. Preserve the section Entitled "History", Preserve its Title,
   2833           and add to it an item stating at least the title, year, new
   2834           authors, and publisher of the Modified Version as given on the
   2835           Title Page.  If there is no section Entitled "History" in the
   2836           Document, create one stating the title, year, authors, and
   2837           publisher of the Document as given on its Title Page, then add
   2838           an item describing the Modified Version as stated in the
   2839           previous sentence.
   2840 
   2841        J. Preserve the network location, if any, given in the Document
   2842           for public access to a Transparent copy of the Document, and
   2843           likewise the network locations given in the Document for
   2844           previous versions it was based on.  These may be placed in the
   2845           "History" section.  You may omit a network location for a work
   2846           that was published at least four years before the Document
   2847           itself, or if the original publisher of the version it refers
   2848           to gives permission.
   2849 
   2850        K. For any section Entitled "Acknowledgements" or "Dedications",
   2851           Preserve the Title of the section, and preserve in the section
   2852           all the substance and tone of each of the contributor
   2853           acknowledgements and/or dedications given therein.
   2854 
   2855        L. Preserve all the Invariant Sections of the Document, unaltered
   2856           in their text and in their titles.  Section numbers or the
   2857           equivalent are not considered part of the section titles.
   2858 
   2859        M. Delete any section Entitled "Endorsements".  Such a section
   2860           may not be included in the Modified Version.
   2861 
   2862        N. Do not retitle any existing section to be Entitled
   2863           "Endorsements" or to conflict in title with any Invariant
   2864           Section.
   2865 
   2866        O. Preserve any Warranty Disclaimers.
   2867 
   2868      If the Modified Version includes new front-matter sections or
   2869      appendices that qualify as Secondary Sections and contain no
   2870      material copied from the Document, you may at your option designate
   2871      some or all of these sections as invariant.  To do this, add their
   2872      titles to the list of Invariant Sections in the Modified Version's
   2873      license notice.  These titles must be distinct from any other
   2874      section titles.
   2875 
   2876      You may add a section Entitled "Endorsements", provided it contains
   2877      nothing but endorsements of your Modified Version by various
   2878      parties--for example, statements of peer review or that the text
   2879      has been approved by an organization as the authoritative
   2880      definition of a standard.
   2881 
   2882      You may add a passage of up to five words as a Front-Cover Text,
   2883      and a passage of up to 25 words as a Back-Cover Text, to the end of
   2884      the list of Cover Texts in the Modified Version.  Only one passage
   2885      of Front-Cover Text and one of Back-Cover Text may be added by (or
   2886      through arrangements made by) any one entity.  If the Document
   2887      already includes a cover text for the same cover, previously added
   2888      by you or by arrangement made by the same entity you are acting on
   2889      behalf of, you may not add another; but you may replace the old
   2890      one, on explicit permission from the previous publisher that added
   2891      the old one.
   2892 
   2893      The author(s) and publisher(s) of the Document do not by this
   2894      License give permission to use their names for publicity for or to
   2895      assert or imply endorsement of any Modified Version.
   2896 
   2897   5. COMBINING DOCUMENTS
   2898 
   2899      You may combine the Document with other documents released under
   2900      this License, under the terms defined in section 4 above for
   2901      modified versions, provided that you include in the combination all
   2902      of the Invariant Sections of all of the original documents,
   2903      unmodified, and list them all as Invariant Sections of your
   2904      combined work in its license notice, and that you preserve all
   2905      their Warranty Disclaimers.
   2906 
   2907      The combined work need only contain one copy of this License, and
   2908      multiple identical Invariant Sections may be replaced with a single
   2909      copy.  If there are multiple Invariant Sections with the same name
   2910      but different contents, make the title of each such section unique
   2911      by adding at the end of it, in parentheses, the name of the
   2912      original author or publisher of that section if known, or else a
   2913      unique number.  Make the same adjustment to the section titles in
   2914      the list of Invariant Sections in the license notice of the
   2915      combined work.
   2916 
   2917      In the combination, you must combine any sections Entitled
   2918      "History" in the various original documents, forming one section
   2919      Entitled "History"; likewise combine any sections Entitled
   2920      "Acknowledgements", and any sections Entitled "Dedications".  You
   2921      must delete all sections Entitled "Endorsements."
   2922 
   2923   6. COLLECTIONS OF DOCUMENTS
   2924 
   2925      You may make a collection consisting of the Document and other
   2926      documents released under this License, and replace the individual
   2927      copies of this License in the various documents with a single copy
   2928      that is included in the collection, provided that you follow the
   2929      rules of this License for verbatim copying of each of the documents
   2930      in all other respects.
   2931 
   2932      You may extract a single document from such a collection, and
   2933      distribute it individually under this License, provided you insert
   2934      a copy of this License into the extracted document, and follow this
   2935      License in all other respects regarding verbatim copying of that
   2936      document.
   2937 
   2938   7. AGGREGATION WITH INDEPENDENT WORKS
   2939 
   2940      A compilation of the Document or its derivatives with other
   2941      separate and independent documents or works, in or on a volume of a
   2942      storage or distribution medium, is called an "aggregate" if the
   2943      copyright resulting from the compilation is not used to limit the
   2944      legal rights of the compilation's users beyond what the individual
   2945      works permit.  When the Document is included in an aggregate, this
   2946      License does not apply to the other works in the aggregate which
   2947      are not themselves derivative works of the Document.
   2948 
   2949      If the Cover Text requirement of section 3 is applicable to these
   2950      copies of the Document, then if the Document is less than one half
   2951      of the entire aggregate, the Document's Cover Texts may be placed
   2952      on covers that bracket the Document within the aggregate, or the
   2953      electronic equivalent of covers if the Document is in electronic
   2954      form.  Otherwise they must appear on printed covers that bracket
   2955      the whole aggregate.
   2956 
   2957   8. TRANSLATION
   2958 
   2959      Translation is considered a kind of modification, so you may
   2960      distribute translations of the Document under the terms of section
   2961      4.  Replacing Invariant Sections with translations requires special
   2962      permission from their copyright holders, but you may include
   2963      translations of some or all Invariant Sections in addition to the
   2964      original versions of these Invariant Sections.  You may include a
   2965      translation of this License, and all the license notices in the
   2966      Document, and any Warranty Disclaimers, provided that you also
   2967      include the original English version of this License and the
   2968      original versions of those notices and disclaimers.  In case of a
   2969      disagreement between the translation and the original version of
   2970      this License or a notice or disclaimer, the original version will
   2971      prevail.
   2972 
   2973      If a section in the Document is Entitled "Acknowledgements",
   2974      "Dedications", or "History", the requirement (section 4) to
   2975      Preserve its Title (section 1) will typically require changing the
   2976      actual title.
   2977 
   2978   9. TERMINATION
   2979 
   2980      You may not copy, modify, sublicense, or distribute the Document
   2981      except as expressly provided under this License.  Any attempt
   2982      otherwise to copy, modify, sublicense, or distribute it is void,
   2983      and will automatically terminate your rights under this License.
   2984 
   2985      However, if you cease all violation of this License, then your
   2986      license from a particular copyright holder is reinstated (a)
   2987      provisionally, unless and until the copyright holder explicitly and
   2988      finally terminates your license, and (b) permanently, if the
   2989      copyright holder fails to notify you of the violation by some
   2990      reasonable means prior to 60 days after the cessation.
   2991 
   2992      Moreover, your license from a particular copyright holder is
   2993      reinstated permanently if the copyright holder notifies you of the
   2994      violation by some reasonable means, this is the first time you have
   2995      received notice of violation of this License (for any work) from
   2996      that copyright holder, and you cure the violation prior to 30 days
   2997      after your receipt of the notice.
   2998 
   2999      Termination of your rights under this section does not terminate
   3000      the licenses of parties who have received copies or rights from you
   3001      under this License.  If your rights have been terminated and not
   3002      permanently reinstated, receipt of a copy of some or all of the
   3003      same material does not give you any rights to use it.
   3004 
   3005   10. FUTURE REVISIONS OF THIS LICENSE
   3006 
   3007      The Free Software Foundation may publish new, revised versions of
   3008      the GNU Free Documentation License from time to time.  Such new
   3009      versions will be similar in spirit to the present version, but may
   3010      differ in detail to address new problems or concerns.  See
   3011      <http://www.gnu.org/copyleft/>.
   3012 
   3013      Each version of the License is given a distinguishing version
   3014      number.  If the Document specifies that a particular numbered
   3015      version of this License "or any later version" applies to it, you
   3016      have the option of following the terms and conditions either of
   3017      that specified version or of any later version that has been
   3018      published (not as a draft) by the Free Software Foundation.  If the
   3019      Document does not specify a version number of this License, you may
   3020      choose any version ever published (not as a draft) by the Free
   3021      Software Foundation.  If the Document specifies that a proxy can
   3022      decide which future versions of this License can be used, that
   3023      proxy's public statement of acceptance of a version permanently
   3024      authorizes you to choose that version for the Document.
   3025 
   3026   11. RELICENSING
   3027 
   3028      "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
   3029      World Wide Web server that publishes copyrightable works and also
   3030      provides prominent facilities for anybody to edit those works.  A
   3031      public wiki that anybody can edit is an example of such a server.
   3032      A "Massive Multiauthor Collaboration" (or "MMC") contained in the
   3033      site means any set of copyrightable works thus published on the MMC
   3034      site.
   3035 
   3036      "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
   3037      license published by Creative Commons Corporation, a not-for-profit
   3038      corporation with a principal place of business in San Francisco,
   3039      California, as well as future copyleft versions of that license
   3040      published by that same organization.
   3041 
   3042      "Incorporate" means to publish or republish a Document, in whole or
   3043      in part, as part of another Document.
   3044 
   3045      An MMC is "eligible for relicensing" if it is licensed under this
   3046      License, and if all works that were first published under this
   3047      License somewhere other than this MMC, and subsequently
   3048      incorporated in whole or in part into the MMC, (1) had no cover
   3049      texts or invariant sections, and (2) were thus incorporated prior
   3050      to November 1, 2008.
   3051 
   3052      The operator of an MMC Site may republish an MMC contained in the
   3053      site under CC-BY-SA on the same site at any time before August 1,
   3054      2009, provided the MMC is eligible for relicensing.
   3055 
   3056 ADDENDUM: How to use this License for your documents
   3057 ====================================================
   3058 
   3059 To use this License in a document you have written, include a copy of
   3060 the License in the document and put the following copyright and license
   3061 notices just after the title page:
   3062 
   3063        Copyright (C)  YEAR  YOUR NAME.
   3064        Permission is granted to copy, distribute and/or modify this document
   3065        under the terms of the GNU Free Documentation License, Version 1.3
   3066        or any later version published by the Free Software Foundation;
   3067        with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
   3068        Texts.  A copy of the license is included in the section entitled ``GNU
   3069        Free Documentation License''.
   3070 
   3071    If you have Invariant Sections, Front-Cover Texts and Back-Cover
   3072 Texts, replace the "with...Texts."  line with this:
   3073 
   3074          with the Invariant Sections being LIST THEIR TITLES, with
   3075          the Front-Cover Texts being LIST, and with the Back-Cover Texts
   3076          being LIST.
   3077 
   3078    If you have Invariant Sections without Cover Texts, or some other
   3079 combination of the three, merge those two alternatives to suit the
   3080 situation.
   3081 
   3082    If your document contains nontrivial examples of program code, we
   3083 recommend releasing these examples in parallel under your choice of free
   3084 software license, such as the GNU General Public License, to permit
   3085 their use in free software.
   3086 
   3087 
   3088 File: libgomp.info,  Node: Funding,  Next: Library Index,  Prev: GNU Free Documentation License,  Up: Top
   3089 
   3090 Funding Free Software
   3091 *********************
   3092 
   3093 If you want to have more free software a few years from now, it makes
   3094 sense for you to help encourage people to contribute funds for its
   3095 development.  The most effective approach known is to encourage
   3096 commercial redistributors to donate.
   3097 
   3098    Users of free software systems can boost the pace of development by
   3099 encouraging for-a-fee distributors to donate part of their selling price
   3100 to free software developers--the Free Software Foundation, and others.
   3101 
   3102    The way to convince distributors to do this is to demand it and
   3103 expect it from them.  So when you compare distributors, judge them
   3104 partly by how much they give to free software development.  Show
   3105 distributors they must compete to be the one who gives the most.
   3106 
   3107    To make this approach work, you must insist on numbers that you can
   3108 compare, such as, "We will donate ten dollars to the Frobnitz project
   3109 for each disk sold."  Don't be satisfied with a vague promise, such as
   3110 "A portion of the profits are donated," since it doesn't give a basis
   3111 for comparison.
   3112 
   3113    Even a precise fraction "of the profits from this disk" is not very
   3114 meaningful, since creative accounting and unrelated business decisions
   3115 can greatly alter what fraction of the sales price counts as profit.  If
   3116 the price you pay is $50, ten percent of the profit is probably less
   3117 than a dollar; it might be a few cents, or nothing at all.
   3118 
   3119    Some redistributors do development work themselves.  This is useful
   3120 too; but to keep everyone honest, you need to inquire how much they do,
   3121 and what kind.  Some kinds of development make much more long-term
   3122 difference than others.  For example, maintaining a separate version of
   3123 a program contributes very little; maintaining the standard version of a
   3124 program for the whole community contributes much.  Easy new ports
   3125 contribute little, since someone else would surely do them; difficult
   3126 ports such as adding a new CPU to the GNU Compiler Collection contribute
   3127 more; major new features or packages contribute the most.
   3128 
   3129    By establishing the idea that supporting further development is "the
   3130 proper thing to do" when distributing free software for a fee, we can
   3131 assure a steady flow of resources into making more free software.
   3132 
   3133      Copyright (C) 1994 Free Software Foundation, Inc.
   3134      Verbatim copying and redistribution of this section is permitted
   3135      without royalty; alteration is not permitted.
   3136 
   3137 
   3138 File: libgomp.info,  Node: Library Index,  Prev: Funding,  Up: Top
   3139 
   3140 Library Index
   3141 *************
   3142 
   3143 [index]
   3144 * Menu:
   3145 
   3146 * Environment Variable:                  OMP_CANCELLATION.      (line 6)
   3147 * Environment Variable <1>:              OMP_DISPLAY_ENV.       (line 6)
   3148 * Environment Variable <2>:              OMP_DEFAULT_DEVICE.    (line 6)
   3149 * Environment Variable <3>:              OMP_DYNAMIC.           (line 6)
   3150 * Environment Variable <4>:              OMP_MAX_ACTIVE_LEVELS. (line 6)
   3151 * Environment Variable <5>:              OMP_NESTED.            (line 6)
   3152 * Environment Variable <6>:              OMP_NUM_THREADS.       (line 6)
   3153 * Environment Variable <7>:              OMP_PROC_BIND.         (line 6)
   3154 * Environment Variable <8>:              OMP_PLACES.            (line 6)
   3155 * Environment Variable <9>:              OMP_STACKSIZE.         (line 6)
   3156 * Environment Variable <10>:             OMP_SCHEDULE.          (line 6)
   3157 * Environment Variable <11>:             OMP_THREAD_LIMIT.      (line 6)
   3158 * Environment Variable <12>:             OMP_WAIT_POLICY.       (line 6)
   3159 * Environment Variable <13>:             GOMP_CPU_AFFINITY.     (line 6)
   3160 * Environment Variable <14>:             GOMP_DEBUG.            (line 6)
   3161 * Environment Variable <15>:             GOMP_STACKSIZE.        (line 6)
   3162 * Environment Variable <16>:             GOMP_SPINCOUNT.        (line 6)
   3163 * FDL, GNU Free Documentation License:   GNU Free Documentation License.
   3164                                                                 (line 6)
   3165 * Implementation specific setting:       OMP_NESTED.            (line 6)
   3166 * Implementation specific setting <1>:   OMP_NUM_THREADS.       (line 6)
   3167 * Implementation specific setting <2>:   OMP_SCHEDULE.          (line 6)
   3168 * Implementation specific setting <3>:   GOMP_STACKSIZE.        (line 6)
   3169 * Implementation specific setting <4>:   GOMP_SPINCOUNT.        (line 6)
   3170 * Introduction:                          Top.                   (line 6)
   3171 
   3172 
   3173 
   3174 Tag Table:
   3175 Node: Top2083
   3176 Node: Enabling OpenMP3878
   3177 Node: Runtime Library Routines4665
   3178 Node: omp_get_active_level7652
   3179 Node: omp_get_ancestor_thread_num8352
   3180 Node: omp_get_cancellation9282
   3181 Node: omp_get_default_device10096
   3182 Node: omp_get_dynamic10772
   3183 Node: omp_get_level11647
   3184 Node: omp_get_max_active_levels12267
   3185 Node: omp_get_max_threads12966
   3186 Node: omp_get_nested13723
   3187 Node: omp_get_num_devices14635
   3188 Node: omp_get_num_procs15156
   3189 Node: omp_get_num_teams15695
   3190 Node: omp_get_num_threads16211
   3191 Node: omp_get_proc_bind17300
   3192 Node: omp_get_schedule18221
   3193 Node: omp_get_team_num19167
   3194 Node: omp_get_team_size19666
   3195 Node: omp_get_thread_limit20626
   3196 Node: omp_get_thread_num21245
   3197 Node: omp_in_parallel22116
   3198 Node: omp_in_final22765
   3199 Node: omp_is_initial_device23439
   3200 Node: omp_set_default_device24132
   3201 Node: omp_set_dynamic24923
   3202 Node: omp_set_max_active_levels25809
   3203 Node: omp_set_nested26586
   3204 Node: omp_set_num_threads27478
   3205 Node: omp_set_schedule28346
   3206 Node: omp_init_lock29397
   3207 Node: omp_set_lock30050
   3208 Node: omp_test_lock30905
   3209 Node: omp_unset_lock31881
   3210 Node: omp_destroy_lock32812
   3211 Node: omp_init_nest_lock33489
   3212 Node: omp_set_nest_lock34224
   3213 Node: omp_test_nest_lock35139
   3214 Node: omp_unset_nest_lock36166
   3215 Node: omp_destroy_nest_lock37181
   3216 Node: omp_get_wtick37932
   3217 Node: omp_get_wtime38524
   3218 Node: Environment Variables39300
   3219 Node: OMP_CANCELLATION40692
   3220 Node: OMP_DISPLAY_ENV41225
   3221 Node: OMP_DEFAULT_DEVICE41928
   3222 Node: OMP_DYNAMIC42708
   3223 Node: OMP_MAX_ACTIVE_LEVELS43304
   3224 Node: OMP_NESTED43943
   3225 Node: OMP_NUM_THREADS44548
   3226 Node: OMP_PROC_BIND45236
   3227 Node: OMP_PLACES46428
   3228 Node: OMP_STACKSIZE48603
   3229 Node: OMP_SCHEDULE49427
   3230 Node: OMP_THREAD_LIMIT50123
   3231 Node: OMP_WAIT_POLICY50723
   3232 Node: GOMP_CPU_AFFINITY51415
   3233 Node: GOMP_DEBUG53145
   3234 Node: GOMP_STACKSIZE53652
   3235 Node: GOMP_SPINCOUNT54481
   3236 Node: The libgomp ABI55653
   3237 Node: Implementing MASTER construct56452
   3238 Node: Implementing CRITICAL construct56866
   3239 Node: Implementing ATOMIC construct57605
   3240 Node: Implementing FLUSH construct58086
   3241 Node: Implementing BARRIER construct58357
   3242 Node: Implementing THREADPRIVATE construct58626
   3243 Node: Implementing PRIVATE clause59279
   3244 Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses59860
   3245 Node: Implementing REDUCTION clause61184
   3246 Node: Implementing PARALLEL construct61741
   3247 Node: Implementing FOR construct62998
   3248 Node: Implementing ORDERED construct64996
   3249 Node: Implementing SECTIONS construct65302
   3250 Node: Implementing SINGLE construct66068
   3251 Node: Reporting Bugs66730
   3252 Node: Copying67090
   3253 Node: GNU Free Documentation License104637
   3254 Node: Funding129760
   3255 Node: Library Index132286
   3256 
   3257 End Tag Table
   3258